After player death, projectile Y value incorrect

brockj

New member
It does not happen after every death, but it seems more frequent if the player is jumping at the time of death. Occasionally I can see the projectile at the top of the screen after the death leading me to believe the issue is with the Y value. I am wondering has anyone else come across this and if so how was it resolved? My recent approach has been to try to ensure the Y value is reset at death, but it doesn't seem to be working. From what I have seen, the Y value of the projectile should be set at the value of the player every time at projectile creation, but that does not seem to be the case. Any help is appreciated!
 

dale_coop

Moderator
Staff member
Yeah, it can happen, sure. The 4.1 might fix those small issues.

Which script are you using to shoot? shootWeapon.asm?
You could try to check is the player is dead at the beginning of the script, in order to execute the code only if the player is not dead. Just add those lines at the beginning of the shootWeapon.asm script:
Code:
	LDA player1_object
	CMP #$FF	;; check if player is NOT dead
	BNE continueShootingWeapon		
	RTS
continueShootingWeapon:
	;; the rest of the shooting weapon script from here:

And about shooting and projectile position/direction, don't forget to check that topic:
http://nesmakers.com/viewtopic.php?p=6901#p6901
 

brockj

New member
Thanks Dale, I am actually using the a_create_projectile.asm script, now that you mention it, there is the possibility that shooting during the death sequence is what is causing the issue. Will report back with findings.

And regarding the positioning and direction, that was the original issue I had (not shooting until facing a direction), that seems to be working, and I have been able to adjust the Y value to start, but something during death is causing the number to overflow is my guess.
 

dale_coop

Moderator
Staff member
Ok, if you are using the a_create_projectile.asm script, the code I wrote should work too... give it a try ;)
 

brockj

New member
Gave it a try, at first it seemed to be working better, but I can still cause it to happen very reliably by jumping and getting killed, as a test I gave my player a bunch of health and repeatedly got hurt while shooting and that did not seem to break it, so it does seem like something in the death routine is causing the issue.
 
Top Bottom