GameMaker How would I collect an in-game Map item, and press a key to view the map?

chovo

Member
I really thought this would be as simple as creating an instance of a sprite or an object during key press once conditions were met (has map item), but it is turning out to be more frustrating than I had originally thought.

Basically, all I have is a variable in the create event set to false called "hasMap". Then there is a collision event with the player to collect the map item, in this event hasMap is set to true and the map item disappears. Next, I have the key press event, when the key is pressed and if hasMap is true, then create an instance of a sprite for the map in the asset layer. However, this does nothing.

I would greatly appreciate any advice or a reference to a tutorial.
 
then create an instance of a sprite for the map in the asset layer
Why this? Why not just draw the map? Beyond that, the steps you are describing are the steps you'd want to take for what you want (i.e. pick up a map and then have the ability to look at the map). Have you done any debugging? Are you sure the map is being created in the right place? We'll have to see the code in order to know if you're making a mistake somewhere.
 

TheouAegis

Member
Does the layer exist in the room? Are the coordinates of the map sprite within the current view? Is the layer at a lower depth than anything else? Is the layer visible?
 
Top