- [NEW] modul 'templates'
- [FIX] El primer frame de les animacions no es veia - [NEW] L'heroi ja dispara - [NEW] Les momies ja moren (petada, arreglar)
This commit is contained in:
41
data/templates.lua
Normal file
41
data/templates.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
templates = {
|
||||
ALIVE = 0,
|
||||
DYING = 1,
|
||||
DEAD = 2,
|
||||
RESURRECTING = 3,
|
||||
|
||||
create = function(type, options)
|
||||
local sprite
|
||||
if type == "mummy" then
|
||||
sprite = {
|
||||
type = type,
|
||||
pos = options.pos,--{ x=100, y=4*12*8+71 },
|
||||
size = { w=16,h=17 },
|
||||
bbo = { left=3, top=2, right=3, bottom=0 },
|
||||
current_frame = 1,
|
||||
current_wait = 1,
|
||||
flipped = options.flipped,
|
||||
animation = "mummy_walk",
|
||||
state = templates.ALIVE,
|
||||
enemy = true,
|
||||
ia = sprites.update_mummy
|
||||
}
|
||||
elseif type == "bullet" then
|
||||
sprite = {
|
||||
type = type,
|
||||
pos = options.pos,--{ x=100, y=4*12*8+71 },
|
||||
size = { w=4,h=3 },
|
||||
bbo = { left=0, top=0, right=0, bottom=0 },
|
||||
current_frame = 1,
|
||||
current_wait = 1,
|
||||
flipped = options.flipped,
|
||||
animation = "bullet",
|
||||
ia = sprites.update_bullet
|
||||
}
|
||||
else
|
||||
error("Template not recognized")
|
||||
end
|
||||
print("creat sprite de tipus "..type)
|
||||
return sprite
|
||||
end,
|
||||
}
|
||||
Reference in New Issue
Block a user