Add objectives listing and all four data disks/tablets.
Track each individual disk and ensure they are loaded in order. Player can collect multiple disks in one run but must present them to the pharaoh in order.
This commit is contained in:
1 parent
fa9ec1e5cd
commit
1aa29a0539
7 files changed
+73
-14
No files matched your search
@@ -4,4 +4,5 @@ extends Pickup
|
|||||||
|
|
||||||
func _on_picked_up() -> void:
|
func _on_picked_up() -> void:
|
||||||
%Player2D.give_disk(disk_num)
|
%Player2D.give_disk(disk_num)
|
||||||
|
%Player2D.give_objective("disk%d" % disk_num, "Install data disk %d" % disk_num)
|
||||||
print("Picked up disk ", disk_num)
|
print("Picked up disk ", disk_num)
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
extends RichTextLabel
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
var new_text = "OBJECTIVES:\n"
|
||||||
|
for objective in %Player2D.objectives:
|
||||||
|
new_text = new_text + %Player2D.objectives[objective]
|
||||||
|
text = new_text
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://oyyhhy1gemg0
|
||||||
+14
-4
@@ -1,6 +1,6 @@
|
|||||||
extends Interactable
|
extends Interactable
|
||||||
|
|
||||||
var disks_wanted = [1, 2, 3, 4, 5]
|
var disks_wanted = [1, 2, 3, 4]
|
||||||
var disks_loaded = []
|
var disks_loaded = []
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
@@ -15,8 +15,18 @@ func load_disk(disk_num: int) -> bool:
|
|||||||
return true
|
return true
|
||||||
|
|
||||||
func _on_interacted() -> void:
|
func _on_interacted() -> void:
|
||||||
var disk_num = %Player2D.take_disk()
|
var wanted_disk = disks_wanted.front()
|
||||||
if not load_disk(disk_num):
|
if not %Player2D.take_disk(wanted_disk):
|
||||||
return
|
return
|
||||||
|
|
||||||
print("Loaded up disk ", disk_num)
|
if not load_disk(wanted_disk):
|
||||||
|
return
|
||||||
|
|
||||||
|
%Player2D.complete_objective("disk%d" % wanted_disk)
|
||||||
|
print("Loaded up disk ", wanted_disk)
|
||||||
|
|
||||||
|
wanted_disk = disks_wanted.front()
|
||||||
|
if not wanted_disk:
|
||||||
|
return
|
||||||
|
|
||||||
|
%Player2D.give_objective("disk%d" % wanted_disk, "Locate data disk %d" % wanted_disk)
|
||||||
+20
-6
@@ -19,6 +19,7 @@ var death_threshold = 1000
|
|||||||
var coins = 0
|
var coins = 0
|
||||||
|
|
||||||
var data_disks = []
|
var data_disks = []
|
||||||
|
var objectives = {}
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
DisplayServer.window_set_title("JUMPS EQUALS JUMPS")
|
DisplayServer.window_set_title("JUMPS EQUALS JUMPS")
|
||||||
@@ -43,12 +44,25 @@ func refresh_jump(new_jumps):
|
|||||||
func give_disk(disk_num: int) -> void:
|
func give_disk(disk_num: int) -> void:
|
||||||
data_disks.push_back(disk_num)
|
data_disks.push_back(disk_num)
|
||||||
|
|
||||||
func take_disk() -> int:
|
func take_disk(disk_num) -> bool:
|
||||||
var disk_num = data_disks.pop_back()
|
if not has_disk(disk_num):
|
||||||
if disk_num:
|
return false
|
||||||
return disk_num
|
|
||||||
return 0
|
data_disks.remove_at(data_disks.find(disk_num))
|
||||||
|
return true
|
||||||
|
|
||||||
|
func has_disk(disk_num: int) -> bool:
|
||||||
|
return disk_num in data_disks
|
||||||
|
|
||||||
|
func give_objective(id: String, description: String) -> void:
|
||||||
|
objectives[id] = description
|
||||||
|
|
||||||
|
func has_objective(id: String) -> bool:
|
||||||
|
return objectives.has(id)
|
||||||
|
|
||||||
|
func complete_objective(id: String) -> bool:
|
||||||
|
return objectives.erase(id)
|
||||||
|
|
||||||
func on_teleport():
|
func on_teleport():
|
||||||
refresh_jump(1)
|
refresh_jump(1)
|
||||||
teleport_cooldown = 1
|
teleport_cooldown = 1
|
||||||
|
|||||||
+4
-4
@@ -5,8 +5,8 @@
|
|||||||
[ext_resource type="Texture2D" uid="uid://dpdxs6gjmexgh" path="res://art/background.png" id="3_p3026"]
|
[ext_resource type="Texture2D" uid="uid://dpdxs6gjmexgh" path="res://art/background.png" id="3_p3026"]
|
||||||
[ext_resource type="Texture2D" uid="uid://biv3f67rqumak" path="res://art/level_start.png" id="4_nj6as"]
|
[ext_resource type="Texture2D" uid="uid://biv3f67rqumak" path="res://art/level_start.png" id="4_nj6as"]
|
||||||
[ext_resource type="Script" uid="uid://3bqq3mfbby2c" path="res://warp_shader.gd" id="4_pmt5n"]
|
[ext_resource type="Script" uid="uid://3bqq3mfbby2c" path="res://warp_shader.gd" id="4_pmt5n"]
|
||||||
[ext_resource type="Texture2D" uid="uid://lk0f1qyswyxv" path="res://art/player/running/frame1.png" id="5_6jyqn"]
|
[ext_resource type="Texture2D" uid="uid://lk0f1qyswyxv" path="res://art/player/idle/frame1.png" id="5_6jyqn"]
|
||||||
[ext_resource type="Texture2D" uid="uid://lmje8plw76e1" path="res://art/player/running/frame2.png" id="6_gt2ls"]
|
[ext_resource type="Texture2D" uid="uid://lmje8plw76e1" path="res://art/player/idle/frame2.png" id="6_gt2ls"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bfyd1tro3s0gl" path="res://art/player/crystal2.png" id="7_oy4pt"]
|
[ext_resource type="Texture2D" uid="uid://bfyd1tro3s0gl" path="res://art/player/crystal2.png" id="7_oy4pt"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dh7a1knyqn5nd" path="res://art/player/running/frame3.png" id="7_pmt5n"]
|
[ext_resource type="Texture2D" uid="uid://dh7a1knyqn5nd" path="res://art/player/running/frame3.png" id="7_pmt5n"]
|
||||||
[ext_resource type="Texture2D" uid="uid://yf13nw31k8ua" path="res://art/player/running/frame4.png" id="8_nj6as"]
|
[ext_resource type="Texture2D" uid="uid://yf13nw31k8ua" path="res://art/player/running/frame4.png" id="8_nj6as"]
|
||||||
@@ -161,7 +161,7 @@ autoplay = "idle"
|
|||||||
[node name="DashIndicator" type="CPUParticles2D" parent="Jetpack" unique_id=1424397604]
|
[node name="DashIndicator" type="CPUParticles2D" parent="Jetpack" unique_id=1424397604]
|
||||||
position = Vector2(-11, -2)
|
position = Vector2(-11, -2)
|
||||||
texture = ExtResource("16_ur4nw")
|
texture = ExtResource("16_ur4nw")
|
||||||
lifetime = 0.09999999999999999
|
lifetime = 0.1
|
||||||
gravity = Vector2(0, 0)
|
gravity = Vector2(0, 0)
|
||||||
|
|
||||||
[node name="DashIndicatorGlow" type="PointLight2D" parent="Jetpack/DashIndicator" unique_id=1334369973]
|
[node name="DashIndicatorGlow" type="PointLight2D" parent="Jetpack/DashIndicator" unique_id=1334369973]
|
||||||
@@ -172,7 +172,7 @@ texture = ExtResource("10_ur4nw")
|
|||||||
[node name="JumpIndicator" type="CPUParticles2D" parent="Jetpack" unique_id=1519478958]
|
[node name="JumpIndicator" type="CPUParticles2D" parent="Jetpack" unique_id=1519478958]
|
||||||
position = Vector2(13, -2)
|
position = Vector2(13, -2)
|
||||||
texture = ExtResource("18_fat58")
|
texture = ExtResource("18_fat58")
|
||||||
lifetime = 0.09999999999999999
|
lifetime = 0.1
|
||||||
gravity = Vector2(0, 0)
|
gravity = Vector2(0, 0)
|
||||||
|
|
||||||
[node name="JumpIndicatorGlow" type="PointLight2D" parent="Jetpack/JumpIndicator" unique_id=920409859]
|
[node name="JumpIndicatorGlow" type="PointLight2D" parent="Jetpack/JumpIndicator" unique_id=920409859]
|
||||||
|
|||||||
+25
@@ -16,6 +16,7 @@
|
|||||||
[ext_resource type="PackedScene" uid="uid://c8m4d77hcr0pj" path="res://spike.tscn" id="12_k3n1d"]
|
[ext_resource type="PackedScene" uid="uid://c8m4d77hcr0pj" path="res://spike.tscn" id="12_k3n1d"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dxgnkftqtyt53" path="res://art/music_button_disabled.png" id="13_70uel"]
|
[ext_resource type="Texture2D" uid="uid://dxgnkftqtyt53" path="res://art/music_button_disabled.png" id="13_70uel"]
|
||||||
[ext_resource type="Script" uid="uid://d3rx82psovcpp" path="res://music_button.gd" id="14_70uel"]
|
[ext_resource type="Script" uid="uid://d3rx82psovcpp" path="res://music_button.gd" id="14_70uel"]
|
||||||
|
[ext_resource type="Script" uid="uid://oyyhhy1gemg0" path="res://objectives_label.gd" id="14_ikiii"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dr8h8xij3qw2h" path="res://pharaoh.tscn" id="15_hiqwa"]
|
[ext_resource type="PackedScene" uid="uid://dr8h8xij3qw2h" path="res://pharaoh.tscn" id="15_hiqwa"]
|
||||||
|
|
||||||
[node name="World" type="Node2D" unique_id=1327991900]
|
[node name="World" type="Node2D" unique_id=1327991900]
|
||||||
@@ -205,6 +206,18 @@ position = Vector2(0, -85.66513)
|
|||||||
position = Vector2(213, 95.511696)
|
position = Vector2(213, 95.511696)
|
||||||
disk_num = 1
|
disk_num = 1
|
||||||
|
|
||||||
|
[node name="Disk2" parent="Tutorial" unique_id=369042906 instance=ExtResource("10_2u3nc")]
|
||||||
|
position = Vector2(285, 96.49635)
|
||||||
|
disk_num = 2
|
||||||
|
|
||||||
|
[node name="Disk3" parent="Tutorial" unique_id=224370384 instance=ExtResource("10_2u3nc")]
|
||||||
|
position = Vector2(188, 234.34827)
|
||||||
|
disk_num = 3
|
||||||
|
|
||||||
|
[node name="Disk4" parent="Tutorial" unique_id=1193788903 instance=ExtResource("10_2u3nc")]
|
||||||
|
position = Vector2(293, 182.16148)
|
||||||
|
disk_num = 4
|
||||||
|
|
||||||
[node name="WallSpike" parent="Tutorial" unique_id=287086441 instance=ExtResource("10_hiqwa")]
|
[node name="WallSpike" parent="Tutorial" unique_id=287086441 instance=ExtResource("10_hiqwa")]
|
||||||
position = Vector2(1325, 629.1956)
|
position = Vector2(1325, 629.1956)
|
||||||
|
|
||||||
@@ -310,6 +323,18 @@ bbcode_enabled = true
|
|||||||
text = "COINS:"
|
text = "COINS:"
|
||||||
script = ExtResource("3_wse8f")
|
script = ExtResource("3_wse8f")
|
||||||
|
|
||||||
|
[node name="Objectives" type="RichTextLabel" parent="CanvasLayer" unique_id=528356873]
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
offset_top = 274.0
|
||||||
|
offset_bottom = 274.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
bbcode_enabled = true
|
||||||
|
text = "OBJECTIVES:"
|
||||||
|
script = ExtResource("14_ikiii")
|
||||||
|
|
||||||
[node name="MusicButton" type="TextureButton" parent="CanvasLayer" unique_id=1088022504]
|
[node name="MusicButton" type="TextureButton" parent="CanvasLayer" unique_id=1088022504]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
anchors_preset = 1
|
anchors_preset = 1
|
||||||
|
|||||||
Reference in new issue
Block a user