fysplane/entities/ground.lua

23 lines
531 B
Lua
Raw Permalink Normal View History

Class = require 'hump.class'
require 'entities/rectangle'
require 'utils'
Ground = Class{
__includes = Rectangle,
init = function(self, level)
local groundImg = love.graphics.newImage('resources/graphics/ground.png')
Rectangle.init(self,
-200, levelHeight(),
level, "static",
0,
levelWidth() + 400, 20, 0, groundImg)
2014-10-20 19:55:32 +00:00
self.fixture:setRestitution(0)
self.fixture:setFriction(0.5)
end;
update = function(self, dt)
self.body:setY(levelHeight() - 10)
end;
}