-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathStageWall.lua
More file actions
31 lines (24 loc) · 799 Bytes
/
StageWall.lua
File metadata and controls
31 lines (24 loc) · 799 Bytes
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
-- StageWall.lua
StageWall = class(Panel)
function StageWall:init(x,y,w,h,screen)
Panel.init(self,x,y)
-- dimensions needed for the physics
self.w = w
self.h = h
-- make the pole
local obj = ShadowObj(-w/2,8,w,h-16)
self:add(obj)
screen:doDraw(obj,"Cargo Bot:Claw Arm",0,-8)
self.pole = obj -- for detecting when we collide
-- the top base
local obj = ShadowObj(16,h-9,-32,9)
self:add(obj)
screen:doDraw(obj,"Cargo Bot:Claw Base",0,-8)
-- the bottom base
local obj = ShadowObj(16,9,-32,-9)
self:add(obj)
screen:doDraw(obj,"Cargo Bot:Claw Base",0,-8)
self.base = obj -- needed for the physics
-- so that the sprite shadows show in the correct direction
if self.x > WIDTH / 2 then self:flipX() end
end