how do you make it so that you can only jump once?

Talk about making games.

how do you make it so that you can only jump once?

Postby Kooldudese » Sun Feb 04, 2007 12:26 am

how can you make it so that you can only jump once?
they jump with (yvelocity = -1;) thx
User avatar
Kooldudese
 
Posts: 128
Joined: Sat Jan 27, 2007 5:20 pm
Location: In a house
Score: 0 Give a positive score

Postby Kodo » Sun Feb 04, 2007 12:39 am

User avatar
Kodo
 
Posts: 449
Joined: Thu Oct 20, 2005 8:20 pm
Location: UK
Score: 23 Give a positive score

Postby Sgt. Sparky » Sun Feb 04, 2007 12:41 am

okay,make a var called Jump(integer) and on the collision on the top side of the ground have this
Code: Select all
Jump = 1;

and when the jumping key is pressed have this script
Code: Select all
if (jump == 1)
{
  yvelocity -= 1;
  Jump = 0;
}

and that should do the trick :D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Joshua Worth » Sun Feb 04, 2007 12:42 am

make a variable called jumping
Code: Select all
if (jumping == 0) yvelocity = -1;

then make a draw actor:
Code: Select all
jumping = 1;

then make a collision with repeat turned on:
Code: Select all
jumping = 0;


There are many different ways of doing this. This is just one of them
Stay sweet
User avatar
Joshua Worth
 
Posts: 515
Joined: Tue Jul 19, 2005 12:00 am
Location: Stralia
Score: 5 Give a positive score

Postby Sgt. Sparky » Sun Feb 04, 2007 12:45 am

... I just posted somthing like that...... :? :lol: (I just realised that I poseted somthing after sombody else posted somthing bout' the same thing[only links]) :lol:
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Kodo » Sun Feb 04, 2007 12:53 am

Yup, only links. The code you guys posted is on most of those links. It also goes to show how many times the same question is asked and answered. We might as well add a dedicated forum called 'How to jump' ;)
Inogames: http://www.inogames.com iOS gaming
Firetop Adventure (app store): http://itunes.apple.com/us/app/firetop- ... ?mt=8&ls=1
User avatar
Kodo
 
Posts: 449
Joined: Thu Oct 20, 2005 8:20 pm
Location: UK
Score: 23 Give a positive score

Postby Sgt. Sparky » Sun Feb 04, 2007 1:03 am

yeah :D makslane should have that in the platform game stuff for GE :D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron