View Full Version : Wheelie with a bike
custo
September 18th, 2007, 05:35 PM
I had the idea to make a game doing the wheelie with a bike. I know how to do the movement of the bike, spinning wheels ... but then I don't know how to make it realistic to stay doing the wheelie as long as you're clicking two buttons..
any idea on this..
thanks, I really appreciate it.. :thumb2:
omnislant
September 21st, 2007, 11:26 AM
I had the idea to make a game doing the wheelie with a bike. I know how to do the movement of the bike, spinning wheels ... but then I don't know how to make it realistic to stay doing the wheelie as long as you're clicking two buttons..
any idea on this..
thanks, I really appreciate it.. :thumb2:
not exactly sure if i understand what you're talking about... but i'll take a stab at it...
basically, you'll need four animations...
guy riding the bike (which we'll call riding)
guy pulling up going into the wheelie (up)
guy doing the wheelie (wheelie)
and guy going back down from the wheelie (down)
now, you cant interrupt the animation halfway through it's cycle and jump to going up in the wheelie as soon as the buttons are pressed, because that would be choppy... so we have to set it up like this:
put all four animations back to back in one movieclip...
at the end of the 'riding' animation put this code:
if (buttons not pressed) {
gotoAndPlay(1);
}
which will automatically start the loop over unless the buttons for the wheelie are pressed... if they are pressed, it will play through the up motion of the animation to the wheelie part of the animation, at the end of which put the following code:
if (buttons pressed) {
gotoAndPlay( 'frame number of beginning of wheelie animation' )
}
which will automatically assume the wheelie is over and go to the down portion of the animation unless the buttons are pressed, which will continue the wheelie portion of the animation
custo
September 21st, 2007, 04:52 PM
mm... well thanks for your reply but I'm looking for something much more advanced than a gotoAndPlay... something with rotation, gravity...
any thoughts on this?
thanks again
zach93111
September 22nd, 2007, 10:06 AM
mm... well thanks for your reply but I'm looking for something much more advanced than a gotoAndPlay... something with rotation, gravity...
any thoughts on this?
thanks again
Make the registration point near the Rear wheel
OnClipEvent(load){
axis=0
up=1
down=0
gravity=1.8
}
onClipEvent(enterFrame){
if (Key.isDown(Key.UP)){
axis+=up
} else {
axis -= gravity
}
if (axis<=0){
axis=0
}
this._rotation+=axis
}
happy now?
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.