-
gravity
I need to know how to make gravity in flash, Like a 2d mario game type where if there is nothing to stand on he just falls sorta thing. If you know of a good physics tutorial please tell
-
there is this it does create a bounce when the MC 'lands' but I'm sure you could change that...
-
change the line velocity *= -0.9 to velocity *= -0.1
this will create a very small bounce like in mario games
-
that does not seem to work out very good, the ball I'm using is suppose to fall off the end of the floor when it moves off of it. It seem to stop in line with the floor even when it is not standing on it.
-
yeah the guy never asked me to include that into the coding
you can add a line in:
code:
onClipEvent(load){
velocity = 0
gravity = 2
friction = 0.01
}
onClipEvent(enterFrame){
velocity += gravity
velocity -= friction*velocity
_y += velocity
if(_y>_root.floor._y && _x<_root.floor._x+_root.floor._width/2 && _x>_root.floor._x-_root.floor._width/2){
_y = _root.floor._y
velocity *= -0.1
}
}
-
Originally posted by a_slosh
yeah the guy never asked me to include that into the coding
you can add a line in:
code:
onClipEvent(load){
velocity = 0
gravity = 2
friction = 0.01
}
onClipEvent(enterFrame){
velocity += gravity
velocity -= friction*velocity
_y += velocity
if(_y>_root.floor._y && _x<_root.floor._x+_root.floor._width/2 && _x>_root.floor._x-_root.floor._width/2){
_y = _root.floor._y
velocity *= -0.1
}
}
THANKYOU!!!!!! it works!!!!
-
np anytime
-
x2i
Hi im the dude that a_slosh helped to create that garvity with the bounce effect, i realised that the ball did bounce on the same level as the platform and i figured it out myself (thats why i didnt ask for help) i did it with a hitTest. Anyway hope it helped, a_slosh sorted the code out for me which was a big help and i am creating a game because of it.
-
ninja keep us posted with the game, i'd like to see it when it's done
-
x2i
Its a game called Knuckles Choatix Advance, its basically a flash version of the knuckles chaotix game for the mega drive. Using Sonic Advance style sprites, i havent got the file on me at this point but i shall post a preview as soon as i get it.
You can jump using the gravity effect you made and you can climb (for some reason he slowly slides back down though nothing too big), there is a boss that you can jump on and bounce off as well.
There are also a couple of hidden moves as well.
You shall see when i post it but it will probably be next weekend because i am stopping away at my dads house and it isnt on me. SOZ
Dan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|