diff options
| -rw-r--r-- | Player.gd (renamed from KinematicBody2D.gd) | 1 | ||||
| -rw-r--r-- | Player.tscn | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/KinematicBody2D.gd b/Player.gd index 22f7db1..9b5bbd6 100644 --- a/KinematicBody2D.gd +++ b/Player.gd @@ -29,6 +29,7 @@ func _physics_process(delta): position += velocity * delta position.x = clamp(position.x, 0, screen_size.x) position.y = clamp(position.y, 0, screen_size.y) + rotation = global_position.angle_to_point(get_global_mouse_position()) + PI + PI / 8 # extra /8 to offset TeX's snout if Input.is_action_just_pressed("click"): var obj = spawn_object.instance() obj.position = get_position() diff --git a/Player.tscn b/Player.tscn index 4dcae32..8491e22 100644 --- a/Player.tscn +++ b/Player.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://KinematicBody2D.gd" type="Script" id=1] +[ext_resource path="res://Player.gd" type="Script" id=1] [ext_resource path="res://assets/htm_tex.png" type="Texture" id=2] [node name="Area2D" type="Area2D"] |
