blob: 31642aecad88ca01e91d32c33aafca422e81690e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
extends RigidBody2D
var angular_speed = PI
var start_position
# Called when the node enters the scene tree for the first time.
func _ready():
start_position = position
apply_central_impulse(Vector2(500, -800))
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
rotation += angular_speed * delta
func _input(event):
if event.is_action_pressed("shoot"):
position = start_position
rotation = 0
apply_central_impulse(Vector2(500, -800))
|