Simple trick to hide player (metroVania) 4.5.9

baardbi

Well-known member
In the metroVania module there is a screen flag to hide the HUD. Since there is no background based HUD in the metroVania module, this flag is basically useless. Here's a trick to use that screen flag to hide the player sprite, which can be useful in for example cutscenes. This trick only hides the player. It doesn't deactivate it.

1. Towards the beginning of the doDrawSprites file, look for these two lines:

LDA Object_type,x
STA tempD

Put this right below those two lines:

BNE +notPlayer
LDA ScreenFlags00
AND #%01000000 ;Hide player
BEQ dontHidePlayer
JMP doneDrawingThisSprite
dontHidePlayer:
+notPlayer

Save the file. That's basically it. But I recommend you rename the screen flag to avoid any confusion.

2. Go to Project Settings - Project Labels - Screen Flags. Rename the second one from the top (it says Hide HUD by default).
hidePlayer.PNG

That's it.
 
Last edited:

dale_coop

Moderator
Staff member
I would have used another (unused) screenFlag. Because "Hide HUD" can be very useful... even in the MetroidVania. I know it's not working by default, but it's so easy to fix (3 lines to add in the handle sprite hud, there is at least one topic for that on the forum).

Also your code won't work if the object used as the player is not the 1st object of the game object list (the one labeled 'Player").

An alternative code would be:
Code:
CPX player1_object  ;; is it the player 1 object?
BNE +notPlayer  ;; not the player
  LDA ScreenFlags00
  AND #%01000000 ;Hide player
  BEQ +dontHidePlayer
    RTS
  +dontHidePlayer:
+notPlayer
That one would work with any game object used as the player (if the game has a switch between characters feature for example).

Or a alternative code that would hide any player object (flagged as "Player" in the object details):
Code:
LDA Object_flags,x
AND #%00000010  ;; any "player" type object
BEQ +notAPlayer  ;; not a player
  LDA ScreenFlags00
  AND #%01000000 ;Hide player
  BEQ +dontHidePlayer
    RTS
  +dontHidePlayer:
+notAPlayer
 

gabeswarr

Member
How can I turn the traditioanl HUD back on in the Metrovania MOD? I'd like to use it for some non-scrolling screens and TURN off the sprite HUD on the same screens.
 

baardbi

Well-known member
Using the traditional HUD in the metrovania module is a little tricky. Since the module is based on the sprite HUD, you will have to do some modifications to get that to work.
 

gabeswarr

Member
What would I need to do? I did try but I was crashing because both HUDs were sharing the same elements.

I thought the traditional HUD was complete disabled in Metrovania? I could not get it to display anything.
 
Ooooh this is a gem! I now have an extra action spot for my player because I don't need to use the Hide player tile anymore! thanks team!
 
Top Bottom