forked from team-sg/hero-mark-2
file select and file creation, menus glued together
This commit is contained in:
parent
13708b4046
commit
f7496c5e6f
18 changed files with 754 additions and 47 deletions
|
@ -2,17 +2,18 @@ extends CanvasLayer
|
||||||
|
|
||||||
signal fade_finished
|
signal fade_finished
|
||||||
|
|
||||||
func fade_in(time, reverse = false, color = Color.black):
|
func fade_in(time, reverse: bool = false, color: Color = Color.black) -> void:
|
||||||
var rect = $TextureRect
|
var rect = $TextureRect
|
||||||
rect.material.set_shader_param("color", color)
|
rect.material.set_shader_param("color", color)
|
||||||
rect.material.set_shader_param("reverse", reverse)
|
rect.material.set_shader_param("reverse", reverse)
|
||||||
$AnimationPlayer.play("FadeIn", -1, 1.0 / time)
|
$AnimationPlayer.play("FadeIn", -1, 1.0 / time)
|
||||||
|
|
||||||
func fade_out(time, reverse = false, color = Color.black):
|
func fade_out(time, reverse: bool = false, color: Color = Color.black) -> void:
|
||||||
var rect = $TextureRect
|
var rect = $TextureRect
|
||||||
rect.material.set_shader_param("color", color)
|
rect.material.set_shader_param("color", color)
|
||||||
rect.material.set_shader_param("reverse", reverse)
|
rect.material.set_shader_param("reverse", reverse)
|
||||||
$AnimationPlayer.play("FadeOut", -1, 1.0 / time)
|
$AnimationPlayer.play("FadeOut", -1, 1.0 / time)
|
||||||
|
|
||||||
func _fade_finished(anim_name):
|
|
||||||
|
func _fade_finished(anim_name) -> void:
|
||||||
emit_signal("fade_finished")
|
emit_signal("fade_finished")
|
||||||
|
|
|
@ -17,6 +17,8 @@ var transition_speed_secs setget , _get_transition_speed_sex
|
||||||
var master_volume = 1.0 setget _set_master_volume
|
var master_volume = 1.0 setget _set_master_volume
|
||||||
var music_volume = 1.0 setget _set_music_volume
|
var music_volume = 1.0 setget _set_music_volume
|
||||||
var sound_volume = 1.0 setget _set_sound_volume
|
var sound_volume = 1.0 setget _set_sound_volume
|
||||||
|
# last played file
|
||||||
|
var last_file: int = 0
|
||||||
|
|
||||||
# default values
|
# default values
|
||||||
var defaults = null
|
var defaults = null
|
||||||
|
@ -46,6 +48,8 @@ func load_options():
|
||||||
_set_master_volume(file.get_value("audio", "master_volume", 1.0))
|
_set_master_volume(file.get_value("audio", "master_volume", 1.0))
|
||||||
_set_music_volume(file.get_value("audio", "music_volume", 1.0))
|
_set_music_volume(file.get_value("audio", "music_volume", 1.0))
|
||||||
_set_sound_volume(file.get_value("audio", "sound_volume", 1.0))
|
_set_sound_volume(file.get_value("audio", "sound_volume", 1.0))
|
||||||
|
# last played file
|
||||||
|
last_file = file.get_value("save", "last_file", 0)
|
||||||
|
|
||||||
func save_options():
|
func save_options():
|
||||||
var file = ConfigFile.new()
|
var file = ConfigFile.new()
|
||||||
|
@ -59,6 +63,9 @@ func save_options():
|
||||||
file.set_value("audio","master_volume",master_volume)
|
file.set_value("audio","master_volume",master_volume)
|
||||||
file.set_value("audio","music_volume",music_volume)
|
file.set_value("audio","music_volume",music_volume)
|
||||||
file.set_value("audio","sound_volume",sound_volume)
|
file.set_value("audio","sound_volume",sound_volume)
|
||||||
|
# last played file
|
||||||
|
file.set_value("save", "last_file", last_file)
|
||||||
|
# save the options to file
|
||||||
file.save("user://options.pr")
|
file.save("user://options.pr")
|
||||||
|
|
||||||
# Setters
|
# Setters
|
||||||
|
|
|
@ -142,11 +142,15 @@ var current_file: SaveFile = null
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
# TODO: make load last played file
|
# TODO: make load last played file
|
||||||
current_file = load_file("user://file1.pr")
|
current_file = load_file("user://file%d.pr" % Options.last_file)
|
||||||
Game.difficulty = current_file.difficulty
|
if current_file:
|
||||||
|
Game.difficulty = current_file.difficulty
|
||||||
|
|
||||||
## shortcut for loading a save file from specific path
|
## shortcut for loading a save file from specific path
|
||||||
func load_file(path: String) -> SaveFile:
|
func load_file(path: String) -> SaveFile:
|
||||||
var file = SaveFile.new(path)
|
if File.new().file_exists(path):
|
||||||
file.load_from_file()
|
var file = SaveFile.new(path)
|
||||||
return file
|
file.load_from_file()
|
||||||
|
return file
|
||||||
|
else:
|
||||||
|
return null
|
||||||
|
|
BIN
graphics/hud/sg_tasting.png
Normal file
BIN
graphics/hud/sg_tasting.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2 KiB |
35
graphics/hud/sg_tasting.png.import
Normal file
35
graphics/hud/sg_tasting.png.import
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/sg_tasting.png-33c5875536743f0990f8d054dfbbfa21.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://graphics/hud/sg_tasting.png"
|
||||||
|
dest_files=[ "res://.import/sg_tasting.png-33c5875536743f0990f8d054dfbbfa21.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=false
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
BIN
graphics/tiles/abstract.png
Normal file
BIN
graphics/tiles/abstract.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
35
graphics/tiles/abstract.png.import
Normal file
35
graphics/tiles/abstract.png.import
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/abstract.png-520d62bcdeefefeb95738be4737e0f66.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://graphics/tiles/abstract.png"
|
||||||
|
dest_files=[ "res://.import/abstract.png-520d62bcdeefefeb95738be4737e0f66.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=false
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
58
menus/file_create.gd
Normal file
58
menus/file_create.gd
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
extends Node
|
||||||
|
|
||||||
|
|
||||||
|
var file: Save.SaveFile = null
|
||||||
|
var difficulty: int = Game.Difficulty.SPICY
|
||||||
|
|
||||||
|
onready var face: Sprite = $"%Face"
|
||||||
|
onready var chosen_name: Label = $"%ChosenName"
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
# escape to file select if no file is assigned
|
||||||
|
if not file:
|
||||||
|
yield(get_tree(), "idle_frame")
|
||||||
|
SceneManager.current_scene = load("res://menus/file_select.tscn").instance()
|
||||||
|
return
|
||||||
|
|
||||||
|
# pause so that player can not move around until difficulty chosen
|
||||||
|
get_tree().paused = true
|
||||||
|
# initialize name
|
||||||
|
chosen_name.text = ""
|
||||||
|
file.name = ""
|
||||||
|
# fade in
|
||||||
|
Fade.fade_in(0.4)
|
||||||
|
# focus the difficulty
|
||||||
|
$"%Spicy".call_deferred("grab_focus")
|
||||||
|
|
||||||
|
|
||||||
|
func _set_difficulty(value: int) -> void:
|
||||||
|
difficulty = posmod(value, 4)
|
||||||
|
file.difficulty = difficulty
|
||||||
|
face.frame = difficulty
|
||||||
|
|
||||||
|
|
||||||
|
func _difficulty_selected() -> void:
|
||||||
|
Fade.fade_out(0.4)
|
||||||
|
yield(Fade, "fade_finished")
|
||||||
|
$"%DifficultySelect".queue_free()
|
||||||
|
$"%NameEntry".visible = true
|
||||||
|
get_tree().paused = false
|
||||||
|
Game.use_lives = false
|
||||||
|
Fade.fade_in(0.4)
|
||||||
|
|
||||||
|
func _on_letter_chosen(letter: String) -> void:
|
||||||
|
file.name += letter
|
||||||
|
chosen_name.text = file.name
|
||||||
|
if file.name.length() > 0:
|
||||||
|
$"%ExitDoor".frame = 1
|
||||||
|
|
||||||
|
|
||||||
|
func _on_Exit_area_entered(area: Area2D) -> void:
|
||||||
|
if file.name.length() > 0:
|
||||||
|
get_tree().paused = true
|
||||||
|
file.save_to_file()
|
||||||
|
Fade.fade_out(0.4)
|
||||||
|
yield(Fade, "fade_finished")
|
||||||
|
get_tree().paused = false
|
||||||
|
SceneManager.current_scene = load("res://menus/file_select.tscn").instance()
|
331
menus/file_create.tscn
Normal file
331
menus/file_create.tscn
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,16 +1,15 @@
|
||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
|
|
||||||
# Declare member variables here. Examples:
|
export var next_scene: PackedScene
|
||||||
# var a = 2
|
|
||||||
# var b = "text"
|
|
||||||
|
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
func _ready() -> void:
|
||||||
func _ready():
|
Fade.fade_in(0.4)
|
||||||
pass # Replace with function body.
|
$SelectFile1.call_deferred("grab_focus")
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
func _on_file_loaded() -> void:
|
||||||
#func _process(delta):
|
Fade.fade_out(0.4)
|
||||||
# pass
|
yield(Fade, "fade_finished")
|
||||||
|
SceneManager.current_scene = next_scene.instance()
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
[gd_scene load_steps=8 format=2]
|
[gd_scene load_steps=9 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://menus/file_select_panel.tscn" type="PackedScene" id=1]
|
[ext_resource path="res://menus/file_select_panel.tscn" type="PackedScene" id=1]
|
||||||
|
[ext_resource path="res://menus/level_select_scholar.tscn" type="PackedScene" id=2]
|
||||||
[ext_resource path="res://graphics/borders/skaborder.png" type="Texture" id=8]
|
[ext_resource path="res://graphics/borders/skaborder.png" type="Texture" id=8]
|
||||||
[ext_resource path="res://graphics/hud/file_select_arrow.png" type="Texture" id=9]
|
[ext_resource path="res://graphics/hud/file_select_arrow.png" type="Texture" id=9]
|
||||||
[ext_resource path="res://menus/file_select.gd" type="Script" id=10]
|
[ext_resource path="res://menus/file_select.gd" type="Script" id=10]
|
||||||
|
@ -28,9 +29,9 @@ shader_param/uv_transform = Transform2D( 1, 1.582, 1, 2, 0, 0 )
|
||||||
|
|
||||||
[node name="FileSelect" type="Node"]
|
[node name="FileSelect" type="Node"]
|
||||||
script = ExtResource( 10 )
|
script = ExtResource( 10 )
|
||||||
|
next_scene = ExtResource( 2 )
|
||||||
|
|
||||||
[node name="TextureRect2" type="TextureRect" parent="."]
|
[node name="TextureRect2" type="TextureRect" parent="."]
|
||||||
visible = false
|
|
||||||
modulate = Color( 0, 0.109804, 1, 1 )
|
modulate = Color( 0, 0.109804, 1, 1 )
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
|
@ -53,48 +54,58 @@ margin_bottom = 192.0
|
||||||
margin_left = 12.0
|
margin_left = 12.0
|
||||||
margin_top = 64.0
|
margin_top = 64.0
|
||||||
margin_right = 84.0
|
margin_right = 84.0
|
||||||
margin_bottom = 128.0
|
margin_bottom = 136.0
|
||||||
|
|
||||||
[node name="Panel2" parent="." instance=ExtResource( 1 )]
|
[node name="Panel2" parent="." instance=ExtResource( 1 )]
|
||||||
margin_left = 92.0
|
margin_left = 92.0
|
||||||
margin_top = 64.0
|
margin_top = 64.0
|
||||||
margin_right = 164.0
|
margin_right = 164.0
|
||||||
margin_bottom = 128.0
|
margin_bottom = 136.0
|
||||||
number = 2
|
number = 2
|
||||||
|
|
||||||
[node name="Panel3" parent="." instance=ExtResource( 1 )]
|
[node name="Panel3" parent="." instance=ExtResource( 1 )]
|
||||||
margin_left = 172.0
|
margin_left = 172.0
|
||||||
margin_top = 64.0
|
margin_top = 64.0
|
||||||
margin_right = 244.0
|
margin_right = 244.0
|
||||||
margin_bottom = 128.0
|
margin_bottom = 136.0
|
||||||
number = 3
|
number = 3
|
||||||
|
|
||||||
[node name="SelectFile1" type="TextureButton" parent="."]
|
[node name="SelectFile1" type="TextureButton" parent="."]
|
||||||
margin_left = 12.0
|
margin_left = 12.0
|
||||||
margin_top = 130.0
|
margin_top = 138.0
|
||||||
margin_right = 84.0
|
margin_right = 84.0
|
||||||
margin_bottom = 138.0
|
margin_bottom = 146.0
|
||||||
texture_normal = ExtResource( 9 )
|
focus_neighbour_left = NodePath("../SelectFile3")
|
||||||
|
focus_neighbour_right = NodePath("../SelectFile2")
|
||||||
texture_focused = ExtResource( 9 )
|
texture_focused = ExtResource( 9 )
|
||||||
expand = true
|
expand = true
|
||||||
stretch_mode = 3
|
stretch_mode = 3
|
||||||
|
|
||||||
[node name="SelectFile2" type="TextureButton" parent="."]
|
[node name="SelectFile2" type="TextureButton" parent="."]
|
||||||
margin_left = 92.0
|
margin_left = 92.0
|
||||||
margin_top = 130.0
|
margin_top = 138.0
|
||||||
margin_right = 164.0
|
margin_right = 164.0
|
||||||
margin_bottom = 138.0
|
margin_bottom = 146.0
|
||||||
texture_normal = ExtResource( 9 )
|
focus_neighbour_left = NodePath("../SelectFile1")
|
||||||
|
focus_neighbour_right = NodePath("../SelectFile3")
|
||||||
texture_focused = ExtResource( 9 )
|
texture_focused = ExtResource( 9 )
|
||||||
expand = true
|
expand = true
|
||||||
stretch_mode = 3
|
stretch_mode = 3
|
||||||
|
|
||||||
[node name="SelectFile3" type="TextureButton" parent="."]
|
[node name="SelectFile3" type="TextureButton" parent="."]
|
||||||
margin_left = 172.0
|
margin_left = 172.0
|
||||||
margin_top = 130.0
|
margin_top = 138.0
|
||||||
margin_right = 244.0
|
margin_right = 244.0
|
||||||
margin_bottom = 138.0
|
margin_bottom = 146.0
|
||||||
texture_normal = ExtResource( 9 )
|
focus_neighbour_left = NodePath("../SelectFile2")
|
||||||
|
focus_neighbour_right = NodePath("../SelectFile1")
|
||||||
texture_focused = ExtResource( 9 )
|
texture_focused = ExtResource( 9 )
|
||||||
expand = true
|
expand = true
|
||||||
stretch_mode = 3
|
stretch_mode = 3
|
||||||
|
|
||||||
|
[connection signal="file_loaded" from="Panel" to="." method="_on_file_loaded"]
|
||||||
|
[connection signal="file_loaded" from="Panel2" to="." method="_on_file_loaded"]
|
||||||
|
[connection signal="file_loaded" from="Panel3" to="." method="_on_file_loaded"]
|
||||||
|
[connection signal="pressed" from="SelectFile1" to="Panel" method="select"]
|
||||||
|
[connection signal="pressed" from="SelectFile2" to="Panel2" method="select"]
|
||||||
|
[connection signal="pressed" from="SelectFile3" to="Panel3" method="select"]
|
||||||
|
|
|
@ -1,16 +1,48 @@
|
||||||
extends Panel
|
extends Panel
|
||||||
|
|
||||||
|
|
||||||
|
signal file_loaded()
|
||||||
|
|
||||||
|
const FileCreate = preload("res://menus/file_create.tscn")
|
||||||
|
|
||||||
export var number = 1
|
export var number = 1
|
||||||
|
|
||||||
var file: Save.SaveFile
|
var file: Save.SaveFile = null
|
||||||
|
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
|
$FileNumber.text = "FILE%d" % number
|
||||||
|
# check if the file exists
|
||||||
if File.new().file_exists("user://file%d.pr" % number):
|
if File.new().file_exists("user://file%d.pr" % number):
|
||||||
|
# load file and fill in information
|
||||||
file = Save.load_file("user://file%d.pr" % number)
|
file = Save.load_file("user://file%d.pr" % number)
|
||||||
$"%Name".text = file.name
|
$"%Name".text = file.name
|
||||||
$"%ShardCounter".text = "%02d" % file.get_total_shards()
|
$"%ShardCounter".text = "%02d" % file.get_total_shards()
|
||||||
$"%KeyCounter".text = "%03d" % file.get_total_keys()
|
$"%KeyCounter".text = "%03d" % file.get_total_keys()
|
||||||
|
$"%DeathCounter".text = "%04d" % file.get_total_deaths()
|
||||||
$"%TimeCounter".text = "%02d:%02d" % [file.play_time / 3600.0, fmod(file.play_time / 60.0, 60.0)]
|
$"%TimeCounter".text = "%02d:%02d" % [file.play_time / 3600.0, fmod(file.play_time / 60.0, 60.0)]
|
||||||
else:
|
else:
|
||||||
$FileExists.visible = false
|
$FileExists.visible = false
|
||||||
$FileDoesNotExist.visible = true
|
$FileDoesNotExist.visible = true
|
||||||
|
|
||||||
|
|
||||||
|
func select() -> void:
|
||||||
|
# if a file exists, load and play it!
|
||||||
|
if file:
|
||||||
|
# set current file and difficulty
|
||||||
|
Save.current_file = file
|
||||||
|
Game.difficulty = file.difficulty
|
||||||
|
# update last-played file for continue button
|
||||||
|
Options.last_file = number
|
||||||
|
Options.save_options()
|
||||||
|
# let file select scene know a file has been loaded
|
||||||
|
emit_signal("file_loaded")
|
||||||
|
# empty file, so go to file creation screen
|
||||||
|
else:
|
||||||
|
# wait for fade
|
||||||
|
Fade.fade_out(0.4)
|
||||||
|
yield(Fade, "fade_finished")
|
||||||
|
# create new file and give it to the file create screen
|
||||||
|
var file_create = FileCreate.instance()
|
||||||
|
file_create.file = Save.SaveFile.new("user://file%d.pr" % number)
|
||||||
|
SceneManager.current_scene = file_create
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=10 format=2]
|
[gd_scene load_steps=11 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://shaders/recolor_border.shader" type="Shader" id=1]
|
[ext_resource path="res://shaders/recolor_border.shader" type="Shader" id=1]
|
||||||
[ext_resource path="res://ui/2ndpuberty_outline.tres" type="Material" id=2]
|
[ext_resource path="res://ui/2ndpuberty_outline.tres" type="Material" id=2]
|
||||||
|
@ -6,6 +6,7 @@
|
||||||
[ext_resource path="res://ui/theme.tres" type="Theme" id=4]
|
[ext_resource path="res://ui/theme.tres" type="Theme" id=4]
|
||||||
[ext_resource path="res://objects/collectibles/shard.tscn" type="PackedScene" id=5]
|
[ext_resource path="res://objects/collectibles/shard.tscn" type="PackedScene" id=5]
|
||||||
[ext_resource path="res://menus/file_select_panel.gd" type="Script" id=6]
|
[ext_resource path="res://menus/file_select_panel.gd" type="Script" id=6]
|
||||||
|
[ext_resource path="res://graphics/hud/deaths_head.png" type="Texture" id=7]
|
||||||
[ext_resource path="res://graphics/player/sg_idle.png" type="Texture" id=8]
|
[ext_resource path="res://graphics/player/sg_idle.png" type="Texture" id=8]
|
||||||
[ext_resource path="res://graphics/player/palettes/default.png" type="Texture" id=9]
|
[ext_resource path="res://graphics/player/palettes/default.png" type="Texture" id=9]
|
||||||
|
|
||||||
|
@ -17,12 +18,9 @@ shader_param/palette = ExtResource( 9 )
|
||||||
|
|
||||||
[node name="Panel" type="Panel"]
|
[node name="Panel" type="Panel"]
|
||||||
margin_right = 72.0
|
margin_right = 72.0
|
||||||
margin_bottom = 64.0
|
margin_bottom = 72.0
|
||||||
theme = ExtResource( 4 )
|
theme = ExtResource( 4 )
|
||||||
script = ExtResource( 6 )
|
script = ExtResource( 6 )
|
||||||
__meta__ = {
|
|
||||||
"_edit_group_": true
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="FileNumber" type="Label" parent="."]
|
[node name="FileNumber" type="Label" parent="."]
|
||||||
material = ExtResource( 2 )
|
material = ExtResource( 2 )
|
||||||
|
@ -32,7 +30,9 @@ theme = ExtResource( 4 )
|
||||||
text = "file1"
|
text = "file1"
|
||||||
align = 1
|
align = 1
|
||||||
|
|
||||||
[node name="FileExists" type="Node2D" parent="."]
|
[node name="FileExists" type="Control" parent="."]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
|
||||||
[node name="Name" type="Label" parent="FileExists"]
|
[node name="Name" type="Label" parent="FileExists"]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
@ -46,12 +46,20 @@ align = 1
|
||||||
[node name="TimeCounter" type="Label" parent="FileExists"]
|
[node name="TimeCounter" type="Label" parent="FileExists"]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
margin_left = 3.0
|
margin_left = 3.0
|
||||||
margin_top = 50.0
|
margin_top = 58.0
|
||||||
margin_right = 69.0
|
margin_right = 69.0
|
||||||
margin_bottom = 60.0
|
margin_bottom = 68.0
|
||||||
text = "00:00"
|
text = "00:00"
|
||||||
align = 1
|
align = 1
|
||||||
|
|
||||||
|
[node name="DeathCounter" type="Label" parent="FileExists"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
margin_left = 25.0
|
||||||
|
margin_top = 47.0
|
||||||
|
margin_right = 56.0
|
||||||
|
margin_bottom = 57.0
|
||||||
|
text = "0000"
|
||||||
|
|
||||||
[node name="Palette" type="TextureRect" parent="FileExists"]
|
[node name="Palette" type="TextureRect" parent="FileExists"]
|
||||||
material = SubResource( 1 )
|
material = SubResource( 1 )
|
||||||
margin_left = 8.0
|
margin_left = 8.0
|
||||||
|
@ -83,7 +91,11 @@ position = Vector2( 32, 23 )
|
||||||
[node name="Key" parent="FileExists" instance=ExtResource( 3 )]
|
[node name="Key" parent="FileExists" instance=ExtResource( 3 )]
|
||||||
position = Vector2( 32, 34 )
|
position = Vector2( 32, 34 )
|
||||||
|
|
||||||
[node name="FileDoesNotExist" type="Node2D" parent="."]
|
[node name="DeathsHead" type="Sprite" parent="FileExists"]
|
||||||
|
position = Vector2( 21, 52 )
|
||||||
|
texture = ExtResource( 7 )
|
||||||
|
|
||||||
|
[node name="FileDoesNotExist" type="Control" parent="."]
|
||||||
visible = false
|
visible = false
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="FileDoesNotExist"]
|
[node name="Label" type="Label" parent="FileDoesNotExist"]
|
||||||
|
|
|
@ -3,10 +3,11 @@ extends Node
|
||||||
onready var continue_button = $Panel/Continue
|
onready var continue_button = $Panel/Continue
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
|
Fade.fade_in(0.4)
|
||||||
#Grey out continue if no save files
|
#Grey out continue if no save files
|
||||||
yield(get_tree(),"idle_frame")
|
yield(get_tree(),"idle_frame")
|
||||||
var file = File.new()
|
print(Save.current_file)
|
||||||
if file.file_exists("user://file1.pr") or file.file_exists("user://file2.pr") or file.file_exists("user://file3.pr"):
|
if Save.current_file:
|
||||||
$Panel/Continue.grab_focus()
|
$Panel/Continue.grab_focus()
|
||||||
else:
|
else:
|
||||||
$Panel/Body/GreyedContinue.visible = true
|
$Panel/Body/GreyedContinue.visible = true
|
||||||
|
@ -17,12 +18,18 @@ func _ready():
|
||||||
|
|
||||||
|
|
||||||
func _on_Continue_button_down():
|
func _on_Continue_button_down():
|
||||||
pass # Replace with function body.
|
Fade.fade_out(0.4)
|
||||||
|
yield(Fade, "fade_finished")
|
||||||
|
SceneManager.current_scene = load("res://menus/level_select_scholar.tscn").instance()
|
||||||
|
|
||||||
|
|
||||||
func _on_FileSelect_button_down():
|
func _on_FileSelect_button_down():
|
||||||
|
Fade.fade_out(0.4)
|
||||||
|
yield(Fade, "fade_finished")
|
||||||
SceneManager.current_scene = load("res://menus/file_select.tscn").instance()
|
SceneManager.current_scene = load("res://menus/file_select.tscn").instance()
|
||||||
|
|
||||||
|
|
||||||
func _on_Exit_button_down():
|
func _on_Exit_button_down():
|
||||||
|
Fade.fade_out(0.4)
|
||||||
|
yield(Fade, "fade_finished")
|
||||||
get_tree().quit()
|
get_tree().quit()
|
||||||
|
|
|
@ -135,7 +135,7 @@ margin_left = 8.0
|
||||||
margin_top = 9.0
|
margin_top = 9.0
|
||||||
margin_right = 16.0
|
margin_right = 16.0
|
||||||
margin_bottom = 17.0
|
margin_bottom = 17.0
|
||||||
focus_neighbour_top = NodePath("../Options")
|
focus_neighbour_top = NodePath("../Exit")
|
||||||
focus_neighbour_bottom = NodePath("../FileSelect")
|
focus_neighbour_bottom = NodePath("../FileSelect")
|
||||||
texture_focused = ExtResource( 4 )
|
texture_focused = ExtResource( 4 )
|
||||||
|
|
||||||
|
|
|
@ -4,4 +4,6 @@ export var next_menu: PackedScene
|
||||||
|
|
||||||
func _input(event):
|
func _input(event):
|
||||||
if Input.is_action_just_pressed("start"):
|
if Input.is_action_just_pressed("start"):
|
||||||
|
Fade.fade_out(0.4)
|
||||||
|
yield(Fade, "fade_finished")
|
||||||
SceneManager.current_scene = next_menu.instance()
|
SceneManager.current_scene = next_menu.instance()
|
||||||
|
|
|
@ -63,7 +63,7 @@ _global_script_class_icons={
|
||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Revolution 2083"
|
config/name="Revolution 2083"
|
||||||
run/main_scene="res://menus/level_select_scholar.tscn"
|
run/main_scene="res://menus/title_screen.tscn"
|
||||||
config/use_custom_user_dir=true
|
config/use_custom_user_dir=true
|
||||||
config/custom_user_dir_name="heromark2"
|
config/custom_user_dir_name="heromark2"
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.png"
|
||||||
|
@ -71,12 +71,12 @@ config/icon="res://icon.png"
|
||||||
[autoload]
|
[autoload]
|
||||||
|
|
||||||
Border="*res://autoloads/border.tscn"
|
Border="*res://autoloads/border.tscn"
|
||||||
|
Options="*res://autoloads/options.gd"
|
||||||
Save="*res://autoloads/save.gd"
|
Save="*res://autoloads/save.gd"
|
||||||
Game="*res://autoloads/game.gd"
|
Game="*res://autoloads/game.gd"
|
||||||
Audio="*res://autoloads/audio.tscn"
|
Audio="*res://autoloads/audio.tscn"
|
||||||
LevelData="*res://autoloads/level_data.tscn"
|
LevelData="*res://autoloads/level_data.tscn"
|
||||||
Debug="*res://autoloads/debug.tscn"
|
Debug="*res://autoloads/debug.tscn"
|
||||||
Options="*res://autoloads/options.gd"
|
|
||||||
TouchControls="*res://autoloads/touch_controls.tscn"
|
TouchControls="*res://autoloads/touch_controls.tscn"
|
||||||
SceneManager="*res://autoloads/scene_manager.tscn"
|
SceneManager="*res://autoloads/scene_manager.tscn"
|
||||||
Console="*res://autoloads/console.tscn"
|
Console="*res://autoloads/console.tscn"
|
||||||
|
|
173
tilesets/t_abstract.tres
Normal file
173
tilesets/t_abstract.tres
Normal file
|
@ -0,0 +1,173 @@
|
||||||
|
[gd_resource type="TileSet" load_steps=18 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://graphics/tiles/abstract.png" type="Texture" id=1]
|
||||||
|
|
||||||
|
[sub_resource type="ConvexPolygonShape2D" id=1]
|
||||||
|
points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
|
||||||
|
|
||||||
|
[sub_resource type="ConvexPolygonShape2D" id=2]
|
||||||
|
points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
|
||||||
|
|
||||||
|
[sub_resource type="ConvexPolygonShape2D" id=3]
|
||||||
|
points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
|
||||||
|
|
||||||
|
[sub_resource type="ConvexPolygonShape2D" id=4]
|
||||||
|
points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
|
||||||
|
|
||||||
|
[sub_resource type="ConvexPolygonShape2D" id=5]
|
||||||
|
points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
|
||||||
|
|
||||||
|
[sub_resource type="ConvexPolygonShape2D" id=6]
|
||||||
|
points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
|
||||||
|
|
||||||
|
[sub_resource type="ConvexPolygonShape2D" id=7]
|
||||||
|
points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
|
||||||
|
|
||||||
|
[sub_resource type="ConvexPolygonShape2D" id=8]
|
||||||
|
points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
|
||||||
|
|
||||||
|
[sub_resource type="ConvexPolygonShape2D" id=9]
|
||||||
|
points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
|
||||||
|
|
||||||
|
[sub_resource type="ConvexPolygonShape2D" id=10]
|
||||||
|
points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
|
||||||
|
|
||||||
|
[sub_resource type="ConvexPolygonShape2D" id=11]
|
||||||
|
points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
|
||||||
|
|
||||||
|
[sub_resource type="ConvexPolygonShape2D" id=12]
|
||||||
|
points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
|
||||||
|
|
||||||
|
[sub_resource type="ConvexPolygonShape2D" id=13]
|
||||||
|
points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
|
||||||
|
|
||||||
|
[sub_resource type="ConvexPolygonShape2D" id=14]
|
||||||
|
points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
|
||||||
|
|
||||||
|
[sub_resource type="ConvexPolygonShape2D" id=15]
|
||||||
|
points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
|
||||||
|
|
||||||
|
[sub_resource type="ConvexPolygonShape2D" id=16]
|
||||||
|
points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
0/name = "griddy"
|
||||||
|
0/texture = ExtResource( 1 )
|
||||||
|
0/tex_offset = Vector2( 0, 0 )
|
||||||
|
0/modulate = Color( 1, 1, 1, 1 )
|
||||||
|
0/region = Rect2( 0, 0, 32, 32 )
|
||||||
|
0/tile_mode = 1
|
||||||
|
0/autotile/bitmask_mode = 1
|
||||||
|
0/autotile/bitmask_flags = [ Vector2( 0, 0 ), 144, Vector2( 0, 1 ), 146, Vector2( 0, 2 ), 18, Vector2( 0, 3 ), 16, Vector2( 1, 0 ), 16777392, Vector2( 1, 1 ), 17039538, Vector2( 1, 2 ), 262194, Vector2( 1, 3 ), 48, Vector2( 2, 0 ), 20971704, Vector2( 2, 1 ), 21299386, Vector2( 2, 2 ), 327738, Vector2( 2, 3 ), 56, Vector2( 3, 0 ), 4194456, Vector2( 3, 1 ), 4259994, Vector2( 3, 2 ), 65562, Vector2( 3, 3 ), 24 ]
|
||||||
|
0/autotile/icon_coordinate = Vector2( 0, 3 )
|
||||||
|
0/autotile/tile_size = Vector2( 8, 8 )
|
||||||
|
0/autotile/spacing = 0
|
||||||
|
0/autotile/occluder_map = [ ]
|
||||||
|
0/autotile/navpoly_map = [ ]
|
||||||
|
0/autotile/priority_map = [ ]
|
||||||
|
0/autotile/z_index_map = [ ]
|
||||||
|
0/occluder_offset = Vector2( 0, 0 )
|
||||||
|
0/navigation_offset = Vector2( 0, 0 )
|
||||||
|
0/shape_offset = Vector2( 0, 0 )
|
||||||
|
0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||||
|
0/shape = SubResource( 1 )
|
||||||
|
0/shape_one_way = false
|
||||||
|
0/shape_one_way_margin = 1.0
|
||||||
|
0/shapes = [ {
|
||||||
|
"autotile_coord": Vector2( 0, 0 ),
|
||||||
|
"one_way": false,
|
||||||
|
"one_way_margin": 1.0,
|
||||||
|
"shape": SubResource( 1 ),
|
||||||
|
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||||
|
}, {
|
||||||
|
"autotile_coord": Vector2( 1, 0 ),
|
||||||
|
"one_way": false,
|
||||||
|
"one_way_margin": 1.0,
|
||||||
|
"shape": SubResource( 2 ),
|
||||||
|
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||||
|
}, {
|
||||||
|
"autotile_coord": Vector2( 2, 0 ),
|
||||||
|
"one_way": false,
|
||||||
|
"one_way_margin": 1.0,
|
||||||
|
"shape": SubResource( 3 ),
|
||||||
|
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||||
|
}, {
|
||||||
|
"autotile_coord": Vector2( 3, 0 ),
|
||||||
|
"one_way": false,
|
||||||
|
"one_way_margin": 1.0,
|
||||||
|
"shape": SubResource( 4 ),
|
||||||
|
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||||
|
}, {
|
||||||
|
"autotile_coord": Vector2( 3, 1 ),
|
||||||
|
"one_way": false,
|
||||||
|
"one_way_margin": 1.0,
|
||||||
|
"shape": SubResource( 5 ),
|
||||||
|
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||||
|
}, {
|
||||||
|
"autotile_coord": Vector2( 3, 2 ),
|
||||||
|
"one_way": false,
|
||||||
|
"one_way_margin": 1.0,
|
||||||
|
"shape": SubResource( 6 ),
|
||||||
|
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||||
|
}, {
|
||||||
|
"autotile_coord": Vector2( 2, 2 ),
|
||||||
|
"one_way": false,
|
||||||
|
"one_way_margin": 1.0,
|
||||||
|
"shape": SubResource( 7 ),
|
||||||
|
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||||
|
}, {
|
||||||
|
"autotile_coord": Vector2( 1, 2 ),
|
||||||
|
"one_way": false,
|
||||||
|
"one_way_margin": 1.0,
|
||||||
|
"shape": SubResource( 8 ),
|
||||||
|
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||||
|
}, {
|
||||||
|
"autotile_coord": Vector2( 1, 1 ),
|
||||||
|
"one_way": false,
|
||||||
|
"one_way_margin": 1.0,
|
||||||
|
"shape": SubResource( 9 ),
|
||||||
|
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||||
|
}, {
|
||||||
|
"autotile_coord": Vector2( 0, 1 ),
|
||||||
|
"one_way": false,
|
||||||
|
"one_way_margin": 1.0,
|
||||||
|
"shape": SubResource( 10 ),
|
||||||
|
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||||
|
}, {
|
||||||
|
"autotile_coord": Vector2( 0, 2 ),
|
||||||
|
"one_way": false,
|
||||||
|
"one_way_margin": 1.0,
|
||||||
|
"shape": SubResource( 11 ),
|
||||||
|
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||||
|
}, {
|
||||||
|
"autotile_coord": Vector2( 0, 3 ),
|
||||||
|
"one_way": false,
|
||||||
|
"one_way_margin": 1.0,
|
||||||
|
"shape": SubResource( 12 ),
|
||||||
|
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||||
|
}, {
|
||||||
|
"autotile_coord": Vector2( 1, 3 ),
|
||||||
|
"one_way": false,
|
||||||
|
"one_way_margin": 1.0,
|
||||||
|
"shape": SubResource( 13 ),
|
||||||
|
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||||
|
}, {
|
||||||
|
"autotile_coord": Vector2( 3, 3 ),
|
||||||
|
"one_way": false,
|
||||||
|
"one_way_margin": 1.0,
|
||||||
|
"shape": SubResource( 14 ),
|
||||||
|
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||||
|
}, {
|
||||||
|
"autotile_coord": Vector2( 2, 3 ),
|
||||||
|
"one_way": false,
|
||||||
|
"one_way_margin": 1.0,
|
||||||
|
"shape": SubResource( 15 ),
|
||||||
|
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||||
|
}, {
|
||||||
|
"autotile_coord": Vector2( 2, 1 ),
|
||||||
|
"one_way": false,
|
||||||
|
"one_way_margin": 1.0,
|
||||||
|
"shape": SubResource( 16 ),
|
||||||
|
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||||
|
} ]
|
||||||
|
0/z_index = 0
|
Loading…
Add table
Add a link
Reference in a new issue