Skip to content

Commit

Permalink
Trileset Loading + Camera Changes
Browse files Browse the repository at this point in the history
Trilesets seem to be loading correctly in the Palette now! I also modified the camera, turning it from a perspective to an orthogonal one to make it easier to visualize how things will look in-game. I'll add back the perspective cam once I get level editing done.
  • Loading branch information
edinosma committed Jan 9, 2024
1 parent bab764a commit 207a7a2
Show file tree
Hide file tree
Showing 12 changed files with 235 additions and 104 deletions.
10 changes: 9 additions & 1 deletion Objects/Box.tscn
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
[gd_scene load_steps=3 format=3 uid="uid://da143myvimsgb"]
[gd_scene load_steps=4 format=3 uid="uid://da143myvimsgb"]

[ext_resource type="PackedScene" uid="uid://c5o8xkjxrw28u" path="res://Objects/Box.glb" id="1_yvw6e"]
[ext_resource type="Material" uid="uid://cwmx5mt2bhij2" path="res://Materials/UI.tres" id="2_3wn0q"]

[sub_resource type="ConvexPolygonShape3D" id="ConvexPolygonShape3D_chimh"]
points = PackedVector3Array(0.55, 0.55, 0.549993, 0.55, -0.55, 0.549993, 0.55, 0.55, -0.55, -0.55, 0.55, 0.549993, 0.55, -0.55, -0.55, -0.55, -0.55, 0.549993, -0.55, 0.55, -0.55, -0.55, -0.55, -0.55)

[node name="Box" instance=ExtResource("1_yvw6e")]

[node name="Box" parent="." index="0"]
layers = 2
surface_material_override/0 = ExtResource("2_3wn0q")

[node name="Area3D" type="Area3D" parent="Box" index="0"]

[node name="CollisionShape3D" type="CollisionShape3D" parent="Box/Area3D" index="0"]
shape = SubResource("ConvexPolygonShape3D_chimh")

[node name="AnimationPlayer" parent="." index="1"]
autoplay = "Outer CubeAction"
speed_scale = 4.0
85 changes: 79 additions & 6 deletions Scenes/Cursor.tscn
Original file line number Diff line number Diff line change
@@ -1,15 +1,88 @@
[gd_scene load_steps=3 format=3 uid="uid://djsig0kkd1ved"]
[gd_scene load_steps=9 format=3 uid="uid://djsig0kkd1ved"]

[ext_resource type="Script" path="res://Scripts/Cursor.gd" id="1_gsw3j"]
[ext_resource type="PackedScene" uid="uid://da143myvimsgb" path="res://Objects/Box.tscn" id="2_raobt"]
[ext_resource type="Material" uid="uid://cwmx5mt2bhij2" path="res://Materials/UI.tres" id="2_0tkj2"]

[sub_resource type="ConvexPolygonShape3D" id="ConvexPolygonShape3D_4lrr7"]
points = PackedVector3Array(0.55, 0.55, 0.549993, 0.55, -0.55, 0.549993, 0.55, 0.55, -0.55, -0.55, 0.55, 0.549993, 0.55, -0.55, -0.55, -0.55, -0.55, 0.549993, -0.55, 0.55, -0.55, -0.55, -0.55, -0.55)

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_i5nyl"]

