make key down and key up events on the view actor for the spacebar - both script editor actions.
make a global variable called "ballForce"
on the key down event, write code like
- Code: Select all
ballForce = 10; // initial force of the ball
CreateTimer("view", "spacetimer", 100); // i guessed this line of code so look up the correct syntax in the script reference, or even easier use the "functions" button at the bottom of the script window to make the createtimer code for you.
on the key up event write code like
- Code: Select all
DestroyTimer("spacetimer");
ball.angle = 90; // angle you want the ball to shoot at
ball.directional_velocity = ballForce; // set the ball moving
finally, now you've created a timer you can make a "timer" event on the view actor, and pick a script editor action:
- Code: Select all
ballForce += 1; // amount to increase the balls force each nth of a second the spacebar is held
i think that should do it! the timer you create should be on the view actor, a periodic timer that repeats every 100ms or so, and infinite.