-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzombieB.lua
75 lines (63 loc) · 1.51 KB
/
zombieB.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
--
-- created with TexturePacker (http://www.codeandweb.com/texturepacker)
--
-- $TexturePacker:SmartUpdate:833dada7b5612b63668ea311a6e3d802:eea0cfb691f8b9466ea2aa15e24bfa00:b08a273287f2401a32523d55313a1a13$
--
-- local sheetInfo = require("mysheet")
-- local myImageSheet = graphics.newImageSheet( "mysheet.png", sheetInfo:getSheet() )
-- local sprite = display.newSprite( myImageSheet , {frames={sheetInfo:getFrameIndex("sprite")}} )
--
local SheetInfo = {}
SheetInfo.sheet =
{
frames = {
{
-- Zombie B 1
x=1,
y=43,
width=56,
height=40,
sourceX = 0,
sourceY = 20,
sourceWidth = 80,
sourceHeight = 60
},
{
-- Zombie B 2
x=1,
y=85,
width=56,
height=40,
sourceX = 0,
sourceY = 20,
sourceWidth = 80,
sourceHeight = 60
},
{
-- Zombie B 3
x=1,
y=1,
width=58,
height=40,
sourceX = 0,
sourceY = 20,
sourceWidth = 80,
sourceHeight = 60
},
},
sheetContentWidth = 60,
sheetContentHeight = 126
}
SheetInfo.frameIndex =
{
["Zombie B 1"] = 1,
["Zombie B 2"] = 2,
["Zombie B 3"] = 3,
}
function SheetInfo:getSheet()
return self.sheet;
end
function SheetInfo:getFrameIndex(name)
return self.frameIndex[name];
end
return SheetInfo