[sub_resource type="ArrayMesh" id="ArrayMesh_ip15m"]
_surfaces = [{
"aabb": AABB(-0.55, -0.55, -0.55, 1.1, 1.1, 1.10001),
"format": 34896613377,
"index_count": 144,
"index_data": PackedByteArray(2, 0, 18, 0, 19, 0, 2, 0, 0, 0, 18, 0, 19, 0, 6, 0, 2, 0, 4, 0, 18, 0, 0, 0, 4, 0, 22, 0, 18, 0, 23, 0, 6, 0, 19, 0, 4, 0, 23, 0, 22, 0, 6, 0, 23, 0, 4, 0, 12, 0, 14, 0, 13, 0, 12, 0, 15, 0, 14, 0, 13, 0, 4, 0, 12, 0, 6, 0, 14, 0, 15, 0, 6, 0, 7, 0, 14, 0, 5, 0, 4, 0, 13, 0, 6, 0, 5, 0, 7, 0, 4, 0, 5, 0, 6, 0, 12, 0, 21, 0, 15, 0, 12, 0, 20, 0, 21, 0, 17, 0, 15, 0, 21, 0, 8, 0, 20, 0, 12, 0, 8, 0, 16, 0, 20, 0, 17, 0, 10, 0, 15, 0, 8, 0, 17, 0, 16, 0, 10, 0, 17, 0, 8, 0, 1, 0, 2, 0, 3, 0, 1, 0, 0, 0, 2, 0, 9, 0, 0, 0, 1, 0, 10, 0, 3, 0, 2, 0, 10, 0, 11, 0, 3, 0, 9, 0, 8, 0, 0, 0, 10, 0, 9, 0, 11, 0, 8, 0, 9, 0, 10, 0, 28, 0, 8, 0, 12, 0, 0, 0, 24, 0, 4, 0, 0, 0, 25, 0, 24, 0, 29, 0, 8, 0, 28, 0, 0, 0, 29, 0, 25, 0, 8, 0, 29, 0, 0, 0, 4, 0, 28, 0, 12, 0, 4, 0, 24, 0, 28, 0, 31, 0, 15, 0, 10, 0, 6, 0, 27, 0, 2, 0, 6, 0, 26, 0, 27, 0, 30, 0, 15, 0, 31, 0, 6, 0, 30, 0, 26, 0, 15, 0, 30, 0, 6, 0, 27, 0, 10, 0, 2, 0, 27, 0, 31, 0, 10, 0),
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 32,
"vertex_data": PackedByteArray(0, 0, 0, 0, 254, 255, 0, 0, 69, 23, 69, 23, 254, 255, 0, 0, 0, 0, 255, 255, 254, 255, 0, 0, 69, 23, 185, 232, 254, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 69, 23, 69, 23, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 69, 23, 185, 232, 0, 0, 0, 0, 255, 255, 0, 0, 254, 255, 0, 0, 185, 232, 69, 23, 254, 255, 0, 0, 255, 255, 255, 255, 254, 255, 0, 0, 185, 232, 185, 232, 254, 255, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 185, 232, 69, 23, 0, 0, 0, 0, 185, 232, 185, 232, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 69, 23, 184, 232, 0, 0, 255, 255, 185, 232, 184, 232, 0, 0, 0, 0, 69, 23, 184, 232, 0, 0, 0, 0, 185, 232, 184, 232, 0, 0, 255, 255, 69, 23, 69, 23, 0, 0, 255, 255, 185, 232, 69, 23, 0, 0, 0, 0, 69, 23, 69, 23, 0, 0, 0, 0, 185, 232, 69, 23, 0, 0, 69, 23, 0, 0, 69, 23, 0, 0, 69, 23, 0, 0, 184, 232, 0, 0, 69, 23, 255, 255, 69, 23, 0, 0, 69, 23, 255, 255, 184, 232, 0, 0, 185, 232, 0, 0, 69, 23, 0, 0, 185, 232, 0, 0, 184, 232, 0, 0, 185, 232, 255, 255, 69, 23, 0, 0, 185, 232, 255, 255, 184, 232, 0, 0)
}]
blend_shape_mode = 0

