triple jump?

Non-platform specific questions.

triple jump?

Postby BlarghNRawr » Sat Jun 28, 2008 4:01 am

how can i make my character only jump 3 times (and only 2 times in the air) Then have jump disabled? :?:
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: triple jump?

Postby asmodeus » Sat Jun 28, 2008 2:29 pm

Do it with a variable:
Code: Select all
// create actor event
int can_jump = 3;   // 3 for three jumps in the air

Code: Select all
// pressing the jump button
if(can_jump!=0)
{
    yvelocity = -10;   // let the Actor jump
    can_jump -= 1;
}

and when the Actor collides the ground, set can_jump to 3 again.
User avatar
asmodeus
 
Posts: 483
Joined: Thu Oct 11, 2007 5:04 pm
Location: Germany
Score: 43 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron