I'm designing a projectile attacks for my speccy platformer.
Currently I'm using a rigid body for a rock, which gets instanced at player location each time 'shoot' is pressed.
var stone_speed = 200
if get_node("../Player").movingright == true:
apply_impulse(Vector2(), Vector2(stone_speed, 70))
apply_impulse(Vector2(), Vector2(-stone_speed, -70))
What I need is to hold 'shoot' for 2 seconds max to increase the speed of throw, to make it fall closer of fly farther.
I'm kind of at a loss how to do that (still being a beginner in gdscript).
Also, right now if movingright == true, the stone is instanced just falling onto the ground. But if it is false, the stone is flying to the left, not sitting still. Why can that be?