[sub_resource type="ArrayMesh" id="ArrayMesh_351w7"]
resource_name = "Box_Cube_001"
_surfaces = [{
"aabb": AABB(-0.55, -0.55, -0.55, 1.1, 1.1, 1.10001),
"attribute_data": PackedByteArray(255, 95, 255, 255, 255, 31, 255, 63, 255, 95, 0, 0, 209, 101, 209, 5, 255, 159, 255, 255, 255, 159, 0, 0, 255, 223, 255, 63, 45, 154, 209, 5, 255, 95, 255, 191, 255, 31, 255, 127, 255, 95, 255, 191, 209, 101, 45, 186, 255, 159, 255, 191, 255, 159, 255, 191, 255, 223, 255, 127, 45, 154, 45, 186, 255, 95, 255, 63, 255, 95, 255, 63, 255, 95, 255, 63, 209, 101, 46, 58, 255, 159, 255, 63, 255, 159, 255, 63, 255, 159, 255, 63, 45, 154, 46, 58, 255, 95, 255, 127, 255, 95, 255, 127, 255, 95, 255, 127, 209, 101, 208, 133, 45, 154, 208, 133, 255, 159, 255, 127, 255, 159, 255, 127, 255, 159, 255, 127, 209, 101, 209, 69, 45, 154, 209, 69, 209, 101, 45, 250, 45, 154, 45, 250, 209, 101, 46, 122, 45, 154, 46, 122, 209, 101, 208, 197, 45, 154, 208, 197, 209, 37, 46, 122, 209, 37, 209, 69, 45, 218, 46, 122, 45, 218, 209, 69, 46, 90, 46, 122, 46, 90, 209, 69, 208, 165, 46, 122, 208, 165, 209, 69),
"format": 34896613399,
"index_count": 144,
"index_data": PackedByteArray(4, 0, 34, 0, 35, 0, 4, 0, 0, 0, 34, 0, 35, 0, 12, 0, 4, 0, 8, 0, 34, 0, 0, 0, 8, 0, 38, 0, 34, 0, 39, 0, 12, 0, 35, 0, 8, 0, 39, 0, 38, 0, 12, 0, 39, 0, 8, 0, 25, 0, 28, 0, 27, 0, 25, 0, 29, 0, 28, 0, 27, 0, 10, 0, 25, 0, 13, 0, 28, 0, 29, 0, 13, 0, 15, 0, 28, 0, 11, 0, 10, 0, 27, 0, 13, 0, 11, 0, 15, 0, 10, 0, 11, 0, 13, 0, 26, 0, 37, 0, 31, 0, 26, 0, 36, 0, 37, 0, 33, 0, 31, 0, 37, 0, 18, 0, 36, 0, 26, 0, 18, 0, 32, 0, 36, 0, 33, 0, 22, 0, 31, 0, 18, 0, 33, 0, 32, 0, 22, 0, 33, 0, 18, 0, 3, 0, 5, 0, 7, 0, 3, 0, 2, 0, 5, 0, 19, 0, 2, 0, 3, 0, 20, 0, 7, 0, 5, 0, 20, 0, 23, 0, 7, 0, 19, 0, 17, 0, 2, 0, 20, 0, 19, 0, 23, 0, 17, 0, 19, 0, 20, 0, 44, 0, 16, 0, 24, 0, 1, 0, 40, 0, 9, 0, 1, 0, 41, 0, 40, 0, 45, 0, 16, 0, 44, 0, 1, 0, 45, 0, 41, 0, 16, 0, 45, 0, 1, 0, 9, 0, 44, 0, 24, 0, 9, 0, 40, 0, 44, 0, 47, 0, 30, 0, 21, 0, 14, 0, 43, 0, 6, 0, 14, 0, 42, 0, 43, 0, 46, 0, 30, 0, 47, 0, 14, 0, 46, 0, 42, 0, 30, 0, 46, 0, 14, 0, 43, 0, 21, 0, 6, 0, 43, 0, 47, 0, 21, 0),
"material": SubResource("StandardMaterial3D_i5nyl"),
"primitive": 3,
"uv_scale": Vector4(0, 0, 0, 0),
"vertex_count": 48,
"vertex_data": PackedByteArray(0, 0, 0, 0, 254, 255, 84, 213, 0, 0, 0, 0, 254, 255, 255, 191, 0, 0, 0, 0, 254, 255, 255, 191, 69, 23, 69, 23, 254, 255, 255, 191, 0, 0, 255, 255, 254, 255, 84, 213, 0, 0, 255, 255, 254, 255, 255, 191, 0, 0, 255, 255, 254, 255, 255, 255, 69, 23, 185, 232, 254, 255, 255, 191, 0, 0, 0, 0, 0, 0, 84, 213, 0, 0, 0, 0, 0, 0, 255, 191, 0, 0, 0, 0, 0, 0, 255, 255, 69, 23, 69, 23, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 84, 213, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 255, 255, 69, 23, 185, 232, 0, 0, 255, 255, 255, 255, 0, 0, 254, 255, 255, 191, 255, 255, 0, 0, 254, 255, 255, 191, 255, 255, 0, 0, 254, 255, 84, 213, 185, 232, 69, 23, 254, 255, 255, 191, 255, 255, 255, 255, 254, 255, 255, 191, 255, 255, 255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 254, 255, 84, 213, 185, 232, 185, 232, 254, 255, 255, 191, 255, 255, 0, 0, 0, 0, 255, 191, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 84, 213, 185, 232, 69, 23, 0, 0, 255, 255, 185, 232, 185, 232, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 84, 213, 255, 255, 69, 23, 184, 232, 84, 213, 255, 255, 185, 232, 184, 232, 84, 213, 0, 0, 69, 23, 184, 232, 84, 213, 0, 0, 185, 232, 184, 232, 84, 213, 255, 255, 69, 23, 69, 23, 84, 213, 255, 255, 185, 232, 69, 23, 84, 213, 0, 0, 69, 23, 69, 23, 84, 213, 0, 0, 185, 232, 69, 23, 84, 213, 69, 23, 0, 0, 69, 23, 255, 191, 69, 23, 0, 0, 184, 232, 255, 191, 69, 23, 255, 255, 69, 23, 255, 255, 69, 23, 255, 255, 184, 232, 255, 255, 185, 232, 0, 0, 69, 23, 255, 191, 185, 232, 0, 0, 184, 232, 255, 191, 185, 232, 255, 255, 69, 23, 255, 255, 185, 232, 255, 255, 184, 232, 255, 255, 84, 213, 84, 213, 0, 0, 255, 127, 255, 255, 255, 255, 255, 255, 255, 255, 84, 213, 84, 213, 255, 255, 255, 255, 255, 127, 255, 191, 255, 255, 255, 255, 84, 213, 84, 213, 0, 0, 255, 127, 255, 191, 255, 191, 255, 191, 255, 191, 84, 213, 84, 213, 255, 191, 255, 191, 255, 127, 255, 191, 255, 191, 255, 191, 0, 0, 255, 127, 255, 255, 255, 255, 170, 42, 170, 42, 255, 255, 255, 255, 255, 255, 255, 255, 255, 127, 255, 191, 170, 42, 170, 42, 255, 255, 255, 255, 0, 0, 255, 127, 255, 191, 255, 191, 170, 42, 170, 42, 255, 191, 255, 191, 255, 191, 255, 191, 255, 191, 255, 191, 255, 127, 255, 191, 170, 42, 170, 42, 170, 42, 170, 42, 170, 42, 170, 42, 84, 213, 84, 213, 84, 213, 84, 213, 170, 42, 170, 42, 170, 42, 170, 42, 84, 213, 84, 213, 84, 213, 84, 213, 0, 0, 255, 127, 0, 0, 255, 127, 255, 127, 255, 191, 255, 127, 255, 191, 0, 0, 255, 127, 0, 0, 255, 127, 255, 127, 255, 191, 255, 127, 255, 191)
}]
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_ip15m")

