Curve line with a ball
michelericcio
Member Posts: 45
Hi I have a problem, I wanted to make a ball from a bottom right corner (and random on the Y axis) to be launched every shot will vary by strength, speed and height ... how do I achieve this?
can the ball accomplish a curve line?
can the ball accomplish a curve line?
Comments
Moving the target and updating the balls trajectory will induce a curved path.
create an actor called Target. This is spawned at the same time as your shots but over on the other side of the screen. Give it an initial Move behaviour.
In Target Constrain Game.Target.X to Self.Position.X and do the same for Target.Position.Y
In your shot actor Accelerate Toward or Move To Game.Target.X and Game.Target.Y.
The shot actor moves towards the Target actor and changes flight path as Target also changes position.
this is a example for all!
http://gamesalad.com/game/play/52472
Now, i have another question, can i "randomize"(velocity, path ecc) more balls for X time?
how I can make?
sorry for my bad english :S
thanks!
A box comes up with two drop down menus.
In the second drop down box, you'll find various functions.
One of these is rand(1,2)
replace the 1 with the lowest value. Replace the 2 with the highest value. This gives you the range of numbers that random will select a value from.
And that's pretty much it. One of the simplest and widely used functions.
Hope that helps!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io