Quick run down of what to look at to get this to work.
Do this in the balls events and make an actor variable called speed
in create actor use
- Code: Select all
xvelocity = speed; //speed being an actor variable that holds the speed
In the collision between the ball and the bullet
- Code: Select all
xvelocity = 0; //stops the balls movement
createtimer(); //create a new timer (Note you will have to fill the details in for this ti have the correct time and don't loop it)
when the timer ends you want to change the speed value to whatever you want the new speed to be then multiply it by -1 to reverse direction
- Code: Select all
speed = speed * -1; //reverse the direction
xvelocity = speed;
On collision with any of the 2 objects do the same
- Code: Select all
speed = speed *-1;
xvelocity = speed;
On out of vision destroy the actor