[sub_resource type="Animation" id="Animation_e1hvu"]
resource_name = "CursorBreath"
loop_mode = 2
tracks/0/type = "scale_3d"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = PackedFloat32Array(0, 1, 1.2, 1.2, 1.2, 1, 1, 1, 1, 1)

[sub_resource type="AnimationLibrary" id="AnimationLibrary_slj4o"]
_data = {
"CursorBreath": SubResource("Animation_e1hvu")
}

[node name="Cursor" type="Node3D"]
script = ExtResource("1_gsw3j")

[node name="Box" parent="." instance=ExtResource("2_raobt")]
[node name="Area3D" type="Area3D" parent="."]

[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
transform = Transform3D(0.9, 0, 0, 0, 0.9, 0, 0, 0, 0.9, 0, 0, 0)
shape = SubResource("ConvexPolygonShape3D_4lrr7")

[node name="Box" type="MeshInstance3D" parent="."]
transform = Transform3D(1.2, 0, 0, 0, 1.2, 0, 0, 0, 1.2, 0, 0, 0)
layers = 2
cast_shadow = 0
mesh = SubResource("ArrayMesh_351w7")
skeleton = NodePath("")
surface_material_override/0 = ExtResource("2_0tkj2")

[node name="AnimationPlayer" type="AnimationPlayer" parent="Box"]
libraries = {
"": SubResource("AnimationLibrary_slj4o")
}
autoplay = "CursorBreath"
speed_scale = 1.25

[node name="Pivot" type="Node3D" parent="."]

[node name="Camera" type="Camera3D" parent="Box"]
transform = Transform3D(-0.612372, 0.5, -0.612373, -0.0473672, 0.75, 0.65974, 0.789149, 0.433013, -0.435595, -10, 10, -10)
[node name="Camera" type="Camera3D" parent="Pivot"]
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -200, 0, 0)
cull_mask = 1048574
projection = 1
current = true
size = 10.0
size = 20.0
1 change: 0 additions & 1 deletion Scenes/MainScene.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
[node name="UI" parent="." instance=ExtResource("2_7lqbu")]

