Added descriptions to upgrades and fixed timer not stopping bug
This commit is contained in:
@@ -5,4 +5,6 @@
|
|||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
shader = ExtResource("1_otqlg")
|
shader = ExtResource("1_otqlg")
|
||||||
|
shader_parameter/rect_global_position = Vector2(0.161003, 0.0735294)
|
||||||
|
shader_parameter/rect_size = Vector2(242, 25)
|
||||||
shader_parameter/ColourTexture = ExtResource("2_rlu6f")
|
shader_parameter/ColourTexture = ExtResource("2_rlu6f")
|
||||||
|
|||||||
18
Dunkanoid.gd
18
Dunkanoid.gd
@@ -95,6 +95,9 @@ func _process(delta : float) -> void:
|
|||||||
if mode == MODE_LEAVE:
|
if mode == MODE_LEAVE:
|
||||||
PaddleNode.global_position.x += (delta * leave_direction * 20.0)
|
PaddleNode.global_position.x += (delta * leave_direction * 20.0)
|
||||||
if PaddleNode.global_position.x < -16 or PaddleNode.global_position.x > 462:
|
if PaddleNode.global_position.x < -16 or PaddleNode.global_position.x > 462:
|
||||||
|
if level == "NOTFOUND" and not Music.jingle_playing:
|
||||||
|
get_tree().change_scene_to_file("res://Intro.tscn")
|
||||||
|
return
|
||||||
if opened:
|
if opened:
|
||||||
PipesNode.close_door(Pipes.BOTTOM_LEFT)
|
PipesNode.close_door(Pipes.BOTTOM_LEFT)
|
||||||
PipesNode.close_door(Pipes.BOTTOM_RIGHT)
|
PipesNode.close_door(Pipes.BOTTOM_RIGHT)
|
||||||
@@ -141,14 +144,12 @@ func new_level() -> void:
|
|||||||
PaddleNode.position.x = 224
|
PaddleNode.position.x = 224
|
||||||
mode = MODE_WAIT
|
mode = MODE_WAIT
|
||||||
for ball in balls:
|
for ball in balls:
|
||||||
if ball.get_parent() != self:
|
call_deferred("remove_child", ball)
|
||||||
print("For some reason this ball's parent has got lost")
|
ball.call_deferred("queue_free")
|
||||||
remove_child(ball)
|
|
||||||
ball.queue_free()
|
|
||||||
balls.clear()
|
balls.clear()
|
||||||
for brick in bricks:
|
for brick in bricks:
|
||||||
BricksNode.remove_child(brick)
|
BricksNode.call_deferred("remove_child", brick)
|
||||||
brick.queue_free()
|
brick.call_deferred("queue_free")
|
||||||
bricks.clear()
|
bricks.clear()
|
||||||
chr += 1
|
chr += 1
|
||||||
level_data = load_level_from_disk(level)
|
level_data = load_level_from_disk(level)
|
||||||
@@ -198,6 +199,7 @@ func _brick_destroyed(brick) -> void:
|
|||||||
brick_count += 1
|
brick_count += 1
|
||||||
|
|
||||||
if brick_count == 0:
|
if brick_count == 0:
|
||||||
|
RunTimerNode.pause()
|
||||||
for ball in balls:
|
for ball in balls:
|
||||||
call_deferred("remove_child", ball)
|
call_deferred("remove_child", ball)
|
||||||
ball.call_deferred("queue_free")
|
ball.call_deferred("queue_free")
|
||||||
@@ -273,8 +275,8 @@ func _on_hit_floor(ball, _power) -> void:
|
|||||||
if balls.size() == 0:
|
if balls.size() == 0:
|
||||||
for c in get_children():
|
for c in get_children():
|
||||||
if c is Upgrade:
|
if c is Upgrade:
|
||||||
remove_child(c)
|
call_deferred("remove_child", c)
|
||||||
c.queue_free()
|
c.call_deferred("queue_free")
|
||||||
PaddleNode.normal()
|
PaddleNode.normal()
|
||||||
ball = _Ball.instantiate()
|
ball = _Ball.instantiate()
|
||||||
ball.capture(PaddleNode, Vector2((randf() * 32) - 16, 8))
|
ball.capture(PaddleNode, Vector2((randf() * 32) - 16, 8))
|
||||||
|
|||||||
@@ -42,13 +42,13 @@ distance = -432.0
|
|||||||
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_48dqy"]
|
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_48dqy"]
|
||||||
distance = -360.0
|
distance = -360.0
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_acp7s"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_j418f"]
|
||||||
shader = ExtResource("12_ljnes")
|
shader = ExtResource("12_ljnes")
|
||||||
shader_parameter/rect_global_position = Vector2(0, 0.210294)
|
shader_parameter/rect_global_position = Vector2(0, 0.210294)
|
||||||
shader_parameter/rect_size = Vector2(448, 25)
|
shader_parameter/rect_size = Vector2(448, 25)
|
||||||
shader_parameter/ColourTexture = ExtResource("13_u52d1")
|
shader_parameter/ColourTexture = ExtResource("13_u52d1")
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_cxvt8"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_u2pgi"]
|
||||||
shader = ExtResource("12_ljnes")
|
shader = ExtResource("12_ljnes")
|
||||||
shader_parameter/rect_global_position = Vector2(0, 0)
|
shader_parameter/rect_global_position = Vector2(0, 0)
|
||||||
shader_parameter/rect_size = Vector2(89, 25)
|
shader_parameter/rect_size = Vector2(89, 25)
|
||||||
@@ -322,7 +322,7 @@ theme_type_variation = &"RoundStart"
|
|||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|
||||||
[node name="Title" type="Label" parent="Start/VBoxContainer/PanelContainer/VBoxContainer"]
|
[node name="Title" type="Label" parent="Start/VBoxContainer/PanelContainer/VBoxContainer"]
|
||||||
material = SubResource("ShaderMaterial_acp7s")
|
material = SubResource("ShaderMaterial_j418f")
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
theme = ExtResource("8_wcf7g")
|
theme = ExtResource("8_wcf7g")
|
||||||
theme_type_variation = &"Arkanoid"
|
theme_type_variation = &"Arkanoid"
|
||||||
@@ -370,7 +370,7 @@ size_flags_vertical = 3
|
|||||||
theme = ExtResource("8_wcf7g")
|
theme = ExtResource("8_wcf7g")
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="Paused/VBoxContainer"]
|
[node name="Label" type="Label" parent="Paused/VBoxContainer"]
|
||||||
material = SubResource("ShaderMaterial_cxvt8")
|
material = SubResource("ShaderMaterial_u2pgi")
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
theme = ExtResource("8_wcf7g")
|
theme = ExtResource("8_wcf7g")
|
||||||
theme_type_variation = &"Arkanoid"
|
theme_type_variation = &"Arkanoid"
|
||||||
|
|||||||
45
Global.gd
45
Global.gd
@@ -2,6 +2,15 @@ extends Node
|
|||||||
|
|
||||||
const INT64_MAX = (1 << 63) - 1 # 9223372036854775807
|
const INT64_MAX = (1 << 63) - 1 # 9223372036854775807
|
||||||
|
|
||||||
|
const _settings : Array[String] = [
|
||||||
|
"highscore", "relative_mouse",
|
||||||
|
"music_volume", "effects_volume",
|
||||||
|
"best_times", "upgrade_tokens",
|
||||||
|
"effect_time", "laser_power",
|
||||||
|
"extra_lives", "powerup_percent",
|
||||||
|
"ball_split", "laser_autofire"
|
||||||
|
]
|
||||||
|
|
||||||
var score : int = 0 :
|
var score : int = 0 :
|
||||||
set(x):
|
set(x):
|
||||||
score = x
|
score = x
|
||||||
@@ -64,6 +73,11 @@ var ball_split : int = 0 :
|
|||||||
set(x):
|
set(x):
|
||||||
ball_split = x
|
ball_split = x
|
||||||
_save()
|
_save()
|
||||||
|
|
||||||
|
var laser_autofire : int = 0 :
|
||||||
|
set(x):
|
||||||
|
laser_autofire = x
|
||||||
|
_save()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -75,17 +89,9 @@ func _ready() -> void:
|
|||||||
_loading = true
|
_loading = true
|
||||||
if FileAccess.file_exists("user://data.json"):
|
if FileAccess.file_exists("user://data.json"):
|
||||||
var data = JSON.parse_string(FileAccess.get_file_as_string("user://data.json"))
|
var data = JSON.parse_string(FileAccess.get_file_as_string("user://data.json"))
|
||||||
highscore = data.get("highscore", 0)
|
for s in _settings:
|
||||||
relative_mouse = data.get("relative_mouse", true)
|
if data.has(s):
|
||||||
music_volume = data.get("music_volume", AudioServer.get_bus_volume_db(1))
|
set(s, data.get(s))
|
||||||
effects_volume = data.get("effects_volume", AudioServer.get_bus_volume_db(2))
|
|
||||||
best_times = data.get("best_times", {})
|
|
||||||
upgrade_tokens = data.get("upgrade_tokens", 0)
|
|
||||||
effect_time = data.get("effect_time", 0)
|
|
||||||
laser_power = data.get("laser_power", 0)
|
|
||||||
extra_lives = data.get("extra_lives", 0)
|
|
||||||
powerup_percent = data.get("powerup_percent", 0)
|
|
||||||
ball_split = data.get("ball_split", 0)
|
|
||||||
else:
|
else:
|
||||||
highscore = 0
|
highscore = 0
|
||||||
relative_mouse = true
|
relative_mouse = true
|
||||||
@@ -98,25 +104,16 @@ func _ready() -> void:
|
|||||||
extra_lives = 0
|
extra_lives = 0
|
||||||
powerup_percent = 0
|
powerup_percent = 0
|
||||||
ball_split = 0
|
ball_split = 0
|
||||||
|
laser_autofire = 0
|
||||||
|
|
||||||
_loading = false
|
_loading = false
|
||||||
|
|
||||||
func _save() -> void:
|
func _save() -> void:
|
||||||
if _loading:
|
if _loading:
|
||||||
return
|
return
|
||||||
var data : Dictionary = {
|
var data : Dictionary = {}
|
||||||
"highscore": highscore,
|
for s in _settings:
|
||||||
"relative_mouse": relative_mouse,
|
data[s] = get(s)
|
||||||
"music_volume": music_volume,
|
|
||||||
"effects_volume": effects_volume,
|
|
||||||
"best_times": best_times,
|
|
||||||
"upgrade_tokens": upgrade_tokens,
|
|
||||||
"effect_time": effect_time,
|
|
||||||
"laser_power": laser_power,
|
|
||||||
"extra_lives": extra_lives,
|
|
||||||
"powerup_percent": powerup_percent,
|
|
||||||
"ball_split": ball_split
|
|
||||||
}
|
|
||||||
var f = FileAccess.open("user://data.json", FileAccess.WRITE)
|
var f = FileAccess.open("user://data.json", FileAccess.WRITE)
|
||||||
f.store_string(JSON.stringify(data))
|
f.store_string(JSON.stringify(data))
|
||||||
f.close()
|
f.close()
|
||||||
|
|||||||
12
Intro.tscn
12
Intro.tscn
@@ -18,15 +18,15 @@ point_count = 2
|
|||||||
[sub_resource type="Gradient" id="Gradient_431mb"]
|
[sub_resource type="Gradient" id="Gradient_431mb"]
|
||||||
colors = PackedColorArray(0, 0, 0, 0, 1, 1, 1, 1)
|
colors = PackedColorArray(0, 0, 0, 0, 1, 1, 1, 1)
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_4ciis"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_31oge"]
|
||||||
shader = ExtResource("3_eo4f3")
|
shader = ExtResource("3_eo4f3")
|
||||||
shader_parameter/rect_global_position = Vector2(0, 0)
|
shader_parameter/rect_global_position = Vector2(0.19822, 0.0308824)
|
||||||
shader_parameter/rect_size = Vector2(150, 25)
|
shader_parameter/rect_size = Vector2(150, 25)
|
||||||
shader_parameter/ColourTexture = ExtResource("4_v8i0c")
|
shader_parameter/ColourTexture = ExtResource("4_v8i0c")
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_5ug7r"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_dghtq"]
|
||||||
shader = ExtResource("3_eo4f3")
|
shader = ExtResource("3_eo4f3")
|
||||||
shader_parameter/rect_global_position = Vector2(0, 0)
|
shader_parameter/rect_global_position = Vector2(0.161003, 0.0735294)
|
||||||
shader_parameter/rect_size = Vector2(242, 25)
|
shader_parameter/rect_size = Vector2(242, 25)
|
||||||
shader_parameter/ColourTexture = ExtResource("4_v8i0c")
|
shader_parameter/ColourTexture = ExtResource("4_v8i0c")
|
||||||
|
|
||||||
@@ -68,7 +68,7 @@ size_flags_horizontal = 3
|
|||||||
theme = ExtResource("3_8d2ix")
|
theme = ExtResource("3_8d2ix")
|
||||||
|
|
||||||
[node name="ArkaLabel" type="Label" parent="VBoxContainer/HBoxContainer"]
|
[node name="ArkaLabel" type="Label" parent="VBoxContainer/HBoxContainer"]
|
||||||
material = SubResource("ShaderMaterial_4ciis")
|
material = SubResource("ShaderMaterial_31oge")
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
theme = ExtResource("3_8d2ix")
|
theme = ExtResource("3_8d2ix")
|
||||||
theme_type_variation = &"Arkanoid"
|
theme_type_variation = &"Arkanoid"
|
||||||
@@ -89,7 +89,7 @@ size_flags_horizontal = 3
|
|||||||
theme = ExtResource("3_8d2ix")
|
theme = ExtResource("3_8d2ix")
|
||||||
|
|
||||||
[node name="Revenge" type="Label" parent="VBoxContainer/HBoxContainer2"]
|
[node name="Revenge" type="Label" parent="VBoxContainer/HBoxContainer2"]
|
||||||
material = SubResource("ShaderMaterial_5ug7r")
|
material = SubResource("ShaderMaterial_dghtq")
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
theme = ExtResource("3_8d2ix")
|
theme = ExtResource("3_8d2ix")
|
||||||
theme_type_variation = &"Arkanoid"
|
theme_type_variation = &"Arkanoid"
|
||||||
|
|||||||
23
LoadPanel.gd
23
LoadPanel.gd
@@ -3,6 +3,8 @@ extends PanelContainer
|
|||||||
signal load_file(filename : String)
|
signal load_file(filename : String)
|
||||||
signal load_level(level_name : String)
|
signal load_level(level_name : String)
|
||||||
|
|
||||||
|
var MainTheme = preload("res://MainTheme.tres")
|
||||||
|
|
||||||
func update_level_list(unique : bool = false) -> void:
|
func update_level_list(unique : bool = false) -> void:
|
||||||
|
|
||||||
var list : Array[String] = []
|
var list : Array[String] = []
|
||||||
@@ -12,12 +14,21 @@ func update_level_list(unique : bool = false) -> void:
|
|||||||
for k in vb.get_children():
|
for k in vb.get_children():
|
||||||
vb.remove_child(k)
|
vb.remove_child(k)
|
||||||
k.queue_free()
|
k.queue_free()
|
||||||
|
|
||||||
|
if DirAccess.dir_exists_absolute("user://Levels"):
|
||||||
|
var lb = Label.new();
|
||||||
|
lb.theme = MainTheme
|
||||||
|
lb.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||||
|
lb.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||||
|
lb.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||||
|
lb.text = "User Levels"
|
||||||
|
vb.add_child(lb)
|
||||||
|
|
||||||
for file in DirAccess.get_files_at("user://Levels"):
|
for file in DirAccess.get_files_at("user://Levels"):
|
||||||
if file.ends_with(".json"):
|
if file.ends_with(".json"):
|
||||||
var data = JSON.parse_string(FileAccess.get_file_as_string("user://Levels/%s" % file))
|
var data = JSON.parse_string(FileAccess.get_file_as_string("user://Levels/%s" % file))
|
||||||
var b = Button.new()
|
var b = Button.new()
|
||||||
b.theme = load("res://MainTheme.tres")
|
b.theme = MainTheme
|
||||||
b.text = data.name
|
b.text = data.name
|
||||||
b.theme_type_variation = "UserFile"
|
b.theme_type_variation = "UserFile"
|
||||||
b.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
b.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||||
@@ -27,6 +38,16 @@ func update_level_list(unique : bool = false) -> void:
|
|||||||
b.icon = load("res://Icons/User.png")
|
b.icon = load("res://Icons/User.png")
|
||||||
vb.add_child(b)
|
vb.add_child(b)
|
||||||
list.push_back(data.name)
|
list.push_back(data.name)
|
||||||
|
|
||||||
|
var l = Label.new();
|
||||||
|
l.theme = MainTheme
|
||||||
|
l.text = "Internal Levels"
|
||||||
|
l.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||||
|
l.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||||
|
l.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||||
|
vb.add_child(l)
|
||||||
|
|
||||||
|
|
||||||
for file in DirAccess.get_files_at("res://Levels"):
|
for file in DirAccess.get_files_at("res://Levels"):
|
||||||
if file.ends_with(".json"):
|
if file.ends_with(".json"):
|
||||||
var data = JSON.parse_string(FileAccess.get_file_as_string("res://Levels/%s" % file))
|
var data = JSON.parse_string(FileAccess.get_file_as_string("res://Levels/%s" % file))
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[gd_resource type="Theme" load_steps=17 format=3 uid="uid://cfvww0geatnnk"]
|
[gd_resource type="Theme" load_steps=18 format=3 uid="uid://cfvww0geatnnk"]
|
||||||
|
|
||||||
[ext_resource type="FontFile" uid="uid://dfkm2dibf0c3b" path="res://Fonts/fonts-DSEG_v046/DSEG7-Classic-MINI/DSEG7ClassicMini-Italic.ttf" id="1_17to7"]
|
[ext_resource type="FontFile" uid="uid://dfkm2dibf0c3b" path="res://Fonts/fonts-DSEG_v046/DSEG7-Classic-MINI/DSEG7ClassicMini-Italic.ttf" id="1_17to7"]
|
||||||
[ext_resource type="FontFile" uid="uid://bx41ej4o03nbx" path="res://Fonts/arkanoid/Arka_solid.ttf" id="1_s07ae"]
|
[ext_resource type="FontFile" uid="uid://bx41ej4o03nbx" path="res://Fonts/arkanoid/Arka_solid.ttf" id="1_s07ae"]
|
||||||
@@ -110,6 +110,8 @@ bg_color = Color(0, 0, 0, 0)
|
|||||||
shadow_color = Color(0, 0, 0, 0.439216)
|
shadow_color = Color(0, 0, 0, 0.439216)
|
||||||
shadow_size = 25
|
shadow_size = 25
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_6g8gs"]
|
||||||
|
|
||||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_m7r63"]
|
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_m7r63"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
@@ -171,6 +173,8 @@ Upgrade/base_type = &"Label"
|
|||||||
Upgrade/colors/font_color = Color(0, 0, 0, 1)
|
Upgrade/colors/font_color = Color(0, 0, 0, 1)
|
||||||
Upgrade/font_sizes/font_size = 9
|
Upgrade/font_sizes/font_size = 9
|
||||||
Upgrade/fonts/font = ExtResource("4_btndm")
|
Upgrade/fonts/font = ExtResource("4_btndm")
|
||||||
|
UpgradeContainer/base_type = &"PanelContainer"
|
||||||
|
UpgradeContainer/styles/panel = SubResource("StyleBoxEmpty_6g8gs")
|
||||||
UpgradePanel/base_type = &"VBoxContainer"
|
UpgradePanel/base_type = &"VBoxContainer"
|
||||||
UpgradePanel/constants/separation = 0
|
UpgradePanel/constants/separation = 0
|
||||||
UserFile/base_type = &"Button"
|
UserFile/base_type = &"Button"
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ class_name PermUpgrade
|
|||||||
@export var Name : String = ""
|
@export var Name : String = ""
|
||||||
@export var GlobalVariable : String = ""
|
@export var GlobalVariable : String = ""
|
||||||
@export var BaseCost : int = 10
|
@export var BaseCost : int = 10
|
||||||
|
@export var Description : String = ""
|
||||||
|
|
||||||
|
signal mouse_enter(description : String)
|
||||||
|
signal mouse_leave()
|
||||||
|
|
||||||
@onready var Level1 = $Container/Level1
|
@onready var Level1 = $Container/Level1
|
||||||
@onready var Level2 = $Container/Level2
|
@onready var Level2 = $Container/Level2
|
||||||
@@ -72,3 +76,9 @@ func _on_cost_pressed() -> void:
|
|||||||
|
|
||||||
func _on_upgrade_tokens_updated(qty : int) -> void:
|
func _on_upgrade_tokens_updated(qty : int) -> void:
|
||||||
update()
|
update()
|
||||||
|
|
||||||
|
func _on_mouse_entered() -> void:
|
||||||
|
mouse_enter.emit(Description)
|
||||||
|
|
||||||
|
func _on_mouse_exited() -> void:
|
||||||
|
mouse_leave.emit()
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
[node name="PermUpgrade" type="PanelContainer"]
|
[node name="PermUpgrade" type="PanelContainer"]
|
||||||
offset_right = 128.0
|
offset_right = 128.0
|
||||||
offset_bottom = 26.0
|
offset_bottom = 26.0
|
||||||
|
theme = ExtResource("2_ie5gk")
|
||||||
|
theme_type_variation = &"UpgradeContainer"
|
||||||
script = ExtResource("1_g7x2d")
|
script = ExtResource("1_g7x2d")
|
||||||
|
|
||||||
[node name="Container" type="VBoxContainer" parent="."]
|
[node name="Container" type="VBoxContainer" parent="."]
|
||||||
@@ -80,4 +82,6 @@ layout_mode = 2
|
|||||||
theme = ExtResource("2_ie5gk")
|
theme = ExtResource("2_ie5gk")
|
||||||
text = "10"
|
text = "10"
|
||||||
|
|
||||||
|
[connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"]
|
||||||
|
[connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"]
|
||||||
[connection signal="pressed" from="Container/Cost" to="." method="_on_cost_pressed"]
|
[connection signal="pressed" from="Container/Cost" to="." method="_on_cost_pressed"]
|
||||||
|
|||||||
@@ -24,19 +24,27 @@ func _on_timeout() -> void:
|
|||||||
print(Time.get_ticks_msec())
|
print(Time.get_ticks_msec())
|
||||||
|
|
||||||
func _on_pause() -> void:
|
func _on_pause() -> void:
|
||||||
|
if paused:
|
||||||
|
return
|
||||||
paused = true
|
paused = true
|
||||||
pause_time = Time.get_ticks_msec()
|
pause_time = Time.get_ticks_msec()
|
||||||
|
|
||||||
func pause() -> void:
|
func pause() -> void:
|
||||||
|
if paused:
|
||||||
|
return
|
||||||
paused = true
|
paused = true
|
||||||
pause_time = Time.get_ticks_msec()
|
pause_time = Time.get_ticks_msec()
|
||||||
|
|
||||||
func unpause() -> void:
|
func unpause() -> void:
|
||||||
|
if not paused:
|
||||||
|
return
|
||||||
paused = false
|
paused = false
|
||||||
var elapsed = Time.get_ticks_msec() - pause_time
|
var elapsed = Time.get_ticks_msec() - pause_time
|
||||||
accumulated_pause_time += elapsed
|
accumulated_pause_time += elapsed
|
||||||
|
|
||||||
func _on_unpause() -> void:
|
func _on_unpause() -> void:
|
||||||
|
if not paused:
|
||||||
|
return
|
||||||
paused = false
|
paused = false
|
||||||
var elapsed = Time.get_ticks_msec() - pause_time
|
var elapsed = Time.get_ticks_msec() - pause_time
|
||||||
accumulated_pause_time += elapsed
|
accumulated_pause_time += elapsed
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
extends Node2D
|
extends Node2D
|
||||||
|
|
||||||
@onready var Tokens = $VBoxContainer/Tokens/Label
|
@onready var Tokens = $VBoxContainer/Tokens/Label
|
||||||
|
@onready var Description = $VBoxContainer/Description
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
EventBus.upgrade_tokens_updated.connect(_on_upgrade_tokens_updated)
|
EventBus.upgrade_tokens_updated.connect(_on_upgrade_tokens_updated)
|
||||||
@@ -11,3 +12,10 @@ func _on_exit_pressed() -> void:
|
|||||||
|
|
||||||
func _on_upgrade_tokens_updated(qty : int) -> void:
|
func _on_upgrade_tokens_updated(qty : int) -> void:
|
||||||
Tokens.text = "%d" % qty
|
Tokens.text = "%d" % qty
|
||||||
|
|
||||||
|
|
||||||
|
func _show_description(description: String) -> void:
|
||||||
|
Description.text = description
|
||||||
|
|
||||||
|
func _hide_description() -> void:
|
||||||
|
Description.text = ""
|
||||||
|
|||||||
@@ -1,13 +1,48 @@
|
|||||||
[gd_scene load_steps=5 format=3 uid="uid://bfibb6fr6rox7"]
|
[gd_scene load_steps=11 format=3 uid="uid://bfibb6fr6rox7"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://Upgrades.gd" id="1_ouypj"]
|
[ext_resource type="Script" path="res://Upgrades.gd" id="1_ouypj"]
|
||||||
[ext_resource type="Theme" uid="uid://cfvww0geatnnk" path="res://MainTheme.tres" id="1_rv7oa"]
|
[ext_resource type="Theme" uid="uid://cfvww0geatnnk" path="res://MainTheme.tres" id="1_rv7oa"]
|
||||||
[ext_resource type="SpriteFrames" uid="uid://c6wwkgmwfpdu7" path="res://Coin/Coin.tres" id="2_woppf"]
|
[ext_resource type="SpriteFrames" uid="uid://c6wwkgmwfpdu7" path="res://Coin/Coin.tres" id="2_woppf"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bdhok2nkoirl0" path="res://PermUpgrade/PermUpgrade.tscn" id="4_rlh0r"]
|
[ext_resource type="PackedScene" uid="uid://bdhok2nkoirl0" path="res://PermUpgrade/PermUpgrade.tscn" id="4_rlh0r"]
|
||||||
|
[ext_resource type="Shader" path="res://Arkanoid.gdshader" id="4_waenw"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://b56kjbt4ub52n" path="res://NoidTex.png" id="5_y0x1p"]
|
||||||
|
[ext_resource type="Script" path="res://ArkaLabel.gd" id="6_ducwl"]
|
||||||
|
|
||||||
|
[sub_resource type="Curve" id="Curve_nh5xf"]
|
||||||
|
min_value = -200.0
|
||||||
|
max_value = 200.0
|
||||||
|
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 200), 0.0, 0.0, 0, 0]
|
||||||
|
point_count = 2
|
||||||
|
|
||||||
|
[sub_resource type="Gradient" id="Gradient_ucorl"]
|
||||||
|
colors = PackedColorArray(0, 0, 0, 0, 1, 1, 1, 1)
|
||||||
|
|
||||||
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_1rhte"]
|
||||||
|
shader = ExtResource("4_waenw")
|
||||||
|
shader_parameter/rect_global_position = Vector2(0.012945, 0.0794118)
|
||||||
|
shader_parameter/rect_size = Vector2(608, 25)
|
||||||
|
shader_parameter/ColourTexture = ExtResource("5_y0x1p")
|
||||||
|
|
||||||
[node name="Upgrades" type="Node2D"]
|
[node name="Upgrades" type="Node2D"]
|
||||||
script = ExtResource("1_ouypj")
|
script = ExtResource("1_ouypj")
|
||||||
|
|
||||||
|
[node name="CPUParticles2D" type="CPUParticles2D" parent="."]
|
||||||
|
position = Vector2(320, 180)
|
||||||
|
amount = 250
|
||||||
|
lifetime = 0.1
|
||||||
|
speed_scale = 0.1
|
||||||
|
randomness = 1.0
|
||||||
|
direction = Vector2(0, 0)
|
||||||
|
spread = 180.0
|
||||||
|
gravity = Vector2(0, 0)
|
||||||
|
initial_velocity_min = 10.0
|
||||||
|
initial_velocity_max = 800.0
|
||||||
|
linear_accel_min = 100.0
|
||||||
|
linear_accel_max = 1000.0
|
||||||
|
linear_accel_curve = SubResource("Curve_nh5xf")
|
||||||
|
color_ramp = SubResource("Gradient_ucorl")
|
||||||
|
hue_variation_max = 1.0
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||||
offset_left = 16.0
|
offset_left = 16.0
|
||||||
offset_top = 16.0
|
offset_top = 16.0
|
||||||
@@ -39,10 +74,16 @@ sprite_frames = ExtResource("2_woppf")
|
|||||||
autoplay = "default"
|
autoplay = "default"
|
||||||
centered = false
|
centered = false
|
||||||
|
|
||||||
[node name="VSeparator2" type="VSeparator" parent="VBoxContainer"]
|
[node name="ArkaLabel" type="Label" parent="VBoxContainer"]
|
||||||
|
material = SubResource("ShaderMaterial_1rhte")
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 6
|
||||||
theme = ExtResource("1_rv7oa")
|
theme = ExtResource("1_rv7oa")
|
||||||
|
theme_type_variation = &"Arkanoid"
|
||||||
|
text = "UPGRADES"
|
||||||
|
horizontal_alignment = 1
|
||||||
|
vertical_alignment = 1
|
||||||
|
script = ExtResource("6_ducwl")
|
||||||
|
|
||||||
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
|
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
|
||||||
custom_minimum_size = Vector2(0, 160)
|
custom_minimum_size = Vector2(0, 160)
|
||||||
@@ -63,6 +104,7 @@ theme = ExtResource("1_rv7oa")
|
|||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
Name = "Effect Time"
|
Name = "Effect Time"
|
||||||
GlobalVariable = "effect_time"
|
GlobalVariable = "effect_time"
|
||||||
|
Description = "Increases how long powerup effects last for"
|
||||||
|
|
||||||
[node name="HSeparator2" type="HSeparator" parent="VBoxContainer/ScrollContainer/HBoxContainer"]
|
[node name="HSeparator2" type="HSeparator" parent="VBoxContainer/ScrollContainer/HBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
@@ -73,6 +115,7 @@ theme = ExtResource("1_rv7oa")
|
|||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
Name = "Effect Chance"
|
Name = "Effect Chance"
|
||||||
GlobalVariable = "powerup_percent"
|
GlobalVariable = "powerup_percent"
|
||||||
|
Description = "Increases the chance that a powerup will drop when a block is destroyed"
|
||||||
|
|
||||||
[node name="HSeparator3" type="HSeparator" parent="VBoxContainer/ScrollContainer/HBoxContainer"]
|
[node name="HSeparator3" type="HSeparator" parent="VBoxContainer/ScrollContainer/HBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
@@ -83,6 +126,7 @@ theme = ExtResource("1_rv7oa")
|
|||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
Name = "Laser Power"
|
Name = "Laser Power"
|
||||||
GlobalVariable = "laser_power"
|
GlobalVariable = "laser_power"
|
||||||
|
Description = "Increase the amount of damage the lasers do"
|
||||||
|
|
||||||
[node name="HSeparator4" type="HSeparator" parent="VBoxContainer/ScrollContainer/HBoxContainer"]
|
[node name="HSeparator4" type="HSeparator" parent="VBoxContainer/ScrollContainer/HBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
@@ -93,6 +137,7 @@ theme = ExtResource("1_rv7oa")
|
|||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
Name = "Lives"
|
Name = "Lives"
|
||||||
GlobalVariable = "extra_lives"
|
GlobalVariable = "extra_lives"
|
||||||
|
Description = "More lives!"
|
||||||
|
|
||||||
[node name="HSeparator5" type="HSeparator" parent="VBoxContainer/ScrollContainer/HBoxContainer"]
|
[node name="HSeparator5" type="HSeparator" parent="VBoxContainer/ScrollContainer/HBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
@@ -103,16 +148,19 @@ theme = ExtResource("1_rv7oa")
|
|||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
Name = "Split"
|
Name = "Split"
|
||||||
GlobalVariable = "ball_split"
|
GlobalVariable = "ball_split"
|
||||||
|
Description = "How many balls the D powerup splits the ball into"
|
||||||
|
|
||||||
[node name="HSeparator6" type="HSeparator" parent="VBoxContainer/ScrollContainer/HBoxContainer"]
|
[node name="HSeparator6" type="HSeparator" parent="VBoxContainer/ScrollContainer/HBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
theme = ExtResource("1_rv7oa")
|
theme = ExtResource("1_rv7oa")
|
||||||
|
|
||||||
[node name="VSeparator" type="VSeparator" parent="VBoxContainer"]
|
[node name="Description" type="Label" parent="VBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
theme = ExtResource("1_rv7oa")
|
theme = ExtResource("1_rv7oa")
|
||||||
|
horizontal_alignment = 1
|
||||||
|
vertical_alignment = 1
|
||||||
|
|
||||||
[node name="Exit" type="HBoxContainer" parent="VBoxContainer"]
|
[node name="Exit" type="HBoxContainer" parent="VBoxContainer"]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
@@ -127,4 +175,14 @@ layout_mode = 2
|
|||||||
theme = ExtResource("1_rv7oa")
|
theme = ExtResource("1_rv7oa")
|
||||||
text = "EXIT"
|
text = "EXIT"
|
||||||
|
|
||||||
|
[connection signal="mouse_enter" from="VBoxContainer/ScrollContainer/HBoxContainer/EffectTime" to="." method="_show_description"]
|
||||||
|
[connection signal="mouse_leave" from="VBoxContainer/ScrollContainer/HBoxContainer/EffectTime" to="." method="_hide_description"]
|
||||||
|
[connection signal="mouse_enter" from="VBoxContainer/ScrollContainer/HBoxContainer/EffectChance" to="." method="_show_description"]
|
||||||
|
[connection signal="mouse_leave" from="VBoxContainer/ScrollContainer/HBoxContainer/EffectChance" to="." method="_hide_description"]
|
||||||
|
[connection signal="mouse_enter" from="VBoxContainer/ScrollContainer/HBoxContainer/LaserPower" to="." method="_show_description"]
|
||||||
|
[connection signal="mouse_leave" from="VBoxContainer/ScrollContainer/HBoxContainer/LaserPower" to="." method="_hide_description"]
|
||||||
|
[connection signal="mouse_enter" from="VBoxContainer/ScrollContainer/HBoxContainer/Lives" to="." method="_show_description"]
|
||||||
|
[connection signal="mouse_leave" from="VBoxContainer/ScrollContainer/HBoxContainer/Lives" to="." method="_hide_description"]
|
||||||
|
[connection signal="mouse_enter" from="VBoxContainer/ScrollContainer/HBoxContainer/Split" to="." method="_show_description"]
|
||||||
|
[connection signal="mouse_leave" from="VBoxContainer/ScrollContainer/HBoxContainer/Split" to="." method="_hide_description"]
|
||||||
[connection signal="pressed" from="VBoxContainer/Exit/Exit" to="." method="_on_exit_pressed"]
|
[connection signal="pressed" from="VBoxContainer/Exit/Exit" to="." method="_on_exit_pressed"]
|
||||||
|
|||||||
Reference in New Issue
Block a user