-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzombieA.lua
102 lines (87 loc) · 2.05 KB
/
zombieA.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
--
-- created with TexturePacker (http://www.codeandweb.com/texturepacker)
--
-- $TexturePacker:SmartUpdate:fda4d6c07c0531caed2edce0850b810d:73d7d94c03fc9ba9f9baecabcc8423ac:aac85189c8dab4210d29bcf9df3d25f2$
--
--local sheetInfo = require("mysheet")
--local myImageSheet = graphics.newImageSheet( "Art/Enemies/Zombie A/spriteSheet.png", sheetInfo:getSheet() )
--local sprite = display.newSprite( myImageSheet , {frames={sheetInfo:getFrameIndex("sprite")}} )
--
local SheetInfo = {}
SheetInfo.sheet =
{
frames = {
{
-- Zombie A 1
x=1,
y=1,
width=74,
height=114,
sourceX = 1,
sourceY = 6,
sourceWidth = 80,
sourceHeight = 120
},
{
-- Zombie A 2
x=77,
y=1,
width=74,
height=114,
sourceX = 1,
sourceY = 6,
sourceWidth = 80,
sourceHeight = 120
},
{
-- Zombie A 3
x=153,
y=1,
width=74,
height=114,
sourceX = 1,
sourceY = 6,
sourceWidth = 80,
sourceHeight = 120
},
{
-- Zombie A 4
x=229,
y=1,
width=74,
height=114,
sourceX = 1,
sourceY = 6,
sourceWidth = 80,
sourceHeight = 120
},
{
-- Zombie A 5
x=305,
y=1,
width=74,
height=114,
sourceX = 1,
sourceY = 6,
sourceWidth = 80,
sourceHeight = 120
},
},
sheetContentWidth = 380,
sheetContentHeight = 116
}
SheetInfo.frameIndex =
{
["Zombie A 1"] = 1,
["Zombie A 2"] = 2,
["Zombie A 3"] = 3,
["Zombie A 4"] = 4,
["Zombie A 5"] = 5,
}
function SheetInfo:getSheet()
return self.sheet;
end
function SheetInfo:getFrameIndex(name)
return self.frameIndex[name];
end
return SheetInfo