[node name="Cursor" parent="." instance=ExtResource("1_qhvts")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 0.5, 0.5)

[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = ExtResource("3_tf75n")
Expand Down
15 changes: 11 additions & 4 deletions Scenes/UI.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,14 @@ size_flags_vertical = 3
[node name="Position" type="Label" parent="Sidebar/SidebarVertical"]
layout_mode = 2
mouse_filter = 1
text = "(0, 0, 0) (x, y, z)"
horizontal_alignment = 2
text = "[0, 0, 0]"
horizontal_alignment = 1

[node name="Object" type="Label" parent="Sidebar/SidebarVertical"]
layout_mode = 2
mouse_filter = 1
text = "None"
horizontal_alignment = 1

[node name="EditorLog" type="RichTextLabel" parent="Sidebar/SidebarVertical"]
layout_mode = 2
Expand All @@ -194,6 +200,7 @@ threaded = true
script = ExtResource("7_jfdyk")

[node name="CompassView" type="SubViewportContainer" parent="Sidebar/SidebarVertical"]
visible = false
layout_mode = 2
size_flags_vertical = 3
size_flags_stretch_ratio = 0.5
Expand All @@ -202,8 +209,8 @@ stretch = true
[node name="Compass" type="SubViewport" parent="Sidebar/SidebarVertical/CompassView"]
transparent_bg = true
handle_input_locally = false
size = Vector2i(203, 205)
render_target_update_mode = 4
size = Vector2i(2, 2)
render_target_update_mode = 0

[node name="Compass" parent="Sidebar/SidebarVertical/CompassView/Compass" instance=ExtResource("6_exilt")]
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 0, 0)
Expand Down
82 changes: 37 additions & 45 deletions Scripts/Cursor.gd
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
extends Node3D

@onready var localCam = $"Box/Camera"
@onready var cursorBox = $"Box"
@onready var localCam: Camera3D = $"Pivot/Camera"
@onready var pivot: Node3D = $"Pivot"
@onready var cursorBox: MeshInstance3D = $"Box"

signal hasMoved(keyPress)

var oldCamPos
var newCamPos

var allowMove = true
var mode2D = false
var mode3D = false

var cursorSpeed = Settings.animationSpeed * 0.5
var gomezPos := Vector3.ZERO

func tweenToPos(obj: Object, property: NodePath, direction: Variant, action, speed): # Function dedicated to smooth movement.
allowMove = false
Expand Down Expand Up @@ -45,58 +44,51 @@ func _input(_event):
var _moveTo = Vector3.ZERO # Prevent cursor from going below (0, 0, 0)

### Camera Movement
if Input.is_action_pressed("ui_lt", true):
tweenToPos(self, "rotation_degrees:y", rotation_degrees.y - 90, "ui_lt", Settings.animationSpeed)

if Input.is_action_pressed("ui_rt", true):
tweenToPos(self, "rotation_degrees:y", rotation_degrees.y + 90, "ui_rt", Settings.animationSpeed)
if Input.is_action_pressed("move_lt", true):
tweenToPos(self, "rotation_degrees:y", rotation_degrees.y - 90, "move_lt", Settings.animationSpeed)

if Input.is_action_pressed("ui_2d", true):
if !mode2D:
emit_signal("hasMoved", "ui_2d_enter")
mode2D = true
oldCamPos = localCam.position
newCamPos = Vector3(oldCamPos.x, 0, 0)
if Input.is_action_pressed("move_rt", true):
tweenToPos(self, "rotation_degrees:y", rotation_degrees.y + 90, "move_rt", Settings.animationSpeed)

