LucasSchachtMusic
Member
[Game Maker 8]
Hey guys!
I'm making a platformer-adventure thingy game and I have a room with a lot of coins. Now If I would like the player to be able to collect them only once, what would be the best way to do this? They respawn everytime I come back into this room.
Thing is: first I tried to create a variable, that checks, whether the coin was collected before or not. But i actually didn't know how to initialise it because it's no global variable.
My create event looked like this:
variableabc = 0;
And that was the problem (i know, it's kinda stupid). Everytime I enter the room it's telling the coin: nope, you haven't been picked already.
I also tried to initialise the variable in my 'start game' button event with:
with(obj_coin) {variableabc =0;}
Didn't work either, as you might already know while you read this. I'm still learning and I would like to know how to solve this one.
Thanks for any help!
#YOCO (you only collect once) ;-)
Hey guys!
I'm making a platformer-adventure thingy game and I have a room with a lot of coins. Now If I would like the player to be able to collect them only once, what would be the best way to do this? They respawn everytime I come back into this room.
Thing is: first I tried to create a variable, that checks, whether the coin was collected before or not. But i actually didn't know how to initialise it because it's no global variable.
My create event looked like this:
variableabc = 0;
And that was the problem (i know, it's kinda stupid). Everytime I enter the room it's telling the coin: nope, you haven't been picked already.
I also tried to initialise the variable in my 'start game' button event with:
with(obj_coin) {variableabc =0;}
Didn't work either, as you might already know while you read this. I'm still learning and I would like to know how to solve this one.
Thanks for any help!
#YOCO (you only collect once) ;-)