Added vanity card and cached scenes
This commit is contained in:
@@ -103,7 +103,7 @@ func _process(delta : float) -> void:
|
||||
PaddleNode.global_position.x += (delta * leave_direction * 20.0)
|
||||
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")
|
||||
get_tree().change_scene_to_packed(Scenes.MainMenu)
|
||||
return
|
||||
if opened:
|
||||
PipesNode.close_door(Pipes.BOTTOM_LEFT)
|
||||
@@ -311,7 +311,7 @@ func _on_hit_floor(ball, _power) -> void:
|
||||
Music.jingle(Music.JINGLE_LEVEL_START)
|
||||
|
||||
func _go_to_game_over() -> void:
|
||||
get_tree().change_scene_to_file("res://GameOver.tscn")
|
||||
get_tree().change_scene_to_packed(Scenes.GameOver)
|
||||
|
||||
func _on_round_won_finished() -> void:
|
||||
pass
|
||||
|
||||
@@ -34,4 +34,4 @@ func _wait_load_intro() -> void:
|
||||
get_tree().create_timer(3).timeout.connect(_load_intro)
|
||||
|
||||
func _load_intro() -> void:
|
||||
get_tree().change_scene_to_file("res://Intro.tscn")
|
||||
get_tree().change_scene_to_packed(Scenes.MainMenu)
|
||||
|
||||
@@ -9,16 +9,16 @@
|
||||
[ext_resource type="Script" path="res://ScrollText.gd" id="6_y6ajf"]
|
||||
[ext_resource type="Texture2D" uid="uid://c6nwmsoi1gjvv" path="res://FadeTex.png" id="7_wpqjt"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_31xkm"]
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_cfw8i"]
|
||||
shader = ExtResource("3_u76hk")
|
||||
shader_parameter/rect_global_position = Vector2(0, 0)
|
||||
shader_parameter/rect_size = Vector2(160, 25)
|
||||
shader_parameter/rect_global_position = Vector2(0, 0.0998668)
|
||||
shader_parameter/rect_size = Vector2(640, 25)
|
||||
shader_parameter/ColourTexture = ExtResource("4_lxs2b")
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_fxm16"]
|
||||
shader = ExtResource("6_t71ub")
|
||||
shader_parameter/rect_global_position = Vector2(0, 0)
|
||||
shader_parameter/rect_size = Vector2(0, 0)
|
||||
shader_parameter/rect_global_position = Vector2(0.173139, 0.284953)
|
||||
shader_parameter/rect_size = Vector2(4.09709, 2.26897)
|
||||
shader_parameter/ColourTexture = ExtResource("7_wpqjt")
|
||||
|
||||
[node name="GameOver" type="Node2D"]
|
||||
@@ -35,7 +35,7 @@ size_flags_vertical = 3
|
||||
theme = ExtResource("3_km2fx")
|
||||
|
||||
[node name="GameOver" type="Label" parent="VBoxContainer"]
|
||||
material = SubResource("ShaderMaterial_31xkm")
|
||||
material = SubResource("ShaderMaterial_cfw8i")
|
||||
layout_mode = 2
|
||||
theme = ExtResource("3_km2fx")
|
||||
theme_type_variation = &"Arkanoid"
|
||||
@@ -98,7 +98,7 @@ script = ExtResource("6_y6ajf")
|
||||
disable_3d = true
|
||||
transparent_bg = true
|
||||
handle_input_locally = false
|
||||
size = Vector2i(2, 2)
|
||||
size = Vector2i(211, 71)
|
||||
render_target_update_mode = 4
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/HBoxContainer2/SubViewportContainer/SubViewport"]
|
||||
|
||||
@@ -90,12 +90,14 @@ var Bricks : Dictionary = {
|
||||
}
|
||||
|
||||
var start_level : String = "DUNKANOID"
|
||||
var _loading : bool = false
|
||||
var _loading : bool = true
|
||||
|
||||
var MainTheme = preload("res://MainTheme.tres")
|
||||
|
||||
func _ready() -> void:
|
||||
_loading = true
|
||||
pass
|
||||
|
||||
func initialize() -> void:
|
||||
load_backgrounds()
|
||||
if FileAccess.file_exists("user://data.json"):
|
||||
var data = JSON.parse_string(FileAccess.get_file_as_string("user://data.json"))
|
||||
|
||||
BIN
Icons/MT.png
Executable file
BIN
Icons/MT.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
34
Icons/MT.png.import
Normal file
34
Icons/MT.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dj73jh272cf4g"
|
||||
path="res://.godot/imported/MT.png-13baf105f2bfb5f650af51afd324397b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Icons/MT.png"
|
||||
dest_files=["res://.godot/imported/MT.png-13baf105f2bfb5f650af51afd324397b.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
8
Intro.gd
8
Intro.gd
@@ -62,10 +62,10 @@ func _on_update_highscore(score : int) -> void:
|
||||
|
||||
|
||||
func _on_settings_pressed() -> void:
|
||||
get_tree().change_scene_to_file("res://Settings.tscn")
|
||||
get_tree().change_scene_to_packed(Scenes.Settings)
|
||||
|
||||
func _on_editor_pressed() -> void:
|
||||
get_tree().change_scene_to_file("res://LevelEditor.tscn")
|
||||
get_tree().change_scene_to_packed(Scenes.LevelEditor)
|
||||
|
||||
|
||||
func _on_exit_pressed() -> void:
|
||||
@@ -90,7 +90,7 @@ func _on_load_panel_load_level(level_name: String) -> void:
|
||||
tween.finished.connect(_start_game)
|
||||
|
||||
func _start_game() -> void:
|
||||
get_tree().change_scene_to_file("res://Dunkanoid.tscn")
|
||||
get_tree().change_scene_to_packed(Scenes.Game)
|
||||
|
||||
func _on_button_pressed() -> void:
|
||||
Music.fade_down(1)
|
||||
@@ -100,4 +100,4 @@ func _on_button_pressed() -> void:
|
||||
tween.finished.connect(_start_game)
|
||||
|
||||
func _on_upgrades_pressed() -> void:
|
||||
get_tree().change_scene_to_file("res://Upgrades.tscn")
|
||||
get_tree().change_scene_to_packed(Scenes.Upgrades)
|
||||
|
||||
15
Intro.tscn
15
Intro.tscn
@@ -23,21 +23,21 @@ point_count = 2
|
||||
[sub_resource type="Gradient" id="Gradient_431mb"]
|
||||
colors = PackedColorArray(0, 0, 0, 0, 1, 1, 1, 1)
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_24rds"]
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_6q8nl"]
|
||||
shader = ExtResource("3_eo4f3")
|
||||
shader_parameter/rect_global_position = Vector2(122.5, 27.5)
|
||||
shader_parameter/rect_global_position = Vector2(0.19822, 0.0732357)
|
||||
shader_parameter/rect_size = Vector2(150, 25)
|
||||
shader_parameter/ColourTexture = ExtResource("4_v8i0c")
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_jnx1u"]
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ogji8"]
|
||||
shader = ExtResource("3_eo4f3")
|
||||
shader_parameter/rect_global_position = Vector2(99.5, 42)
|
||||
shader_parameter/rect_global_position = Vector2(0.161003, 0.111851)
|
||||
shader_parameter/rect_size = Vector2(242, 25)
|
||||
shader_parameter/ColourTexture = ExtResource("4_v8i0c")
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_s1jgx"]
|
||||
shader = ExtResource("11_p7bee")
|
||||
shader_parameter/rect_global_position = Vector2(205.5, 79)
|
||||
shader_parameter/rect_global_position = Vector2(0.332524, 0.210386)
|
||||
shader_parameter/rect_size = Vector2(2.369, 3.688)
|
||||
shader_parameter/ColourTexture = ExtResource("12_8ixec")
|
||||
|
||||
@@ -79,7 +79,7 @@ size_flags_horizontal = 3
|
||||
theme = ExtResource("3_8d2ix")
|
||||
|
||||
[node name="ArkaLabel" type="Label" parent="VBoxContainer/HBoxContainer"]
|
||||
material = SubResource("ShaderMaterial_24rds")
|
||||
material = SubResource("ShaderMaterial_6q8nl")
|
||||
layout_mode = 2
|
||||
theme = ExtResource("3_8d2ix")
|
||||
theme_type_variation = &"Arkanoid"
|
||||
@@ -100,7 +100,7 @@ size_flags_horizontal = 3
|
||||
theme = ExtResource("3_8d2ix")
|
||||
|
||||
[node name="Revenge" type="Label" parent="VBoxContainer/HBoxContainer2"]
|
||||
material = SubResource("ShaderMaterial_jnx1u")
|
||||
material = SubResource("ShaderMaterial_ogji8")
|
||||
layout_mode = 2
|
||||
theme = ExtResource("3_8d2ix")
|
||||
theme_type_variation = &"Arkanoid"
|
||||
@@ -371,7 +371,6 @@ horizontal_alignment = 1
|
||||
autowrap_mode = 3
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
visible = false
|
||||
offset_right = 640.0
|
||||
offset_bottom = 360.0
|
||||
mouse_filter = 2
|
||||
|
||||
@@ -42,7 +42,7 @@ func _on_save_pressed() -> void:
|
||||
|
||||
func _on_exit_pressed() -> void:
|
||||
Music.resume()
|
||||
get_tree().change_scene_to_file("res://Intro.tscn")
|
||||
get_tree().change_scene_to_packed(Scenes.MainMenu)
|
||||
|
||||
|
||||
|
||||
|
||||
14
Music.gd
14
Music.gd
@@ -6,7 +6,8 @@ var JinglePlayer : AudioStreamPlayer
|
||||
enum {
|
||||
MUSIC_INTRO,
|
||||
MUSIC_GAME,
|
||||
MUSIC_GAME_OVER
|
||||
MUSIC_GAME_OVER,
|
||||
MUSIC_NONE
|
||||
}
|
||||
|
||||
enum {
|
||||
@@ -17,7 +18,7 @@ enum {
|
||||
|
||||
signal jingle_finished(type : int)
|
||||
|
||||
var music : int = MUSIC_INTRO
|
||||
var music : int = MUSIC_NONE
|
||||
var pausepos : float = 0
|
||||
|
||||
var MP3 : Dictionary = {
|
||||
@@ -37,13 +38,16 @@ var jingle_number : int = 0
|
||||
var tween = null
|
||||
|
||||
func _ready() -> void:
|
||||
pass
|
||||
|
||||
func initialize() -> void:
|
||||
MusicPlayer = AudioStreamPlayer.new();
|
||||
MusicPlayer.bus = "Music"
|
||||
MusicPlayer.process_mode = Node.PROCESS_MODE_ALWAYS
|
||||
add_child(MusicPlayer)
|
||||
MusicPlayer.stream = MP3["Through The Crystal"]
|
||||
MusicPlayer.play()
|
||||
music = MUSIC_INTRO
|
||||
# MusicPlayer.stream = MP3["Through The Crystal"]
|
||||
# MusicPlayer.play()
|
||||
# music = MUSIC_INTRO
|
||||
|
||||
JinglePlayer = AudioStreamPlayer.new();
|
||||
JinglePlayer.bus = "Music"
|
||||
|
||||
@@ -28,4 +28,4 @@ func _process(_delta : float) -> void:
|
||||
func _on_quit_pressed() -> void:
|
||||
paused = false
|
||||
get_tree().paused = false
|
||||
get_tree().change_scene_to_file("res://Intro.tscn")
|
||||
get_tree().change_scene_to_packed(Scenes.MainMenu)
|
||||
|
||||
17
Scenes.gd
Normal file
17
Scenes.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
extends Node
|
||||
|
||||
var MainMenu : PackedScene
|
||||
var Settings : PackedScene
|
||||
var Upgrades : PackedScene
|
||||
var Game : PackedScene
|
||||
var LevelEditor : PackedScene
|
||||
var GameOver : PackedScene
|
||||
|
||||
func initialize() -> void:
|
||||
MainMenu = load("res://Intro.tscn")
|
||||
Settings = load("res://Settings.tscn")
|
||||
Upgrades = load("res://Upgrades.tscn")
|
||||
Game = load("res://Dunkanoid.tscn")
|
||||
LevelEditor = load("res://LevelEditor.tscn")
|
||||
GameOver = load("res://GameOver.tscn")
|
||||
|
||||
@@ -17,7 +17,7 @@ func _ready() -> void:
|
||||
|
||||
|
||||
func _on_exit_pressed() -> void:
|
||||
get_tree().change_scene_to_file("res://Intro.tscn")
|
||||
get_tree().change_scene_to_packed(Scenes.MainMenu)
|
||||
|
||||
|
||||
func _on_effects_volume_drag_ended(value_changed: bool) -> void:
|
||||
|
||||
BIN
Sounds/MajenkoJingle.wav
Normal file
BIN
Sounds/MajenkoJingle.wav
Normal file
Binary file not shown.
24
Sounds/MajenkoJingle.wav.import
Normal file
24
Sounds/MajenkoJingle.wav.import
Normal file
@@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://dy4ipod58pbms"
|
||||
path="res://.godot/imported/MajenkoJingle.wav-043efe22748c3674e5569b6052cef97e.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Sounds/MajenkoJingle.wav"
|
||||
dest_files=["res://.godot/imported/MajenkoJingle.wav-043efe22748c3674e5569b6052cef97e.sample"]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=false
|
||||
edit/normalize=false
|
||||
edit/loop_mode=0
|
||||
edit/loop_begin=0
|
||||
edit/loop_end=-1
|
||||
compress/mode=0
|
||||
@@ -8,7 +8,7 @@ func _ready() -> void:
|
||||
Tokens.text = "%d" % Global.upgrade_tokens
|
||||
|
||||
func _on_exit_pressed() -> void:
|
||||
get_tree().change_scene_to_file("res://Intro.tscn")
|
||||
get_tree().change_scene_to_packed(Scenes.MainMenu)
|
||||
|
||||
func _on_upgrade_tokens_updated(qty : int) -> void:
|
||||
Tokens.text = "%d" % qty
|
||||
|
||||
@@ -18,9 +18,9 @@ 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_ax5sh"]
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_n2kwo"]
|
||||
shader = ExtResource("4_waenw")
|
||||
shader_parameter/rect_global_position = Vector2(8, 17.5)
|
||||
shader_parameter/rect_global_position = Vector2(0.012945, 0.0466045)
|
||||
shader_parameter/rect_size = Vector2(608, 25)
|
||||
shader_parameter/ColourTexture = ExtResource("5_y0x1p")
|
||||
|
||||
@@ -76,7 +76,7 @@ autoplay = "default"
|
||||
centered = false
|
||||
|
||||
[node name="ArkaLabel" type="Label" parent="VBoxContainer"]
|
||||
material = SubResource("ShaderMaterial_ax5sh")
|
||||
material = SubResource("ShaderMaterial_n2kwo")
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 6
|
||||
theme = ExtResource("1_rv7oa")
|
||||
|
||||
17
VanityCard.gd
Normal file
17
VanityCard.gd
Normal file
@@ -0,0 +1,17 @@
|
||||
extends Node2D
|
||||
|
||||
func _ready() -> void:
|
||||
$AudioStreamPlayer.play()
|
||||
var tween = create_tween()
|
||||
tween.tween_property(self, "modulate", Color(1, 1, 1, 1), 1)
|
||||
Global.initialize()
|
||||
Music.initialize()
|
||||
Scenes.initialize()
|
||||
|
||||
func _on_audio_stream_player_finished() -> void:
|
||||
var tween = create_tween()
|
||||
tween.tween_property(self, "modulate", Color(1, 1, 1, 0), 1)
|
||||
tween.finished.connect(_load_game)
|
||||
|
||||
func _load_game() -> void:
|
||||
get_tree().change_scene_to_packed(Scenes.MainMenu)
|
||||
39
VanityCard.tscn
Normal file
39
VanityCard.tscn
Normal file
@@ -0,0 +1,39 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://00yq7qqkj6fa"]
|
||||
|
||||
[ext_resource type="Script" path="res://VanityCard.gd" id="1_a0et3"]
|
||||
[ext_resource type="AudioStream" uid="uid://dy4ipod58pbms" path="res://Sounds/MajenkoJingle.wav" id="1_af4dy"]
|
||||
[ext_resource type="Texture2D" uid="uid://dj73jh272cf4g" path="res://Icons/MT.png" id="2_rqk0g"]
|
||||
[ext_resource type="Theme" uid="uid://cfvww0geatnnk" path="res://MainTheme.tres" id="3_qirw7"]
|
||||
|
||||
[node name="VanityCard" type="Node2D"]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
texture_filter = 1
|
||||
script = ExtResource("1_a0et3")
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("1_af4dy")
|
||||
|
||||
[node name="Mt" type="Sprite2D" parent="."]
|
||||
position = Vector2(320, 149)
|
||||
scale = Vector2(0.424528, 0.424528)
|
||||
texture = ExtResource("2_rqk0g")
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
offset_top = 172.0
|
||||
offset_right = 640.0
|
||||
offset_bottom = 195.0
|
||||
theme = ExtResource("3_qirw7")
|
||||
text = "MAJENKO TECHNOLOGIES"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Label2" type="Label" parent="."]
|
||||
offset_top = 195.0
|
||||
offset_right = 640.0
|
||||
offset_bottom = 218.0
|
||||
theme = ExtResource("3_qirw7")
|
||||
text = "majenko.co.uk"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[connection signal="finished" from="AudioStreamPlayer" to="." method="_on_audio_stream_player_finished"]
|
||||
@@ -11,8 +11,8 @@ config_version=5
|
||||
[application]
|
||||
|
||||
config/name="Dunkanoid"
|
||||
config/version="1.0.4"
|
||||
run/main_scene="res://Intro.tscn"
|
||||
config/version="1.1.0"
|
||||
run/main_scene="res://VanityCard.tscn"
|
||||
config/features=PackedStringArray("4.2", "Forward Plus")
|
||||
run/max_fps=30
|
||||
boot_splash/show_image=false
|
||||
@@ -25,6 +25,7 @@ config/windows_native_icon="res://icon.ico"
|
||||
Global="*res://Global.gd"
|
||||
EventBus="*res://EventBus.gd"
|
||||
Music="*res://Music.gd"
|
||||
Scenes="*res://Scenes.gd"
|
||||
|
||||
[display]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user