blob: 1aafddda466bba87496a2a0af2ab6a772ec1b627 (
plain)
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
local motionModule = {}
menu = false
function motionModule.motion(dt)
if love.keyboard.isDown(button.start) then
if menu == true then
accept(dt)
elseif menu == false then
pause(dt)
end
elseif love.keyboard.isDown(button.select) then
select(dt)
elseif love.keyboard.isDown(button.a) then
if menu == true then
accept(dt)
elseif menu == false then
if ground == true then
jump(dt)
end
end
elseif love.keyboard.isDown(button.b) then
if menu == true then
if acceptOnly == true then
accept(dt)
elseif acceptOnly == false then
if gameContinue == true then
dropContinueCount(dt)
elseif gameContinue == false then
cancel(dt)
end
end
elseif menu == false then
if ground == true then
hitGround(dt)
elseif ground == false then
hitAir(dt)
end
end
elseif love.keyboard.isDown(button.left, button.right, button.up, button.down) then
if menu == true then
if love.keyboard.isDown(button.left) then
selectLeft(dt)
elseif love.keyboard.isScancodeDown(button.right) then
selectRight(dt)
end
if love.keyboard.isScancodeDown(button.up) then
selectUp(dt)
elseif love.keyboard.isScancodeDown(button.down) then
selectDown(dt)
end
elseif menu == false then
if love.keyboard.isDown(button.left) then
walkLeft(dt)
elseif love.keyboard.isScancodeDown(button.right) then
walkRight(dt)
end
if love.keyboard.isScancodeDown(button.up) then
walkUp(dt)
elseif love.keyboard.isScancodeDown(button.down) then
walkDown(dt)
end
end
else
stand(dt)
end
end
function configuration(dt)
end
function coin(dt)
end
function accept(dt)
end
function cancel(dt)
end
function select(dt)
end
function dropContinueCount(dt)
end
function pause(dt)
end
function jump(dt)
end
function hitGround(dt)
end
function hitAir(dt)
end
function selectLeft(dt)
end
function selectRight(dt)
end
function selectUp(dt)
end
function selectDown(dt)
end
function walkLeft(dt)
character.bola.acceleration = character.bola.acceleration + dt
if character.bola.position.x >= character.bola.origin.x then
if character.bola.acceleration < 3 then
character.bola.position.x = character.bola.position.x - (character.bola.speed * dt) - character.bola.acceleration
else
character.bola.position.x = character.bola.position.x - (character.bola.speed * dt) - 3
end
end
quad = {
bola = character.bola.walk[math.floor(character.bola.walk.start)]
}
character.bola.scale.x = -1
end
function walkRight(dt)
character.bola.acceleration = character.bola.acceleration + dt
if character.bola.position.x <= windowProfile.mode.width - character.bola.origin.x then
if character.bola.acceleration < 3 then
character.bola.position.x = character.bola.position.x + (character.bola.speed * dt) + character.bola.acceleration
else
character.bola.position.x = character.bola.position.x + (character.bola.speed * dt) + 3
end
end
quad = {
bola = character.bola.walk[math.floor(character.bola.walk.start)]
}
character.bola.scale.x = 1
end
function walkUp(dt)
character.bola.acceleration = character.bola.acceleration + dt
if character.bola.position.y >= character.bola.origin.y then
if character.bola.acceleration < 3 then
character.bola.position.y = character.bola.position.y - (character.bola.speed * dt) - character.bola.acceleration
else
character.bola.position.y = character.bola.position.y - (character.bola.speed * dt) - 3
end
end
quad = {
bola = character.bola.walk[math.floor(character.bola.walk.start)]
}
end
function walkDown(dt)
character.bola.acceleration = character.bola.acceleration + dt
if character.bola.position.y <= windowProfile.mode.height - character.bola.origin.y then
if character.bola.acceleration < 3 then
character.bola.position.y = character.bola.position.y + (character.bola.speed * dt) + character.bola.acceleration
else
character.bola.position.y = character.bola.position.y + (character.bola.speed * dt) + 3
end
end
quad = {
bola = character.bola.walk[math.floor(character.bola.walk.start)]
}
end
function stand(dt)
character.bola.acceleration = 0
quad = {
bola = character.bola.stand[math.floor(character.bola.stand.start)]
}
end
return motionModule
|