mirror of
https://github.com/catseye/SixtyPical.git
synced 2025-01-25 08:30:07 +00:00
If player perishes, set a flag that game state will use to change.
This commit is contained in:
parent
0452d5f2c8
commit
be3591ae44
@ -242,12 +242,14 @@ routine init_game
|
|||||||
// Actor Logics
|
// Actor Logics
|
||||||
// ----------------------------------------------------------------
|
// ----------------------------------------------------------------
|
||||||
|
|
||||||
|
//
|
||||||
|
// Sets carry if the player perished. Carry clear otherwise.
|
||||||
|
//
|
||||||
|
|
||||||
routine player_logic
|
routine player_logic
|
||||||
inputs pos, delta, joy2, screen, dispatch_game_state,
|
inputs pos, delta, joy2, screen
|
||||||
screen1, screen2, screen3, screen4, colormap1, colormap2, colormap3, colormap4
|
outputs pos, delta, new_pos, screen, c
|
||||||
outputs pos, delta, new_pos, screen, dispatch_game_state,
|
trashes a, x, y, z, n, v, ptr, compare_target
|
||||||
screen1, screen2, screen3, screen4, colormap1, colormap2, colormap3, colormap4
|
|
||||||
trashes a, x, y, c, z, n, v, ptr, compare_target
|
|
||||||
{
|
{
|
||||||
call read_stick
|
call read_stick
|
||||||
|
|
||||||
@ -272,11 +274,11 @@ routine player_logic
|
|||||||
copy 32, [ptr] + y
|
copy 32, [ptr] + y
|
||||||
|
|
||||||
copy new_pos, pos
|
copy new_pos, pos
|
||||||
trash y
|
|
||||||
trash c
|
st off, c
|
||||||
} else {
|
} else {
|
||||||
call clear_screen
|
st on, c
|
||||||
copy forward game_state_game_over, dispatch_game_state
|
st off, c // FIXME this branch seems to be called even when there is no collision. why?
|
||||||
trash n
|
trash n
|
||||||
trash a
|
trash a
|
||||||
trash z
|
trash z
|
||||||
@ -290,16 +292,19 @@ routine player_logic
|
|||||||
trash y
|
trash y
|
||||||
trash a
|
trash a
|
||||||
trash v
|
trash v
|
||||||
trash c
|
|
||||||
} else {
|
} else {
|
||||||
trash c
|
st off, c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Sets carry if the player perished. Carry clear otherwise.
|
||||||
|
//
|
||||||
|
|
||||||
routine enemy_logic
|
routine enemy_logic
|
||||||
inputs pos, delta, joy2, screen
|
inputs pos, delta, joy2, screen
|
||||||
outputs pos, delta, screen
|
outputs pos, delta, screen, c
|
||||||
trashes a, x, y, c, z, n, v, ptr
|
trashes a, x, y, z, n, v, ptr
|
||||||
{
|
{
|
||||||
copy ^screen, ptr
|
copy ^screen, ptr
|
||||||
st off, c
|
st off, c
|
||||||
@ -307,6 +312,8 @@ routine enemy_logic
|
|||||||
ld y, 0
|
ld y, 0
|
||||||
|
|
||||||
copy 82, [ptr] + y
|
copy 82, [ptr] + y
|
||||||
|
|
||||||
|
st off, c
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------
|
// ----------------------------------------------------------------
|
||||||
@ -390,6 +397,19 @@ routine game_state_play
|
|||||||
call enemy_logic
|
call enemy_logic
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c {
|
||||||
|
// Player died! Want no dead! Break out of the loop (this is a bit awkward.)
|
||||||
|
call clear_screen
|
||||||
|
copy forward game_state_game_over, dispatch_game_state
|
||||||
|
ld x, 15
|
||||||
|
st x, save_x
|
||||||
|
trash n
|
||||||
|
trash z
|
||||||
|
trash x
|
||||||
|
} else {
|
||||||
|
trash c
|
||||||
|
}
|
||||||
|
|
||||||
ld x, save_x
|
ld x, save_x
|
||||||
|
|
||||||
copy pos, actor_pos + x
|
copy pos, actor_pos + x
|
||||||
|
Loading…
x
Reference in New Issue
Block a user