bzr branch
http://9ix.org/bzr/ld27
3
by Josh C
map loading, super basic movement |
1 |
local velLimit = 400 |
2 |
Player = Tile:extend{ |
|
3 |
image = 'data/player.png', |
|
4 |
maxVelocity = {x=velLimit,y=velLimit}, |
|
5 |
minVelocity = {x=-velLimit, y=-velLimit}, |
|
6 |
onStartFrame = function(self) |
|
7 |
if the.keys:pressed('left') then |
|
9
by Josh C
3rd maze... reverse |
8 |
self.velocity.x = -200 * the.activeMaze.moveMod |
3
by Josh C
map loading, super basic movement |
9 |
elseif the.keys:pressed('right') then |
9
by Josh C
3rd maze... reverse |
10 |
self.velocity.x = 200 * the.activeMaze.moveMod |
3
by Josh C
map loading, super basic movement |
11 |
else |
12 |
self.velocity.x = 0 |
|
13 |
end |
|
14 |
||
15 |
if the.keys:pressed('up') then |
|
9
by Josh C
3rd maze... reverse |
16 |
self.velocity.y = -200 * the.activeMaze.moveMod |
3
by Josh C
map loading, super basic movement |
17 |
elseif the.keys:pressed('down') then |
9
by Josh C
3rd maze... reverse |
18 |
self.velocity.y = 200 * the.activeMaze.moveMod |
3
by Josh C
map loading, super basic movement |
19 |
else |
20 |
self.velocity.y = 0 |
|
21 |
end |
|
22 |
end, |
|
23 |
onCollide = function(self, other) |
|
24 |
other:displace(self) |
|
25 |
end |
|
26 |
} |