-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmoon.lua
53 lines (53 loc) · 1.35 KB
/
moon.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
local graphics, physics
do
local _obj_0 = love
graphics, physics = _obj_0.graphics, _obj_0.physics
end
local Moon
do
local _class_0
local _base_0 = {
getPosition = function(self)
return self.body:getPosition()
end,
getX = function(self)
return self.body:getX()
end,
getY = function(self)
return self.body:getY()
end,
draw = function(self)
return graphics.draw(self.tex, self.body:getX(), self.body:getY(), self.body:getAngle(), 1, 1, self.radius, self.radius)
end
}
_base_0.__index = _base_0
_class_0 = setmetatable({
__init = function(self, assets, world, x, y)
self.tex = assets.tex.moon
self.body = physics.newBody(world, x, y)
local _
self.radius, _ = self.tex:getDimensions()
self.radius = self.radius / 2
self.shape = physics.newCircleShape(self.radius)
self.fixture = physics.newFixture(self.body, self.shape)
self.fixture:setFriction(0.7)
return self.fixture:setGroupIndex(self.__class.PH_GROUP)
end,
__base = _base_0,
__name = "Moon"
}, {
__index = _base_0,
__call = function(cls, ...)
local _self_0 = setmetatable({}, _base_0)
cls.__init(_self_0, ...)
return _self_0
end
})
_base_0.__class = _class_0
local self = _class_0
self.PH_GROUP = 1
Moon = _class_0
end
return {
Moon = Moon
}