else:
emit_signal("hasMoved", "ui_2d_exit")
newCamPos = oldCamPos
mode2D = false
if Input.is_action_just_pressed("cam_zoom_in", true): # Don't want the camera zooming into the cursor or even behind it
tweenToPos(localCam, "size", localCam.size - Settings.zoomSpeed, "cam_zoom_in", cursorSpeed)

tweenToPos(localCam, "position", newCamPos, "N/A", Settings.animationSpeed)
if Input.is_action_just_pressed("cam_zoom_out", true): # zoom out is fine from zoom bug
tweenToPos(localCam, "size", localCam.size + Settings.zoomSpeed, "cam_zoom_out", cursorSpeed)

if Input.is_action_just_released("ui_zoom_in", true): # Don't want the camera zooming into the cursor or even behind it
var movePosition = localCam.position + Settings.zoomSpeed
movePosition = round(movePosition) # rounding due to weird decimal stuff
if movePosition == position or movePosition > position:
failMove()
if Input.is_action_pressed("cam_2d", true): # zoom out is fine from zoom bug
if mode3D:
mode3D = false
tweenToPos(pivot, "rotation_degrees", Vector3(0, 0, 0), "cam_zoom_in", Settings.animationSpeed)
else:
tweenToPos(localCam, "position", localCam.position + Settings.zoomSpeed, "ui_zoom_in", cursorSpeed)

if Input.is_action_just_released("ui_zoom_out", true): # zoom out is fine from zoom bug
tweenToPos(localCam, "position", localCam.position - Settings.zoomSpeed, "ui_zoom_out", cursorSpeed)

mode3D = true
tweenToPos(pivot, "rotation_degrees", Vector3(0, -45, -45), "cam_zoom_out", Settings.animationSpeed)

### Cursor Movement. There must be a better way.
if Input.is_action_pressed("ui_up_layer", true):
tweenToPos(self, "position:y", position.y + Settings.movementSpeed, "ui_up_layer", cursorSpeed)
if Input.is_action_pressed("move_forward", true):
tweenToPos(self, "position:y", position.y + Settings.movementSpeed, "move_up", cursorSpeed)

if Input.is_action_pressed("move_backward", true):
tweenToPos(self, "position:y", position.y - Settings.movementSpeed, "move_down", cursorSpeed)

if Input.is_action_pressed("ui_down_layer", true):
tweenToPos(self, "position:y", position.y - Settings.movementSpeed, "ui_down_layer", cursorSpeed)
if Input.is_action_pressed("move_up_layer", true):
tweenToPos(self, "position", position + (Settings.movementSpeed * right), "move_up_layer", cursorSpeed)

if Input.is_action_pressed("ui_up", true):
tweenToPos(self, "position", position + (Settings.movementSpeed * forward), "ui_up", cursorSpeed)
if Input.is_action_pressed("move_down_layer", true):
tweenToPos(self, "position", position - (Settings.movementSpeed * right), "move_down_layer", cursorSpeed)

if Input.is_action_pressed("ui_down", true):
tweenToPos(self, "position", position - (Settings.movementSpeed * forward), "ui_down", cursorSpeed)
if Input.is_action_pressed("move_right", true):
tweenToPos(self, "position", position + (forward * Settings.movementSpeed), "move_right", cursorSpeed)

if Input.is_action_pressed("ui_right", true):
tweenToPos(self, "position", position + (right * Settings.movementSpeed), "ui_right", cursorSpeed)
if Input.is_action_pressed("move_left", true):
tweenToPos(self, "position", position - (forward * Settings.movementSpeed), "move_left", cursorSpeed)

if Input.is_action_pressed("ui_left", true):
tweenToPos(self, "position", position - (right * Settings.movementSpeed), "ui_left", cursorSpeed)
if Input.is_action_pressed("move_gomez", true):
tweenToPos(self, "global_position", gomezPos, "loaded", cursorSpeed)

# New cursor position
func _on_ui_cursor_pos(newPos):
tweenToPos(self, "position", newPos, "loaded", cursorSpeed)
gomezPos = newPos
emit_signal("hasMoved", "loaded")
global_position = newPos
pass # Replace with function body.
Loading

0 comments on commit 207a7a2

Please sign in to comment.