my way is to use the Direction Calculator object and always have the ball rotate to direction 24. and when ball collides with background, set speed to current speed / 2.
and when ball faces in up directions subtract 1 from speed, when ball is going down add 1 to speed
but there are a million on one ways, this is the most simplistic i can think of
That sounds harder than Dustin's way to me, to be honest!
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G
get the right formula and its brilliant for gravity. ie dont use Always, just use every X seconds, and some more advanced stuff like using values to control speed for reliability.
i tried your way Dustin G., yet it is not working the way i want. You see when the ball goes up, i want it to go down as well, just like if i threw a ball in the air.
I didnt think it was different for every computer.
slower computers will count the in game timer just as quick but may move the character or scroll slower so timer based jumps using every x seconds may not jump high enough.
and not jump the same height each time
if it was set to every 0.10th of a second then the jump could start at the end of the 0.10 or at the start of the 0.10 resulting in a different height.
OK here's a reasonably easy way I used to use way back. Set the ball to a platform movement and set Speed, Acc, Dec to 0 and set it to No Jump. Then set the gravity you want. Then in the event editor...
Use the balls alterable value A as the trigger for jumping/falling, and Alt B as the strength of jump.
Event 1
Ball Alt Value A = 1
+Ball Alt Value B > 0
THEN
Ball - Movement - Stop
Ball - Position - Y Coordinate - Y( "Ball" ) - Value B( "Ball" )
Ball - Values - Subtract 1 from B
Event 2
Ball Collides with Backdrop
THEN
Ball - Movement - Stop
Ball - Values - Set A to 0
The platform movement will sort out the gravity for itself. It's a very simple way, to make it jump/bounce simply set Alt A to 1, and set Alt B to a variable depending on how high you want it to go.
Show me the power child,
I'd like to say,
That I'm down on my knees today,
Gives me the butterflies,
Gives me away,
'Til I'm up on my feet again,
I'm feeling outshined.
Wow, you people have turned this into some sortof a debate. Poor Ghandi, caught in between fire, attempting to decifer the right path...
Games currently in "the works":
Moonrise
My Fantasy (dieing dream)
Shadowed Sunset (this one will be cool)
Dragon Riders (Newer, better animated, cooler, and less gradient version!)
....................
www.phil-con.com baby!
Depends on which way this ball is suppose to react.
If it is simply shot by another object, which means it won't be able to bounce or anything, these are the only events you'll need.
- Always
Set Y of Ball to Y("Ball") + Alterable Value A("Ball")
- Every 0"00'05 (this delay can be changed to make ball fall at faster or slow rate)
+ Alterable Value A of Ball < 20(this value determines terminal velocity of ball)
Add 1 to Alterable Value A of Ball
That's simple enough for a non-reactive projectile. As for something that bounces you may want to add some other events for collisions. I recommend something along the lines of...
- Ball collides with obstacle
Set Alterable Value A to -1
Bounce Ball
Set Speed of Ball to Speed("Ball") / 2
You may want to change the value the ball is decreased by, but this event essentially makes the ball bounce, lose half its speed, and changes the Alterable Value A (which is the vertical velocity causing it to fall) to a negative value thus making it go upwards for just a bit.
Of course these values may need a bit of tweaking depending on your desired effect, and you may find that sometimes there are a few odd bounces that occur. But I recommend you give that a try.
MUGGUS
Come and annoy me more at
www.muggus69.tk STOUT ANGER!!!