Wednesday, February 8, 2012

Starting to get into Game Maker

Just figuring out how to build scripts in Game Maker.

So far it's pretty simple. Almost over simplified. However, it's got a lot of clever things.
The timeline editor seems like a pretty simple way to control flow of action.
Add in a step0 and call some script.
Then add in Step at position 1, and then make it sleep "Zzz" for 1000 ms, or a second.
then add in a step at 2, resume timeline.

Set the timeline to loop and you have a script that executes once a second on the object the script is applied to.
I have an object which on create sets it's timeline and then starts it.

then my script looks like this:

globalvar someVar;
{
 cfTime = 1.0;
 cfTime += someVar;
 show_debug_message(cfTime);
 someVar += 1.0;
}

with this script applied to the timeline to execute, the messages increment +1 every second. pretty simple.
in the messages window when running in debug i get a nice counter. I'll be using this for a lot of things, Just getting all of my globalvar's to be easily remembered is going to be a big part of the organization of this project.

No comments:

Post a Comment

rxokita's shared items