I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: ethinthenougathorn on December 01, 2013, 02:14:53 PM

Title: HELP
Post by: ethinthenougathorn on December 01, 2013, 02:14:53 PM
I am working on a very cruel "game" experiment, but i need coding help....if  i get the help, i will not publish my experiment :D

So far, you can save EVERYWHERE by pressing S, no matter if there are saves or not. But how can i make that save doesnt crash when you pressed save accidently after player touched spike?  starting all over again just because pressing S a little too late is not what i want...
Title: Re: HELP
Post by: Sephalos on December 01, 2013, 02:40:47 PM
You could do place_meeting+speed to check for spikes before allowing a succesful save.

If !place_meeting(x+hspeed,y+vspeed,playerKiller) and keyboard_check_direct(ord('S')) { saveGame(); }

You should probably add a key to allow the player to restart at the start of the room.
Title: Re: HELP
Post by: dYnAm1c on December 01, 2013, 03:21:16 PM
Or a button to place the player to the next normal block, but that would probably need some restrictions so it cant be abused.
For example it will always place you on a block in the direction of the spawn so you cant skip anything.
Title: Re: HELP
Post by: Starz0r on December 01, 2013, 04:15:36 PM
:FailFish:

Just put the Event of Pressing the S key in the player, if he doesn't exists (which he doesn't if you touch a spike), then it won't save.
Title: Re: HELP
Post by: Sephalos on December 02, 2013, 07:08:46 AM
:FailFish:

Just put the Event of Pressing the S key in the player, if he doesn't exists (which he doesn't if you touch a spike), then it won't save.
Well I'm pretty sure the 'S' key is a event in the player object.
If not, well yeah that would be a problem.
Title: Re: HELP
Post by: ethinthenougathorn on December 02, 2013, 10:14:08 AM
WOW, what a simple way...i havent thought about that.... :(

but thank you all for your help :D