gravity

Non-platform specific questions.

gravity

Postby hobgoblin » Thu Mar 11, 2004 9:41 pm

i need 2 things

how do i make the ground and how do i make the character jump :shock:
__________

i'm noob =P
__________
hobgoblin
 
Posts: 97
Joined: Sat Feb 21, 2004 5:10 pm
Location: BEHIND YOU!!!
Score: 0 Give a positive score

Postby makslane » Fri Mar 12, 2004 1:49 am

makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby hobgoblin » Fri Mar 12, 2004 1:58 am

but how i jump?
__________

i'm noob =P
__________
hobgoblin
 
Posts: 97
Joined: Sat Feb 21, 2004 5:10 pm
Location: BEHIND YOU!!!
Score: 0 Give a positive score

Try this

Postby ingsan » Fri Mar 12, 2004 11:00 am

First on ur mainActor :

add EVent Draw Actor
add Action Script Editor and write :

Code: Select all
yvelocity=5;

// gravity

add Event Collision (with Ground) with repeat enabled
add Action Script Editor and write :

Code: Select all
yvelocity=0;

// So that actor would be Stopped on collision with Ground


Finally add Event KeyDown(up) with repeat disabled
add Action Script Editor and write :

Code: Select all
if(yvelocity==0)
{
  y=y-30;
}


// jump

That's all :)
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Re: Try this

Postby hobgoblin » Fri Mar 12, 2004 12:28 pm

[quote="ingsan"]First on ur mainActor :

add EVent Draw Actor
add Action Script Editor and write :

Code: Select all
yvelocity=5;

// gravity

add Event Collision (with Ground) with repeat enabled
add Action Script Editor and write :

Code: Select all
yvelocity=0;

// So that actor would be Stopped on collision with Ground

[quote]

i did it, but the actor doesn't stop
he just keep flying out of the screem
__________

i'm noob =P
__________
hobgoblin
 
Posts: 97
Joined: Sat Feb 21, 2004 5:10 pm
Location: BEHIND YOU!!!
Score: 0 Give a positive score

Postby hobgoblin » Fri Mar 12, 2004 12:48 pm

YEAH!

now ir works...

i was forgeting to put to repeat...
__________

i'm noob =P
__________
hobgoblin
 
Posts: 97
Joined: Sat Feb 21, 2004 5:10 pm
Location: BEHIND YOU!!!
Score: 0 Give a positive score

Postby ingsan » Fri Mar 12, 2004 2:51 pm

:P
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby Masterburner » Mon Sep 04, 2006 7:32 pm

Thank you !!
i have a little problem
When i press the Jump button my Player dont "Jump" he "warp" to Y=30
and must i set the Values for the Walls
example:
Bottom=0
Top= 100
Right=100
Left=0

or i made something wrong ?
Masterburner
 
Posts: 5
Joined: Mon Sep 04, 2006 4:17 pm
Score: 0 Give a positive score

Postby makslane » Mon Sep 04, 2006 10:02 pm

Make the actor jump with:


Code: Select all
yvelocity = -10; //Or some other value
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest