1
0
mirror of https://github.com/catseye/SixtyPical.git synced 2024-11-25 07:32:16 +00:00

More statics in demo game.

This commit is contained in:
Chris Pressey 2018-02-09 16:57:49 +00:00
parent 1bd765dbce
commit e9d9c717bb
3 changed files with 11 additions and 8 deletions

View File

@ -37,7 +37,7 @@ typedef routine
outputs button_down, dispatch_game_state,
actor_pos, actor_delta, actor_logic,
screen, screen1, screen2, screen3, screen4, colormap1, colormap2, colormap3, colormap4
trashes a, x, y, c, z, n, v, pos, new_pos, delta, ptr, compare_target, dispatch_logic
trashes a, x, y, c, z, n, v, pos, new_pos, delta, ptr, dispatch_logic
game_state_routine
//
@ -51,7 +51,7 @@ typedef routine
typedef routine
inputs pos, delta, joy2, screen
outputs pos, delta, new_pos, screen, c
trashes a, x, y, z, n, v, ptr, compare_target
trashes a, x, y, z, n, v, ptr
logic_routine
// ----------------------------------------------------------------
@ -93,8 +93,6 @@ vector logic_routine dispatch_logic
byte button_down : 0 // effectively static-local to check_button
byte table[32] press_fire_msg: "PRESS`FIRE`TO`PLAY"
word compare_target
//
// Points to the routine that implements the current game state.
//
@ -217,10 +215,11 @@ routine calculate_new_position
add new_pos, delta
}
routine check_new_position_in_bounds
define check_new_position_in_bounds routine
inputs new_pos
outputs c
trashes compare_target, a, z, n, v
trashes a, z, n, v
static word compare_target : 0
{
copy 1000, compare_target
st on, c
@ -321,6 +320,7 @@ define player_logic logic_routine
}
define enemy_logic logic_routine
static word compare_target : 0
{
call calculate_new_position
call check_new_position_in_bounds
@ -372,7 +372,6 @@ define enemy_logic logic_routine
} else {
copy $ffd8, delta
}
trash compare_target
}
st off, c

View File

@ -10,6 +10,7 @@ if [ "X$1" = "X" ]; then
fi
OUT=/tmp/a-out.prg
bin/sixtypical --traceback --basic-prelude $SRC > $OUT || exit 1
ls -la $OUT
if [ -e vicerc ]; then
$X64 -config vicerc $OUT
else

View File

@ -56,7 +56,10 @@ class IncompatibleConstraintsError(ConstraintsError):
def routine_has_static(routine, ref):
if not hasattr(routine, 'statics'):
return False
return ref in [static.location for static in routine.statics]
for static in routine.statics:
if static.location == ref:
return True
return False
class Context(object):