├── saved_game └── game.dat ├── sprites ├── SteMakeGameLogo.png ├── retro-game-background-For-Free-Wallpaper.jpg ├── SteMakeGameLogo.png.import └── retro-game-background-For-Free-Wallpaper.jpg.import ├── default_env.tres ├── objects ├── SteMakeGameLogo.tscn ├── menu_button.tscn ├── gobackButton.tscn └── gamemanager.tscn ├── scenes ├── OptionsScene.tscn ├── level3.tscn ├── level1.tscn ├── level2.tscn ├── SplashScreen.tscn └── MainTileScreen.tscn ├── themes ├── non_selected_theme.tres └── selected_button_theme.tres ├── scripts ├── SplashScreen.gd ├── decrease_value.gd ├── menu_button.gd ├── change_value.gd ├── continue_button.gd └── gamemanager.gd └── project.godot /saved_game/game.dat: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sprites/SteMakeGameLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trolog/GodotSaveLoad/HEAD/sprites/SteMakeGameLogo.png -------------------------------------------------------------------------------- /sprites/retro-game-background-For-Free-Wallpaper.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trolog/GodotSaveLoad/HEAD/sprites/retro-game-background-For-Free-Wallpaper.jpg -------------------------------------------------------------------------------- /default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | 5 | [resource] 6 | background_mode = 2 7 | background_sky = SubResource( 1 ) 8 | -------------------------------------------------------------------------------- /objects/SteMakeGameLogo.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://sprites/SteMakeGameLogo.png" type="Texture" id=1] 4 | 5 | 6 | [node name="SteMakeGameLogo" type="Sprite"] 7 | position = Vector2( 532, 225 ) 8 | texture = ExtResource( 1 ) 9 | -------------------------------------------------------------------------------- /scenes/OptionsScene.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://objects/gobackButton.tscn" type="PackedScene" id=1] 4 | 5 | [node name="Node2D" type="Node2D"] 6 | 7 | [node name="Button" parent="." instance=ExtResource( 1 )] 8 | margin_left = 416.0 9 | margin_top = 400.0 10 | margin_right = 638.0 11 | margin_bottom = 462.0 12 | -------------------------------------------------------------------------------- /themes/non_selected_theme.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="StyleBoxFlat" format=2] 2 | 3 | [resource] 4 | bg_color = Color( 0.133333, 0.317647, 0.788235, 1 ) 5 | border_blend = true 6 | corner_radius_top_left = 10 7 | corner_radius_top_right = 10 8 | corner_radius_bottom_right = 10 9 | corner_radius_bottom_left = 10 10 | shadow_size = 2 11 | shadow_offset = Vector2( 0.633, 0 ) 12 | anti_aliasing_size = 2 13 | -------------------------------------------------------------------------------- /scripts/SplashScreen.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | func _ready(): 4 | yield(get_node("AnimationPlayer"),"animation_finished") # pause here until animation finished 5 | get_tree().change_scene("res://scenes/MainTileScreen.tscn") # anmationed finished so we resume the yield 6 | 7 | func _input(event): 8 | if(event is InputEventKey): 9 | get_tree().change_scene("res://scenes/MainTileScreen.tscn") # anmationed finished so we resume the yield 10 | -------------------------------------------------------------------------------- /scripts/decrease_value.gd: -------------------------------------------------------------------------------- 1 | extends Button 2 | 3 | export(String) var value_name = "" 4 | # Declare member variables here. Examples: 5 | # var a = 2 6 | # var b = "text" 7 | 8 | 9 | # Called when the node enters the scene tree for the first time. 10 | func _ready(): 11 | pass # Replace with function body. 12 | 13 | 14 | # Called every frame. 'delta' is the elapsed time since the previous frame. 15 | #func _process(delta): 16 | # pass 17 | -------------------------------------------------------------------------------- /themes/selected_button_theme.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="StyleBoxFlat" format=2] 2 | 3 | [resource] 4 | bg_color = Color( 0.133333, 0.317647, 0.788235, 1 ) 5 | border_width_left = 2 6 | border_width_top = 2 7 | border_width_right = 2 8 | border_width_bottom = 2 9 | border_blend = true 10 | corner_radius_top_left = 10 11 | corner_radius_top_right = 10 12 | corner_radius_bottom_right = 10 13 | corner_radius_bottom_left = 10 14 | shadow_size = 2 15 | shadow_offset = Vector2( 0.633, 0 ) 16 | anti_aliasing_size = 2 17 | -------------------------------------------------------------------------------- /objects/menu_button.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://themes/selected_button_theme.tres" type="StyleBox" id=1] 4 | [ext_resource path="res://themes/non_selected_theme.tres" type="StyleBox" id=2] 5 | [ext_resource path="res://scripts/menu_button.gd" type="Script" id=3] 6 | 7 | [node name="Button" type="Button"] 8 | margin_right = 222.0 9 | margin_bottom = 62.0 10 | custom_styles/hover = ExtResource( 1 ) 11 | custom_styles/pressed = ExtResource( 1 ) 12 | custom_styles/focus = ExtResource( 1 ) 13 | custom_styles/normal = ExtResource( 2 ) 14 | script = ExtResource( 3 ) 15 | __meta__ = { 16 | "_edit_use_anchors_": false 17 | } 18 | -------------------------------------------------------------------------------- /scenes/level3.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://objects/gobackButton.tscn" type="PackedScene" id=1] 4 | 5 | [node name="level3" type="Node2D"] 6 | 7 | [node name="btnBack" parent="." instance=ExtResource( 1 )] 8 | margin_left = 64.0 9 | margin_top = 64.0 10 | margin_right = 286.0 11 | margin_bottom = 126.0 12 | text = "Previous Level" 13 | reference_path = "res://scenes/level2.tscn" 14 | game_level = 2 15 | 16 | [node name="lblLevel" type="Label" parent="."] 17 | margin_left = 168.0 18 | margin_top = 8.0 19 | margin_right = 408.0 20 | margin_bottom = 56.0 21 | text = "LEVEL3" 22 | align = 1 23 | valign = 1 24 | __meta__ = { 25 | "_edit_use_anchors_": false 26 | } 27 | -------------------------------------------------------------------------------- /objects/gobackButton.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://themes/selected_button_theme.tres" type="StyleBox" id=1] 4 | [ext_resource path="res://themes/non_selected_theme.tres" type="StyleBox" id=2] 5 | [ext_resource path="res://scripts/menu_button.gd" type="Script" id=3] 6 | 7 | [node name="Button" type="Button"] 8 | margin_right = 222.0 9 | margin_bottom = 62.0 10 | custom_styles/hover = ExtResource( 1 ) 11 | custom_styles/pressed = ExtResource( 1 ) 12 | custom_styles/focus = ExtResource( 1 ) 13 | custom_styles/normal = ExtResource( 2 ) 14 | text = "GoBack" 15 | script = ExtResource( 3 ) 16 | __meta__ = { 17 | "_edit_use_anchors_": false 18 | } 19 | reference_path = "res://scenes/MainTileScreen.tscn" 20 | start_focused = true 21 | -------------------------------------------------------------------------------- /scripts/menu_button.gd: -------------------------------------------------------------------------------- 1 | extends Button 2 | 3 | export var reference_path = "" 4 | export(bool) var start_focused = false 5 | export(int) var game_level = 0 6 | 7 | func _ready(): 8 | if(start_focused): 9 | grab_focus() 10 | 11 | connect("mouse_entered",self,"_on_Button_mouse_entered") 12 | connect("pressed",self,"_on_Button_Pressed") 13 | 14 | func _on_Button_mouse_entered(): 15 | grab_focus() 16 | 17 | func _on_Button_Pressed(): 18 | if(reference_path != ""): 19 | if(game_level > 0): # we're on a level 20 | Gamemanager.level = game_level 21 | Gamemanager.update_data() 22 | Gamemanager.show_data() 23 | else: # we're not on a level 24 | Gamemanager.hide_data() 25 | 26 | get_tree().change_scene(reference_path) 27 | else: 28 | get_tree().quit() 29 | -------------------------------------------------------------------------------- /scripts/change_value.gd: -------------------------------------------------------------------------------- 1 | extends Button 2 | 3 | export(String) var value_name = "" 4 | export(bool) var up 5 | 6 | func _ready(): 7 | connect("pressed",self,"button_pressed") 8 | pass # Replace with function body. 9 | 10 | func button_pressed(): 11 | if(up): 12 | if(value_name == "health"): 13 | Gamemanager.player_health += 1 14 | if(value_name == "speed"): 15 | Gamemanager.player_speed += 1 16 | if(value_name == "strength"): 17 | Gamemanager.player_strength += 1 18 | else: 19 | if(value_name == "health"): 20 | Gamemanager.player_health -= 1 21 | if(value_name == "speed"): 22 | Gamemanager.player_speed -= 1 23 | if(value_name == "strength"): 24 | Gamemanager.player_strength -= 1 25 | 26 | Gamemanager.update_data() 27 | Gamemanager.show_data() 28 | -------------------------------------------------------------------------------- /sprites/SteMakeGameLogo.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/SteMakeGameLogo.png-344ab9c5f9a88c36d6409f56621aeafa.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://sprites/SteMakeGameLogo.png" 13 | dest_files=[ "res://.import/SteMakeGameLogo.png-344ab9c5f9a88c36d6409f56621aeafa.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /scenes/level1.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://objects/gobackButton.tscn" type="PackedScene" id=1] 4 | 5 | [node name="level1" type="Node2D"] 6 | 7 | [node name="btnBack" parent="." instance=ExtResource( 1 )] 8 | margin_left = 64.0 9 | margin_top = 64.0 10 | margin_right = 286.0 11 | margin_bottom = 126.0 12 | text = "Main Menu" 13 | 14 | [node name="btnNext" parent="." instance=ExtResource( 1 )] 15 | margin_left = 304.0 16 | margin_top = 64.0 17 | margin_right = 526.0 18 | margin_bottom = 126.0 19 | text = "Next Level" 20 | reference_path = "res://scenes/level2.tscn" 21 | game_level = 2 22 | 23 | [node name="lblLevel" type="Label" parent="."] 24 | margin_left = 168.0 25 | margin_top = 8.0 26 | margin_right = 408.0 27 | margin_bottom = 56.0 28 | text = "LEVEL1" 29 | align = 1 30 | valign = 1 31 | __meta__ = { 32 | "_edit_use_anchors_": false 33 | } 34 | -------------------------------------------------------------------------------- /sprites/retro-game-background-For-Free-Wallpaper.jpg.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/retro-game-background-For-Free-Wallpaper.jpg-8a99abd1d8c88fdf4dfe584f5862ac44.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://sprites/retro-game-background-For-Free-Wallpaper.jpg" 13 | dest_files=[ "res://.import/retro-game-background-For-Free-Wallpaper.jpg-8a99abd1d8c88fdf4dfe584f5862ac44.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /scenes/level2.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=2 format=2] 2 | 3 | [ext_resource path="res://objects/gobackButton.tscn" type="PackedScene" id=1] 4 | 5 | [node name="level2" type="Node2D"] 6 | 7 | [node name="btnBack" parent="." instance=ExtResource( 1 )] 8 | margin_left = 64.0 9 | margin_top = 64.0 10 | margin_right = 286.0 11 | margin_bottom = 126.0 12 | text = "Previous Level" 13 | reference_path = "res://scenes/level1.tscn" 14 | game_level = 1 15 | 16 | [node name="btnNext" parent="." instance=ExtResource( 1 )] 17 | margin_left = 304.0 18 | margin_top = 64.0 19 | margin_right = 526.0 20 | margin_bottom = 126.0 21 | text = "Next Level" 22 | reference_path = "res://scenes/level3.tscn" 23 | game_level = 3 24 | 25 | [node name="lblLevel" type="Label" parent="."] 26 | margin_left = 168.0 27 | margin_top = 8.0 28 | margin_right = 408.0 29 | margin_bottom = 56.0 30 | text = "LEVEL2" 31 | align = 1 32 | valign = 1 33 | __meta__ = { 34 | "_edit_use_anchors_": false 35 | } 36 | -------------------------------------------------------------------------------- /project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ ] 12 | _global_script_class_icons={ 13 | 14 | } 15 | 16 | [application] 17 | 18 | config/name="SaveGameLoadGame" 19 | run/main_scene="res://scenes/SplashScreen.tscn" 20 | 21 | [autoload] 22 | 23 | Gamemanager="*res://objects/gamemanager.tscn" 24 | 25 | [input] 26 | 27 | anykey={ 28 | "deadzone": 0.5, 29 | "events": [ ] 30 | } 31 | save_key={ 32 | "deadzone": 0.5, 33 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":true,"meta":false,"command":true,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null) 34 | ] 35 | } 36 | print_key={ 37 | "deadzone": 0.5, 38 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":80,"unicode":0,"echo":false,"script":null) 39 | ] 40 | } 41 | 42 | [rendering] 43 | 44 | environment/default_clear_color=Color( 0, 0, 0, 1 ) 45 | environment/default_environment="res://default_env.tres" 46 | -------------------------------------------------------------------------------- /scripts/continue_button.gd: -------------------------------------------------------------------------------- 1 | extends Button 2 | 3 | var can_click = false 4 | 5 | func _ready(): 6 | connect_signals() 7 | 8 | #Look for a saved file, if we find one then this is enabled 9 | var file : File = File.new() 10 | if(file.file_exists("res://saved_game/game.dat")): 11 | can_click = true 12 | #set font color to white 13 | set_font_color(Color(1,1,1,1)) 14 | else: 15 | #Set font color to gray 16 | set_font_color(Color(0.5,0.5,0.5,1)) 17 | 18 | func set_font_color(col : Color): 19 | set("custom_colors/font_color",col) 20 | set("custom_colors/font_color_hover",col) 21 | set("custom_colors/font_color_pressed",col) 22 | 23 | func connect_signals(): 24 | connect("mouse_entered",self,"_on_Button_mouse_entered") 25 | connect("pressed",self,"_on_Button_Pressed") 26 | 27 | func _on_Button_mouse_entered(): 28 | grab_focus() 29 | 30 | 31 | func _on_Button_Pressed(): 32 | if(can_click): 33 | Gamemanager.do_load() 34 | var get_level_data = Gamemanager.game_data["level_data"] 35 | var get_player_data = Gamemanager.game_data["player_data"] 36 | 37 | Gamemanager.level = get_level_data["level"] 38 | Gamemanager.player_health = get_player_data["health"] 39 | Gamemanager.player_speed = get_player_data["speed"] 40 | Gamemanager.player_strength = get_player_data["strength"] 41 | 42 | Gamemanager.update_data() 43 | 44 | Gamemanager.show_data() 45 | 46 | get_tree().change_scene("res://scenes/level" + str(get_level_data["level"]) + ".tscn") 47 | 48 | pass 49 | -------------------------------------------------------------------------------- /scenes/SplashScreen.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://sprites/SteMakeGameLogo.png" type="Texture" id=1] 4 | [ext_resource path="res://scripts/SplashScreen.gd" type="Script" id=2] 5 | 6 | [sub_resource type="Animation" id=1] 7 | resource_name = "DoSplash" 8 | length = 4.0 9 | tracks/0/type = "bezier" 10 | tracks/0/path = NodePath("SteMakeGameLogo:position:x") 11 | tracks/0/interp = 1 12 | tracks/0/loop_wrap = true 13 | tracks/0/imported = false 14 | tracks/0/enabled = true 15 | tracks/0/keys = { 16 | "points": PoolRealArray( ), 17 | "times": PoolRealArray( ) 18 | } 19 | tracks/1/type = "bezier" 20 | tracks/1/path = NodePath("SteMakeGameLogo:position:y") 21 | tracks/1/interp = 1 22 | tracks/1/loop_wrap = true 23 | tracks/1/imported = false 24 | tracks/1/enabled = true 25 | tracks/1/keys = { 26 | "points": PoolRealArray( -60, -0.25, 0, 0.61, 214.815, 262.392, -0.49, 107.363, 0.25, 0 ), 27 | "times": PoolRealArray( 0, 1.4 ) 28 | } 29 | tracks/2/type = "value" 30 | tracks/2/path = NodePath("SteMakeGameLogo:modulate") 31 | tracks/2/interp = 1 32 | tracks/2/loop_wrap = true 33 | tracks/2/imported = false 34 | tracks/2/enabled = true 35 | tracks/2/keys = { 36 | "times": PoolRealArray( 1.6, 4 ), 37 | "transitions": PoolRealArray( 1, 1 ), 38 | "update": 0, 39 | "values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ] 40 | } 41 | 42 | [node name="SplashScreen" type="Node2D"] 43 | script = ExtResource( 2 ) 44 | 45 | [node name="SteMakeGameLogo" type="Sprite" parent="."] 46 | position = Vector2( 520, -60 ) 47 | texture = ExtResource( 1 ) 48 | 49 | [node name="AnimationPlayer" type="AnimationPlayer" parent="."] 50 | autoplay = "DoSplash" 51 | anims/DoSplash = SubResource( 1 ) 52 | -------------------------------------------------------------------------------- /scripts/gamemanager.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | #Default values 4 | var level = 1 5 | var player_health = 4 6 | var player_speed = 2 7 | var player_strength = 3 8 | var checkpoint = 0 9 | 10 | var game_data : Dictionary 11 | 12 | onready var lbldata : Label = $lblgamedata 13 | 14 | func _ready(): 15 | #update with default values, this will change when you save 16 | update_data() 17 | pass 18 | 19 | func update_data(): 20 | 21 | game_data = {"player_data" : 22 | { 23 | "health" : player_health, 24 | "speed" : player_speed, 25 | "strength" : player_strength 26 | }, 27 | 28 | "level_data" : 29 | { 30 | "level" : level, 31 | "checkpoint" : checkpoint 32 | } 33 | } 34 | 35 | func do_save(): 36 | var file : File = File.new() 37 | file.open("res://saved_game/game.dat",File.WRITE) 38 | file.store_line(to_json(game_data)) 39 | file.close() 40 | 41 | func do_load(): 42 | var file : File = File.new() 43 | 44 | file.open("res://saved_game/game.dat",File.READ) 45 | 46 | game_data = parse_json(file.get_as_text()) 47 | 48 | file.close() 49 | 50 | func _physics_process(delta): 51 | 52 | if(Input.is_action_just_pressed("save_key")): 53 | #DOSAVE 54 | if(get_tree().current_scene.name.begins_with("level")): 55 | print("can_save") 56 | do_save() 57 | else: 58 | print("cannot save") 59 | pass 60 | 61 | if(Input.is_action_just_pressed("print_key")): 62 | print("level : " + str(level)) 63 | print("player health : " + str(player_health)) 64 | print("player strength : " + str(player_strength)) 65 | print("player speed : " + str(player_speed)) 66 | print(" ----------------- ") 67 | 68 | func show_data(): 69 | lbldata.text = "level : " + str(level) + "\n \n" 70 | lbldata.text += "health : " + str(player_health) + "\n \n" 71 | lbldata.text += "speed : " + str(player_speed) + "\n \n" 72 | lbldata.text += "strength : " + str(player_strength) 73 | lbldata.show() 74 | 75 | func hide_data(): 76 | lbldata.hide() 77 | -------------------------------------------------------------------------------- /scenes/MainTileScreen.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [ext_resource path="res://sprites/retro-game-background-For-Free-Wallpaper.jpg" type="Texture" id=1] 4 | [ext_resource path="res://objects/menu_button.tscn" type="PackedScene" id=2] 5 | [ext_resource path="res://scripts/continue_button.gd" type="Script" id=3] 6 | 7 | [node name="MainTileScreen" type="Control"] 8 | anchor_right = 1.0 9 | anchor_bottom = 1.0 10 | __meta__ = { 11 | "_edit_use_anchors_": false 12 | } 13 | 14 | [node name="background_image" type="TextureRect" parent="."] 15 | anchor_right = 1.0 16 | anchor_bottom = 1.0 17 | texture = ExtResource( 1 ) 18 | expand = true 19 | stretch_mode = 4 20 | __meta__ = { 21 | "_edit_lock_": true 22 | } 23 | 24 | [node name="VBoxContainer" type="VBoxContainer" parent="."] 25 | anchor_left = 0.37793 26 | anchor_top = 0.488333 27 | anchor_right = 0.62207 28 | anchor_bottom = 0.821667 29 | __meta__ = { 30 | "_edit_use_anchors_": true 31 | } 32 | 33 | [node name="mnuNewGame" parent="VBoxContainer" instance=ExtResource( 2 )] 34 | margin_right = 249.0 35 | margin_bottom = 64.0 36 | focus_neighbour_top = NodePath("../mnuExit") 37 | focus_neighbour_bottom = NodePath("../mnuContinue") 38 | size_flags_horizontal = 3 39 | size_flags_vertical = 3 40 | text = "New Game" 41 | reference_path = "res://scenes/level1.tscn" 42 | start_focused = true 43 | game_level = 1 44 | 45 | [node name="mnuContinue" parent="VBoxContainer" instance=ExtResource( 2 )] 46 | margin_top = 68.0 47 | margin_right = 249.0 48 | margin_bottom = 132.0 49 | focus_neighbour_top = NodePath("../mnuNewGame") 50 | focus_neighbour_bottom = NodePath("../mnuExit") 51 | size_flags_horizontal = 3 52 | size_flags_vertical = 3 53 | custom_colors/font_color = Color( 0, 0, 0, 1 ) 54 | custom_colors/font_color_hover = Color( 0, 0, 0, 1 ) 55 | custom_colors/font_color_pressed = Color( 0, 0, 0, 1 ) 56 | text = "Continue" 57 | script = ExtResource( 3 ) 58 | 59 | [node name="mnuExit" parent="VBoxContainer" instance=ExtResource( 2 )] 60 | margin_top = 136.0 61 | margin_right = 249.0 62 | margin_bottom = 200.0 63 | focus_neighbour_top = NodePath("../mnuContinue") 64 | focus_neighbour_bottom = NodePath("../mnuNewGame") 65 | size_flags_horizontal = 3 66 | size_flags_vertical = 3 67 | text = "Exit" 68 | -------------------------------------------------------------------------------- /objects/gamemanager.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://scripts/gamemanager.gd" type="Script" id=1] 4 | [ext_resource path="res://scripts/change_value.gd" type="Script" id=2] 5 | 6 | [node name="gamemanager" type="Node"] 7 | script = ExtResource( 1 ) 8 | 9 | [node name="lblgamedata" type="Label" parent="."] 10 | visible = false 11 | margin_left = -72.416 12 | margin_top = 177.782 13 | margin_right = 191.584 14 | margin_bottom = 369.782 15 | text = "level 1 16 | 17 | health : 5 18 | 19 | speed : 6 20 | 21 | strength : 7" 22 | align = 1 23 | valign = 1 24 | __meta__ = { 25 | "_edit_use_anchors_": false 26 | } 27 | 28 | [node name="Button" type="Button" parent="lblgamedata"] 29 | margin_left = 192.0 30 | margin_top = 69.0 31 | margin_right = 212.0 32 | margin_bottom = 89.0 33 | text = "<" 34 | script = ExtResource( 2 ) 35 | __meta__ = { 36 | "_edit_use_anchors_": false 37 | } 38 | value_name = "health" 39 | 40 | [node name="Button2" type="Button" parent="lblgamedata"] 41 | margin_left = 224.0 42 | margin_top = 69.0 43 | margin_right = 244.0 44 | margin_bottom = 89.0 45 | text = ">" 46 | script = ExtResource( 2 ) 47 | value_name = "health" 48 | up = true 49 | 50 | [node name="Button3" type="Button" parent="lblgamedata"] 51 | margin_left = 192.0 52 | margin_top = 101.0 53 | margin_right = 212.0 54 | margin_bottom = 121.0 55 | text = "<" 56 | script = ExtResource( 2 ) 57 | __meta__ = { 58 | "_edit_use_anchors_": false 59 | } 60 | value_name = "speed" 61 | 62 | [node name="Button4" type="Button" parent="lblgamedata"] 63 | margin_left = 224.0 64 | margin_top = 101.0 65 | margin_right = 244.0 66 | margin_bottom = 121.0 67 | text = ">" 68 | script = ExtResource( 2 ) 69 | value_name = "speed" 70 | up = true 71 | 72 | [node name="Button5" type="Button" parent="lblgamedata"] 73 | margin_left = 192.0 74 | margin_top = 136.0 75 | margin_right = 212.0 76 | margin_bottom = 156.0 77 | text = "<" 78 | script = ExtResource( 2 ) 79 | __meta__ = { 80 | "_edit_use_anchors_": false 81 | } 82 | value_name = "strength" 83 | 84 | [node name="Button6" type="Button" parent="lblgamedata"] 85 | margin_left = 224.0 86 | margin_top = 136.0 87 | margin_right = 244.0 88 | margin_bottom = 156.0 89 | text = ">" 90 | script = ExtResource( 2 ) 91 | __meta__ = { 92 | "_edit_use_anchors_": false 93 | } 94 | value_name = "strength" 95 | up = true 96 | --------------------------------------------------------------------------------