Metroidvania Chests
Started by WyldEyeStudios, Feb 09 2012 10:24 PM
8 replies to this topic
#1
Posted 09 February 2012 - 10:24 PM
Hello, I'm making a Metroidvania game. I already have have the moving from room to room down, but I don't know how to go about making chests. I've already looked around but I couldn't understand the codes, and I use GM8.1 Registered.
Thanks.
Thanks.
#2
Posted 09 February 2012 - 11:23 PM
What do you want the chests to do, exactly? I presume they will be objects that give you something.
#3
Posted 09 February 2012 - 11:24 PM
I want them to open and throw out an object i can assign, then the player can go pick it up.
#4
Posted 09 February 2012 - 11:34 PM
then i would suggest something like putting this in the collision event of the chest with the player:
if (keyboard_check(vk_space)) and (opened = 0) //replace vk_space with button pressed to open chest (ord('E') for letter e, for example)
{
opened = 1;
instance_create(x,y,item);
}
set opened to 0 in the chest create event. Set item to the object name of the item by right clicking on the chest in the room editor and in the dropdown menu select 'creation code...' and setting it in there.
Edited by koo294, 09 February 2012 - 11:35 PM.
#5
Posted 09 February 2012 - 11:41 PM
But the thing is... Will it stay from room to room?
#6
Posted 09 February 2012 - 11:46 PM
Set the room to be persistent. This makes it so that any instances left in the room are in the same state when that room is returned to.
#7
Posted 09 February 2012 - 11:46 PM
Alright, thanks guys I'll see if it will work.
#8
Posted 10 February 2012 - 12:41 AM
It worked thanks guys.
#9
Posted 10 February 2012 - 12:45 AM
Now how do I change the title name... This being my first cry for help.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











