Hide screen hud 4.5.9 Metrovania

Barry2

Member
This is my first time being able to really contribute code to the forums, I been working on how to hid the HUD on my start screen. This is the code that has worked for me.

In your script settings, under Handle drawing sprite HUD, copy code and it should work for Metrovania

LDA gameState ;; CHECK GAMESTATES ;;
CMP #$00 ;; "Start Screen" game state ;;
BEQ onStartScreen ;; IS START SCREEN ;;
JMP skipAll

onStartScreen:

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

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



skipAll:

;;; 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.


;;;;;;; Check CMP for correct screen. Mine is #$00. Some could be #$01
 

dale_coop

Moderator
Staff member
Another way of doing that, is implementing the "hide hud" screen flag.

2022-03-26 14_19_41-Screen Details.png


Modify the handle sprite hud script, at the beginning of the script, add:
Code:
LDA ScreenFlags00
AND #%01000000        ;; "hide hud" screen flag
BEQ +continueDrawingHud
    JMP +skipDrawingHud
+continueDrawingHud:


And at the end of the script, add:
Code:
+skipDrawingHud:
 
Top Bottom