summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/index.html2
-rw-r--r--docs/index.pckbin1943232 -> 1943812 bytes
-rw-r--r--docs/index.service.worker.js2
-rw-r--r--game_camera.gd22
-rw-r--r--game_camera.tscn31
-rw-r--r--level_test.tscn6
-rw-r--r--touch_screen_button.gd6
-rw-r--r--touch_screen_ui.tscn33
8 files changed, 43 insertions, 59 deletions
diff --git a/docs/index.html b/docs/index.html
index e9dd045..0185696 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -112,7 +112,7 @@ body {
<script src="index.js"></script>
<script>
-const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"emscriptenPoolSize":8,"ensureCrossOriginIsolationHeaders":false,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":1943232,"index.wasm":38034280},"focusCanvas":true,"gdextensionLibs":[],"godotPoolSize":4,"serviceWorker":"index.service.worker.js"};
+const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"emscriptenPoolSize":8,"ensureCrossOriginIsolationHeaders":false,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":1943812,"index.wasm":38034280},"focusCanvas":true,"gdextensionLibs":[],"godotPoolSize":4,"serviceWorker":"index.service.worker.js"};
const GODOT_THREADS_ENABLED = false;
const engine = new Engine(GODOT_CONFIG);
diff --git a/docs/index.pck b/docs/index.pck
index 6e1678b..8aeaa8c 100644
--- a/docs/index.pck
+++ b/docs/index.pck
Binary files differ
diff --git a/docs/index.service.worker.js b/docs/index.service.worker.js
index c928d77..a6c2981 100644
--- a/docs/index.service.worker.js
+++ b/docs/index.service.worker.js
@@ -4,7 +4,7 @@
// Incrementing CACHE_VERSION will kick off the install event and force
// previously cached resources to be updated from the network.
/** @type {string} */
-const CACHE_VERSION = '1763121903|10918918109';
+const CACHE_VERSION = '1763122791|11807370184';
/** @type {string} */
const CACHE_PREFIX = 'MobileMetroidvan-sw-cache-';
const CACHE_NAME = CACHE_PREFIX + CACHE_VERSION;
diff --git a/game_camera.gd b/game_camera.gd
index 9e6fd2b..4348ace 100644
--- a/game_camera.gd
+++ b/game_camera.gd
@@ -1,27 +1,12 @@
extends Camera2D
-@onready var parent = get_parent()
-@onready var is_parent_player = parent is Player
-
## Amount to smoothly offset the camera if the parent is a Player.
@export var offset_amt: Vector2
-var time_since_floor: float = 0.0
-var time_since_floor_max: float = 1.0
-
-# Called when the node enters the scene tree for the first time.
-func _ready() -> void:
- pass # Replace with function body.
-
-
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta: float) -> void:
- #if player.is_on_floor():
- # time_since_floor = 0
- #elif time_since_floor < time_since_floor_max:
- # time_since_floor += delta
-
- if is_parent_player:
+ var parent = get_parent()
+ if parent is Player:
var player: Player = parent
position.x = player.get_facing() * offset_amt.x
@@ -29,6 +14,3 @@ func _process(_delta: float) -> void:
position.y = offset_amt.y
else:
position.y = 0
-
- #offset.y = lerpf(0.0, look_down_on_jump_amt, ease(time_since_floor, 0.2))
- #print_debug("offset y:", offset.y)
diff --git a/game_camera.tscn b/game_camera.tscn
index 4bac6bd..cbf8aca 100644
--- a/game_camera.tscn
+++ b/game_camera.tscn
@@ -1,37 +1,8 @@
-[gd_scene load_steps=8 format=3 uid="uid://dfyvkc2qlcdac"]
+[gd_scene load_steps=2 format=3 uid="uid://dfyvkc2qlcdac"]
-[ext_resource type="PackedScene" uid="uid://dwl0fylftkrn7" path="res://touch_screen_button.tscn" id="1_kci6r"]
[ext_resource type="Script" uid="uid://dul8m52uio8t5" path="res://game_camera.gd" id="1_sfxhn"]
-[ext_resource type="Texture2D" uid="uid://dxwflmdxikfiu" path="res://assets/kenney_1-bit-input-prompts-pixel-16/Tiles (Black)/tile_0758.png" id="2_sfxhn"]
-[ext_resource type="Texture2D" uid="uid://bhpl1ew34plow" path="res://assets/kenney_1-bit-input-prompts-pixel-16/Tiles (Black)/tile_0760.png" id="3_4qcmi"]
-[ext_resource type="Texture2D" uid="uid://m46a5qu4rgui" path="res://assets/kenney_1-bit-input-prompts-pixel-16/Tiles (Black)/tile_0757.png" id="4_2jofw"]
-[ext_resource type="Texture2D" uid="uid://dsetjcrrlp7gu" path="res://assets/kenney_1-bit-input-prompts-pixel-16/Tiles (Black)/tile_0769.png" id="5_5dmry"]
-
-[sub_resource type="RectangleShape2D" id="RectangleShape2D_k6i1l"]
-size = Vector2(40, 26)
[node name="GameCamera" type="Camera2D"]
position_smoothing_enabled = true
position_smoothing_speed = 16.0
script = ExtResource("1_sfxhn")
-
-[node name="TouchScreenButtonRight" parent="." instance=ExtResource("1_kci6r")]
-position = Vector2(-36, 34)
-action = "move_right"
-texture = ExtResource("2_sfxhn")
-
-[node name="TouchScreenButtonLeft" parent="." instance=ExtResource("1_kci6r")]
-position = Vector2(-76, 34)
-action = "move_left"
-texture = ExtResource("3_4qcmi")
-
-[node name="TouchScreenButtonJump" parent="." instance=ExtResource("1_kci6r")]
-position = Vector2(76, 34)
-action = "jump"
-texture = ExtResource("4_2jofw")
-
-[node name="TouchScreenButtonMenu" parent="." instance=ExtResource("1_kci6r")]
-position = Vector2(76, -41)
-shape = SubResource("RectangleShape2D_k6i1l")
-action = "menu"
-texture = ExtResource("5_5dmry")
diff --git a/level_test.tscn b/level_test.tscn
index 9d86227..ea17189 100644
--- a/level_test.tscn
+++ b/level_test.tscn
@@ -1,9 +1,10 @@
-[gd_scene load_steps=8 format=4 uid="uid://cfj21o6wsd3hv"]
+[gd_scene load_steps=9 format=4 uid="uid://cfj21o6wsd3hv"]
[ext_resource type="Texture2D" uid="uid://o0yy2jkyp0dy" path="res://assets/kenney_1-bit-platformer-pack/Tilemap/monochrome_tilemap_transparent_packed.png" id="1_56xti"]
[ext_resource type="Script" uid="uid://b3xwng3dkn5s7" path="res://level_test.gd" id="1_mge0y"]
[ext_resource type="PackedScene" uid="uid://coxnsharboouu" path="res://player.tscn" id="2_mge0y"]
[ext_resource type="PackedScene" uid="uid://dfyvkc2qlcdac" path="res://game_camera.tscn" id="4_6ih1o"]
+[ext_resource type="PackedScene" uid="uid://cciwccvljuuyq" path="res://touch_screen_ui.tscn" id="5_56xti"]
[ext_resource type="Script" uid="uid://rjab5emlyx6" path="res://esc_listener.gd" id="8_hpvma"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_0e48y"]
@@ -458,3 +459,6 @@ offset_amt = Vector2(40, 14)
[node name="EscListener" type="Node" parent="."]
script = ExtResource("8_hpvma")
+
+[node name="TouchScreenUI" parent="." instance=ExtResource("5_56xti")]
+position = Vector2(90, 64)
diff --git a/touch_screen_button.gd b/touch_screen_button.gd
index c7ff973..0b53623 100644
--- a/touch_screen_button.gd
+++ b/touch_screen_button.gd
@@ -1,4 +1,3 @@
-class_name CustomTouchScreenButton
extends TouchScreenButton
@export var texture: Texture2D
@@ -8,8 +7,3 @@ func _ready() -> void:
$TextureRect.texture = texture
if not DisplayServer.is_touchscreen_available():
visible = false
-
-
-# Called every frame. 'delta' is the elapsed time since the previous frame.
-func _process(_delta: float) -> void:
- pass
diff --git a/touch_screen_ui.tscn b/touch_screen_ui.tscn
new file mode 100644
index 0000000..3748379
--- /dev/null
+++ b/touch_screen_ui.tscn
@@ -0,0 +1,33 @@
+[gd_scene load_steps=7 format=3 uid="uid://cciwccvljuuyq"]
+
+[ext_resource type="PackedScene" uid="uid://dwl0fylftkrn7" path="res://touch_screen_button.tscn" id="1_e48dh"]
+[ext_resource type="Texture2D" uid="uid://dxwflmdxikfiu" path="res://assets/kenney_1-bit-input-prompts-pixel-16/Tiles (Black)/tile_0758.png" id="2_v5djr"]
+[ext_resource type="Texture2D" uid="uid://bhpl1ew34plow" path="res://assets/kenney_1-bit-input-prompts-pixel-16/Tiles (Black)/tile_0760.png" id="3_jinrf"]
+[ext_resource type="Texture2D" uid="uid://m46a5qu4rgui" path="res://assets/kenney_1-bit-input-prompts-pixel-16/Tiles (Black)/tile_0757.png" id="4_ay5rb"]
+[ext_resource type="Texture2D" uid="uid://dsetjcrrlp7gu" path="res://assets/kenney_1-bit-input-prompts-pixel-16/Tiles (Black)/tile_0769.png" id="5_ac8rc"]
+
+[sub_resource type="RectangleShape2D" id="RectangleShape2D_k6i1l"]
+size = Vector2(40, 26)
+
+[node name="TouchScreenUI" type="CanvasLayer"]
+
+[node name="TouchScreenButtonRight" parent="." instance=ExtResource("1_e48dh")]
+position = Vector2(60, 88)
+action = "move_right"
+texture = ExtResource("2_v5djr")
+
+[node name="TouchScreenButtonLeft" parent="." instance=ExtResource("1_e48dh")]
+position = Vector2(20, 88)
+action = "move_left"
+texture = ExtResource("3_jinrf")
+
+[node name="TouchScreenButtonJump" parent="." instance=ExtResource("1_e48dh")]
+position = Vector2(172, 88)
+action = "jump"
+texture = ExtResource("4_ay5rb")
+
+[node name="TouchScreenButtonMenu" parent="." instance=ExtResource("1_e48dh")]
+position = Vector2(172, 13)
+shape = SubResource("RectangleShape2D_k6i1l")
+action = "menu"
+texture = ExtResource("5_ac8rc")