;

PDA

Click to See Complete Forum and Search --> : Please help me with action script of bouncing.


XareoX
08-12-2006, 03:51 AM
hey i need help with a action script that allows a ball to bounce infianly on a bottom mc altomatically with gavity and it needs to be a diffrend kinda action script i used for my alto bouncing platform game i posted a few days ago so like the ball bounces 1little bounce then 1 big 1 like that this is very hard 2 do iv tryed 2 find a acript diffrent to the 1 i already have all day because the same script wont work 2 times in 1 movie thats why i need a diffrent kinda script as well. have a look at my platform game to see the kind of script i already have.

necromanthus
08-12-2006, 04:07 AM
http://necromanthus.com/KoolMoves/Bouncing.html

XareoX
08-12-2006, 04:20 AM
I already know how to do that look at my platform game posted on this site to see what im on about it must be a ball bouncing at the same hight for a infine time(for ever) just like the 1 in my platform game but i need a diffrent action script for it with hittest.ground.

necromanthus
08-12-2006, 05:21 AM
I already know how to do that look at my platform game posted on this site to see what im on about it must be a ball bouncing at the same hight for a infine time(for ever) just like the 1 in my platform game but i need a diffrent action script for it with hittest.ground.

All you have to do is to modify that actionscript according to your needs ...
Anyway, just set this script for that ball:

onClipEvent (load){
gravity = 10;
tim = getTimer();
tim = tim / 100;
dow = _parent.box._y + _parent.box._height - (this._height/2);
bounce = 1;
speedystart = 25;
maxspeed = 90;
}

onClipEvent (enterFrame){
timenow = getTimer();
timenow = timenow / 100;
speedy = gravity * (timenow - tim) + speedystart;
this._x = this._x + speedx / 5;
this._y = this._y + speedy / 5;
if (this._y > dow){
this._y = dow;
speedy = speedy * -bounce;
tim = getTimer();
tim = tim / 100;
speedystart = -maxspeed;
}
}

XareoX
08-12-2006, 05:29 AM
in another way what is the script u made to make dizzy jump because i forgot the action script i found another 1 the jumping is fine but when i roll of the ground mc i dont fall of the stage. And that script above dident work with my other script.

XareoX
08-12-2006, 05:31 AM
see here is the script i used to make an object jump but add it to a mc named char then add a ground mc and u will see it jumps fine but it doesnt drop of stage if you roll of ground here is the script

necromanthus
08-12-2006, 05:46 AM
in another way what is the script u made to make dizzy jump because i forgot the action script i found another 1 the jumping is fine but when i roll of the ground mc i dont fall of the stage. And that script above dident work with my other script.

As I said many-many-many times before, flash environment, because of its poor global performances, is not suitable for sophisticated projects ("real games" for example).
In other words, you have to optimize each piece of AS to get a decent frame rate. And even so is not enough ...
The upcoming AS3 seems to be 5-10 times faster, but we have to wait a little bit.

Now coming back to your "bouncing ball", you should use that script because is the best approach.
Just change (tune up) the "dow condition" (the hitTest emulation).
That's your floor Y position.
I think it's simple enough ...

cheers

XareoX
08-12-2006, 05:51 AM
ok

XareoX
08-12-2006, 05:14 PM
I found another way but thanks u still helped me a little bit any way cheers

XareoX
08-12-2006, 06:45 PM
Hahaha iv done it i made it so he can jump when up arrow is pressed and he can fall
if he goes of platform i just edited a lot of the code i used from another game.