Flash q
- Started
- Last post
- 11 Responses
- ian
Building a game in flash MX. I have a character which jumps and moves a set amount when you press the left or right button.
How do I get a smooth motion when it moves? Any speed or velocity tutorials Ive read only cover perpetual motion, so how do I tell it to slide 20 pixels then stop?
Any help much appreciated!
- ozhanlion0
well the trick is to get the distance on everyframe (or some interval)
let'ssay like you want to move to from a to b and give it a name of dist
(dist - dist/2) will do the job. of course this is the simplest in terms, and you will realize that u cannot get the exact distance it won't be everzero, so you should put an asistance function to say that if it'is between 1 and 0 make it 0.hth
- MR_T0
Doa google search for robert penners easing equations...they are fantastic
- ozhanlion0
still preparing the old cattle ya mr_T ?
:)
- MR_T0
Don;t understand that....but I would like to!
- ozhanlion0
ya it was supposed to be kettle :)
not cattle hehe.human mind, you never know
http://www.newstoday.com/pv-an/v…
- MR_T0
I consider keyboards my rivals too....they always try to thwart me...the cunts
- ozhanlion0
take it easy man, it is just a game. try to get on with it.
- ian0
Sweet, Ill have a go of the dis thingy.
Stewart, that site is sweet, I will poke around to my little hearts content!
Cheers for the help.
- stewart0
don't forget to show us the results!
- ian0
Ah, I will! I didnt show that graph thingy I was last week doing cos it looked pants.
That link you posted was cool! I only looked at the _x tween then I started playing with all the rest of em. Fairly powerful script for somethign so small.