-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGoal.lua
More file actions
37 lines (32 loc) · 1.16 KB
/
Goal.lua
File metadata and controls
37 lines (32 loc) · 1.16 KB
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
-- Goa.lua
-- The area that appears on top in each level
Goal = class(BaseStage)
function Goal:config()
local config = {x=184,y=720,w=400,h=198,sprite="Cargo Bot:Goal Area"}
config.shadows = false
config.maxPiles = 9
config.crate = {w=21,h=21,borderY=-3,shadows=config.shadows}
-- setup dimensions for the piles
config.pile = {
y = 7,
base={h=10,borderY=-2,sprite="Cargo Bot:Platform"},
crate=config.crate,
shadows = config.shadows
}
-- we need pile width to know how far apart to draw the piles
config.pile.w = math.floor(config.w / config.maxPiles)
config.pile.h = config.h -- needed for editor mode to know whether a block should be added
config.pile.base.w = math.floor(config.pile.w*.8)
config.crateSprites = {
blue = {"Cargo Bot:Crate Goal Blue"},
red = {"Cargo Bot:Crate Goal Red"},
green = {"Cargo Bot:Crate Goal Green"},
yellow = {"Cargo Bot:Crate Goal Yellow"}
}
-- the little dx offsets
config.crateOffsets = {min=0,max=0}
return config
end
function Goal:init(screen,state)
BaseStage.init(self,Goal.config(),screen,state.piles)
end