mirror of
https://github.com/robmcmullen/fujirun.git
synced 2024-06-08 02:29:28 +00:00
First semi-controllable player
This commit is contained in:
parent
d2fd62cd34
commit
c0a23a6ca2
46
logic.s
46
logic.s
|
@ -51,6 +51,27 @@ TITLE_SCREEN_TIME = 100
|
|||
; else:
|
||||
; c = None
|
||||
; zp.sprite_addr = c
|
||||
|
||||
|
||||
get_sprite nop
|
||||
; update pixel position
|
||||
lda actor_row,x
|
||||
tay
|
||||
lda player_row_to_y,y
|
||||
clc
|
||||
adc actor_ypixel,x
|
||||
sta actor_y,x
|
||||
lda actor_col,x
|
||||
tay
|
||||
lda player_col_to_x,y
|
||||
clc
|
||||
adc actor_xpixel,x
|
||||
sta actor_x,x
|
||||
|
||||
?end
|
||||
rts
|
||||
|
||||
|
||||
;
|
||||
;
|
||||
; ##### Game logic
|
||||
|
@ -176,6 +197,17 @@ move_enemy nop
|
|||
; current = actor_dir[zp.current_actor]
|
||||
lda actor_dir,x
|
||||
sta current
|
||||
|
||||
lda actor_row,x
|
||||
clc
|
||||
adc #1
|
||||
and #$0f
|
||||
sta actor_row,x
|
||||
lda actor_col,x
|
||||
clc
|
||||
adc #1
|
||||
and #$0f
|
||||
sta actor_col,x
|
||||
;
|
||||
; # check sub-pixel location to see if we've reached a decision point
|
||||
; temp = check_midpoint(current)
|
||||
|
@ -443,20 +475,8 @@ move_player nop
|
|||
lda c
|
||||
sta actor_col,x
|
||||
|
||||
; update pixel position
|
||||
ldy r
|
||||
lda player_row_to_y,y
|
||||
clc
|
||||
adc actor_ypixel,x
|
||||
sta actor_y,x
|
||||
ldy c
|
||||
lda player_col_to_x,y
|
||||
clc
|
||||
adc actor_xpixel,x
|
||||
sta actor_x,x
|
||||
?end rts
|
||||
|
||||
?end
|
||||
rts
|
||||
|
||||
;
|
||||
;
|
||||
|
|
19
screen.s
19
screen.s
|
@ -286,26 +286,27 @@ renderstart
|
|||
ldy #0
|
||||
sty damageindex
|
||||
|
||||
inc renderroundrobin_smc+1
|
||||
;inc renderroundrobin_smc+1
|
||||
|
||||
renderroundrobin_smc
|
||||
ldy #0
|
||||
sty param_index
|
||||
lda #0
|
||||
sta param_index
|
||||
|
||||
renderloop
|
||||
lda param_index
|
||||
and #actor_l - actor_active - 1
|
||||
tay
|
||||
lda actor_active,y
|
||||
tax
|
||||
lda actor_active,x
|
||||
beq renderskip ; skip if zero
|
||||
bmi renderend ; end if negative
|
||||
lda actor_l,y
|
||||
jsr get_sprite
|
||||
lda actor_l,x
|
||||
sta jsrsprite_smc+1
|
||||
lda actor_h,y
|
||||
lda actor_h,x
|
||||
sta jsrsprite_smc+2
|
||||
lda actor_x,y
|
||||
lda actor_x,x
|
||||
sta param_x
|
||||
lda actor_y,y
|
||||
lda actor_y,x
|
||||
sta param_y
|
||||
jmp jsrsprite_smc
|
||||
jsrsprite_smc
|
||||
|
|
Loading…
Reference in New Issue
Block a user