|
|
@ -1,16 +1,11 @@
|
|
|
|
-- Constructor
|
|
|
|
-- Constructor
|
|
|
|
|
|
|
|
|
|
|
|
function new_pokemon(name, enemy, front_sprite, back_sprite, cry)
|
|
|
|
function new_pokemon(name, enemy, front_sprite, back_sprite, cry)
|
|
|
|
enemy_x = 78
|
|
|
|
p_x = 12
|
|
|
|
enemy_y = 8
|
|
|
|
p_y = 56
|
|
|
|
player_x = 12
|
|
|
|
|
|
|
|
player_y = 56
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
p_x = player_x
|
|
|
|
|
|
|
|
p_y = player_y
|
|
|
|
|
|
|
|
if enemy then
|
|
|
|
if enemy then
|
|
|
|
p_x = enemy_x
|
|
|
|
p_x = 78
|
|
|
|
p_y = enemy_y
|
|
|
|
p_y = 8
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
@ -19,7 +14,6 @@ function new_pokemon(name, enemy, front_sprite, back_sprite, cry)
|
|
|
|
front_sprite = front_sprite,
|
|
|
|
front_sprite = front_sprite,
|
|
|
|
back_sprite = back_sprite,
|
|
|
|
back_sprite = back_sprite,
|
|
|
|
cry = cry,
|
|
|
|
cry = cry,
|
|
|
|
-- moves = moves,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
x = p_x,
|
|
|
|
x = p_x,
|
|
|
|
y = p_y,
|
|
|
|
y = p_y,
|
|
|
@ -38,6 +32,10 @@ function appear(p)
|
|
|
|
p.appeared = true
|
|
|
|
p.appeared = true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function cry(p)
|
|
|
|
|
|
|
|
sfx(p.cry)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function draw_p(p)
|
|
|
|
function draw_p(p)
|
|
|
|
if p.enemy then
|
|
|
|
if p.enemy then
|
|
|
|
draw_front(p)
|
|
|
|
draw_front(p)
|
|
|
@ -54,8 +52,16 @@ function draw_back(p)
|
|
|
|
draw_p_spr(p.back_sprite, p.x, p.y)
|
|
|
|
draw_p_spr(p.back_sprite, p.x, p.y)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function cry(p)
|
|
|
|
function draw_p_spr(start, x, y)
|
|
|
|
sfx(p.cry)
|
|
|
|
for i=0,3 do
|
|
|
|
|
|
|
|
tile_row = 16 * i
|
|
|
|
|
|
|
|
spr_row = 8 * i
|
|
|
|
|
|
|
|
for k=0,3 do
|
|
|
|
|
|
|
|
spr_column = 8 * k
|
|
|
|
|
|
|
|
tile = start + tile_row + k
|
|
|
|
|
|
|
|
spr(tile, x+spr_column, y+spr_row)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--Pokemon
|
|
|
|
--Pokemon
|
|
|
@ -76,17 +82,3 @@ function axoleafel(enemy)
|
|
|
|
-- {}
|
|
|
|
-- {}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- Functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function draw_p_spr(start, x, y)
|
|
|
|
|
|
|
|
for i=0,3 do
|
|
|
|
|
|
|
|
tile_row = 16 * i
|
|
|
|
|
|
|
|
spr_row = 8 * i
|
|
|
|
|
|
|
|
for k=0,3 do
|
|
|
|
|
|
|
|
spr_column = 8 * k
|
|
|
|
|
|
|
|
tile = start + tile_row + k
|
|
|
|
|
|
|
|
spr(tile, x+spr_column, y+spr_row)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|