git @ Cat's Eye Technologies SixtyPical / 6fc3ce2
Finally, vector table for actor logic in demo game works. Chris Pressey 3 years ago
1 changed file(s) with 3 addition(s) and 21 deletion(s). Raw diff Collapse all Expand all
250250 repeat {
251251 copy pos, actor_pos + y
252252 copy word 40, actor_delta + y
253 copy forward null_logic, actor_logic + y
253 copy forward enemy_logic, actor_logic + y
254254
255255 st off, c
256256 add pos, word 7
262262 ld y, 0
263263 copy word 0, actor_pos + y
264264 copy word 0, actor_delta + y
265 // copy forward player_logic, actor_logic + y
265 copy forward player_logic, actor_logic + y
266266 }
267267
268268 // ----------------------------------------------------------------
386386 st off, c
387387 }
388388
389 define null_logic logic_routine
390 {
391 copy pos, new_pos
392 copy new_pos, pos
393 st off, c
394 }
395
396389 // ----------------------------------------------------------------
397390 // Game States
398391 // ----------------------------------------------------------------
444437
445438 st x, save_x
446439
447 // OLD SKOOL
448 cmp x, 0
449 if z {
450 call player_logic
451 } else {
452 call enemy_logic
453 }
454
455 ld x, save_x
456
457 // NEW SKOOL
458440 copy actor_logic + x, dispatch_logic
459 call null_logic // dispatch_logic
441 call dispatch_logic
460442
461443 if c {
462444 // Player died! Want no dead! Break out of the loop (this is a bit awkward.)