NEVERMIND I FIGURED IT OUT
I remembered what the code in the tutorial was, and after adding it back in I still go the "branch out of range error." I think I figured out why. In his example it only had to skip one line of code, so BEQ +isEvenFrame had no problems. However, in my case there are much more lines to skip through, so I instead had to do BEQ +isOddFrame JMP +isEvenFrame. And now it works. Now I just need to figure out limiting the projectiles. This is my projectile code as it stands:
Code:
;;; Create a Projectile.
;;; Assumes that the projectile you want to create is in GameObject Slot 01.
TXA
PHA
TYA
PHA
LDX player1_object
LDA Object_x_hi,x ; get player x coord
STA tempA
LDA Object_y_hi,x; get player y coord
STA tempB
LDA Object_screen,x
STA tempC
CreateObjectOnScreen tempA, tempB, #$03, #$00, tempC
;;; x, y, object, starting action.
;;; and now with that object, copy the player's
;;; direction and start it moving that way.
PLA
TAY
PLA
TAX
RTS
This is the input code, which I believe you're actually the one who gave it to me. I assume this is the script I need to edit, but I'm not really sure what to do. I imagine I need some way to count the number of this same object on the screen, right? But I'm unsure on specifically how to do that. I saw a code posted in another thread, but it didn't seem applicable to me, and when I tried to use it the game wouldn't launch. The code in question:
Code:
canShoot:
;; We count the projectile already on screen to see if can Shoot another one :
CountObjects #%00000100, #$00 ;; count player weapon on screen
LDA monsterCounter ;; the variable used to count is monsterCounter
CLC
CMP #PROJECTILE_MAX ;; compare to 2
BCC + ;; if less than 2 on screen we can create a projectile
RTS ;; else we quit
+
He says to put this code under the part of the script that says "canShoot," but my script doesn't have that. If I try to add it, it says "Already defined(8)," line 8, being where "canShoot" is inserted. If I insert the code without "canShoot," however, it just doesn't limit the projectiles. Just wastes lines. I need to find a way to get this code to work for my script.