From a2c28a27280c186c2717f303ef52a865da6dd94f Mon Sep 17 00:00:00 2001 From: dusoleil Date: Thu, 15 Sep 2022 10:28:24 -0400 Subject: Update movement scripts after Main scene reorganization merge --- Main.tscn | 2 +- Raft.gd | 8 -------- Ship.gd | 8 ++++++++ World.gd | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 Raft.gd create mode 100644 Ship.gd diff --git a/Main.tscn b/Main.tscn index a531b2d..9ba9b60 100644 --- a/Main.tscn +++ b/Main.tscn @@ -6,7 +6,7 @@ [ext_resource path="res://Float.tscn" type="PackedScene" id=4] [ext_resource path="res://ship/ship/crate.tscn" type="PackedScene" id=5] [ext_resource path="res://World.gd" type="Script" id=6] -[ext_resource path="res://Raft.gd" type="Script" id=7] +[ext_resource path="res://Ship.gd" type="Script" id=7] [sub_resource type="BoxShape" id=19] extents = Vector3( 1000, 0.1, 1000 ) diff --git a/Raft.gd b/Raft.gd deleted file mode 100644 index 75f5f63..0000000 --- a/Raft.gd +++ /dev/null @@ -1,8 +0,0 @@ -extends RigidBody - -export var ang_acceleration = 60.0 - -func _integrate_forces(_state): - var stick = Input.get_axis("ship_right","ship_left") - if stick != 0.0: - self.add_torque(Vector3.UP*stick*ang_acceleration) diff --git a/Ship.gd b/Ship.gd new file mode 100644 index 0000000..75f5f63 --- /dev/null +++ b/Ship.gd @@ -0,0 +1,8 @@ +extends RigidBody + +export var ang_acceleration = 60.0 + +func _integrate_forces(_state): + var stick = Input.get_axis("ship_right","ship_left") + if stick != 0.0: + self.add_torque(Vector3.UP*stick*ang_acceleration) diff --git a/World.gd b/World.gd index a612572..6ea8452 100644 --- a/World.gd +++ b/World.gd @@ -53,7 +53,7 @@ func _ready(): generate_location(Vector2(i,j)) func travel(direction:Vector3): - var boat = $"/root/Main/Raft" + var boat = $"/root/Main/ShipRigidBody" var boat_direction = boat.global_transform.basis boat_direction = Basis(Vector3.UP*boat_direction.get_euler().y) direction = -direction -- cgit v1.2.3