Page 2 of 2

Re: Menus

PostPosted: Fri Feb 11, 2011 5:00 pm
by Turon
Look and see if I did it right, the enter of play game needs some work. :roll:

Re: Menus

PostPosted: Mon Feb 14, 2011 12:56 pm
by Turon
Anyone Interested? :(

Re: Menus

PostPosted: Sun Feb 20, 2011 11:21 am
by lcl
Seems like you need some help with that menu thing...
Here is menu for you. :)
The demo contains also perfect anti-moonwalk for you! :D

I hope that helps! And if you need help understanding it, ask me!


EDIT:
One thing I have to explain now.
these kinds of codes:
Code: Select all
switch(variable)
{
    case 0:
        //something happens here
    break;

    case 1:
        //something happens here, too!
    break;
}

They work in a way like this:
1. They check the value of varible inside the brackets.
2. You can define what happens according to the value of that variable, and it's that
case x:
//here can be anything
break;
-thing.

case is the number of value and then comes what you want to do, like
switch(dir)
{
case 1:
player.x += 5;
break;
}
That code would move player 5 pixels to right when dir is equal to 1.

break is very important, it stops the event from repeating to other cases.

Sorry if I was unclear.
I hope this still cleared something to you. :)

Re: Menus

PostPosted: Tue Feb 22, 2011 6:52 am
by Turon
I saw it i will study it more intently when I have the time.

-Edit- 18/5/2015
Thank you Lcl :) ! You know the menu I used in Octopus game is actually based off this one.