maker151 wrote:What type of actor do i need to create for the frame counter and can i store this number even if the game finishes even?
A text actor is a normal actor, with a font and text attached to it. To make a text actor, create a normal actor, then in the actor control panel click text. Type some default text into the large window (you have to do this), and then click the font area to set what font you want to use. If you do that, then you can now use the actor as a text actor (so adding that code will work).
Now, to store that number after the game closes, you'll need to save the variable. You can use file io, or gE's saveVars/loadVars. One thing though is that you'll either need to save the new frame value every frame, or know when the game closes. If you can know when the game closes, I'd suggest using that (since you only have to save it once at the end). To use saveVars, you'll need to create a variable which in this case I'll just call it save_frame (also when creating it, under save group, put save_group). Wherever you put the ExitGame code, add this event (I'm just using the keydown escape as an example).
view -> Key Down Esc -> Script Editor
- Code: Select all
save_frame=frame;
saveVars("save_file", "save_group");
ExitGame();
That will save the frame value into the file, save_file. You can use the reverse to load it.
maker151 wrote:Also did that code for jump and double jump include the velocity and direction and will the animations repeat or should i put in a fall animation of 1 frame???
I'm pretty sure you know/can figure out the answer to that question. One thing though is that the text inside the /* */ symbols are what we called commented out. gE will ignore anything within those characters. So I put the yvelocity code in there, to show that you do need to have the code for yvelocity and other things you would need for jump (like ChangeAnimation). But, I left them for you to put in, since you know how high you want the actor to jump, and the animations you wanted it to change to. Now, you can make the fall animation one frame if you want, or you could set it to an animation and create an animation finish event, that stops the fall animation at the last frame. That way the animation won't repeat.