Health not being taken away MetroVania [4.5.9] [solved]

Barry2

Member
Hey guys, im starting to be on here way more than I like but, you guys are awesome. I not sure how I messed up my script or code, but I was working on my start screen and the health and ammo hud was showing up. So I found a script that will only show the hud during game state which worked great. As I went to test my game I notice that my health was not being taken away when i was hit from my monster, but my ammo would be. I don't have a pick up for ammo yet so I'm not sure if it would fill up or not. Anyway. i changed my script back to my original settings and the health and ammo showed back up on my start screen as before. I knew that would happen, no big deal, ill try to find away to add to the script or work around it, but when i went to test my game again i notice that my health still isn't going away with I'm hurt. Again my ammo seems too be working. I die after 3 hits like normal and reset to the beginning of the game, but my health will not decrease when I'm hit. So im not sure what I did wrong or if I changed something that i wasn't support to. This is the script that im running now (which i thought was the original script that i copied.

;;; Here is an example of how to do a sprite hud.
;;; Arg5, the one that has the value of myVar, must correspond to a user variable you have in your game.
;;; Don't forget, you can only draw 8 sprites per scanline, so a sprite hud can only be 8 sprites wide max.



;DrawSpriteHud #$08, #$08, #$11, #$10, #$10, myVar, #$00
; arg0 = starting position in pixels, x
; arg1 = starting position in pixels, y
; arg2 = sprite to draw, CONTAINER
; arg3 = MAX
; arg4 = sprite to draw, FILLED
; arg5 = variable.
; arg6 = attribute

DrawSpriteHud #16, #16, #$78, #$03, #$76, myLives, #%00000001 ;;;; this draws lives

DrawSpriteHud #16, #24, #$79, #$05, #$77, myAmmo, #%00000000 ;; this draws ammo


Any Ideas what i have done wrong???
 
Last edited:

Barry2

Member
So after doing some digging I was able to fix my issue. I had to change myLives, to myHeath in the script and that did the trick.
 
Top Bottom