Right now, I'm trying to figure out how to get the zapper to fire one shot at a time. As it stands, when I hold the right-click button down on the mouse, it repeats over and over and over again. I can't quite figure out what to do to make it single shot, such as in every other zapper game : P
Here is the code I have presently running in NMI:
The jsr object1_tile_switch is actually a badly named routine right now, as it's actually a palette switch for the testing (filling all white). I'm guessing this would be the way to do it, anyway.
But yeah, any ideas on how to make the zapper fire only once per frame when pulled? Thanks for any input; pun intended! ; )
Here is the code I have presently running in NMI:
Code:
battling:
lda check_shot
beq :+
jsr object1_tile_switch
lda reg2001_save
ora #%00001000
sta $2001
sta reg2001_save
lda #$00
sta check_shot
jmp @not_pulled
: lda $4017
and #test_trigger
beq @not_pulled
lda #$01
sta check_shot
lda reg2001_save
and #%11110111
sta $2001
sta reg2001_save
@not_pulled:
lda check_shot
beq :+
jsr object1_tile_switch
lda reg2001_save
ora #%00001000
sta $2001
sta reg2001_save
lda #$00
sta check_shot
jmp @not_pulled
: lda $4017
and #test_trigger
beq @not_pulled
lda #$01
sta check_shot
lda reg2001_save
and #%11110111
sta $2001
sta reg2001_save
@not_pulled:
The jsr object1_tile_switch is actually a badly named routine right now, as it's actually a palette switch for the testing (filling all white). I'm guessing this would be the way to do it, anyway.
But yeah, any ideas on how to make the zapper fire only once per frame when pulled? Thanks for any input; pun intended! ; )