forked from nezvers/Godot-GameTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrade to work with godot 4.3 beta 3
- Loading branch information
markim
committed
Jul 18, 2024
1 parent
24ab5d8
commit 4bc43e7
Showing
79 changed files
with
3,236 additions
and
1,355 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,102 @@ | ||
[gd_scene load_steps=5 format=2] | ||
[gd_scene load_steps=6 format=3 uid="uid://c25bqavugtpfj"] | ||
|
||
[ext_resource path="res://Levels/Level.gd" type="Script" id=1] | ||
[ext_resource path="res://addons/GameTemplate/Assets/Fonts/pixellocale_16.tres" type="DynamicFont" id=2] | ||
[ext_resource path="res://icon.png" type="Texture" id=3] | ||
[ext_resource path="res://Levels/player.gd" type="Script" id=4] | ||
[ext_resource type="Script" path="res://Levels/Level.gd" id="1"] | ||
[ext_resource type="FontFile" uid="uid://cj1os0is1qn2h" path="res://addons/GameTemplate/Assets/Fonts/pixellocale-v-1-4.ttf" id="2_xvw7o"] | ||
[ext_resource type="Texture2D" uid="uid://cb0tbpriomwqd" path="res://icon.png" id="3"] | ||
[ext_resource type="Script" path="res://Levels/player.gd" id="4"] | ||
|
||
[sub_resource type="FontFile" id="FontFile_4wxgj"] | ||
fallbacks = Array[Font]([ExtResource("2_xvw7o")]) | ||
cache/0/16/0/ascent = 0.0 | ||
cache/0/16/0/descent = 0.0 | ||
cache/0/16/0/underline_position = 0.0 | ||
cache/0/16/0/underline_thickness = 0.0 | ||
cache/0/16/0/scale = 1.0 | ||
cache/0/50/0/ascent = 0.0 | ||
cache/0/50/0/descent = 0.0 | ||
cache/0/50/0/underline_position = 0.0 | ||
cache/0/50/0/underline_thickness = 0.0 | ||
cache/0/50/0/scale = 1.0 | ||
cache/0/2/0/ascent = 0.0 | ||
cache/0/2/0/descent = 0.0 | ||
cache/0/2/0/underline_position = 0.0 | ||
cache/0/2/0/underline_thickness = 0.0 | ||
cache/0/2/0/scale = 1.0 | ||
cache/0/3/0/ascent = 0.0 | ||
cache/0/3/0/descent = 0.0 | ||
cache/0/3/0/underline_position = 0.0 | ||
cache/0/3/0/underline_thickness = 0.0 | ||
cache/0/3/0/scale = 1.0 | ||
cache/0/4/0/ascent = 0.0 | ||
cache/0/4/0/descent = 0.0 | ||
cache/0/4/0/underline_position = 0.0 | ||
cache/0/4/0/underline_thickness = 0.0 | ||
cache/0/4/0/scale = 1.0 | ||
cache/0/5/0/ascent = 0.0 | ||
cache/0/5/0/descent = 0.0 | ||
cache/0/5/0/underline_position = 0.0 | ||
cache/0/5/0/underline_thickness = 0.0 | ||
cache/0/5/0/scale = 1.0 | ||
cache/0/6/0/ascent = 0.0 | ||
cache/0/6/0/descent = 0.0 | ||
cache/0/6/0/underline_position = 0.0 | ||
cache/0/6/0/underline_thickness = 0.0 | ||
cache/0/6/0/scale = 1.0 | ||
cache/0/7/0/ascent = 0.0 | ||
cache/0/7/0/descent = 0.0 | ||
cache/0/7/0/underline_position = 0.0 | ||
cache/0/7/0/underline_thickness = 0.0 | ||
cache/0/7/0/scale = 1.0 | ||
cache/0/8/0/ascent = 0.0 | ||
cache/0/8/0/descent = 0.0 | ||
cache/0/8/0/underline_position = 0.0 | ||
cache/0/8/0/underline_thickness = 0.0 | ||
cache/0/8/0/scale = 1.0 | ||
cache/0/9/0/ascent = 0.0 | ||
cache/0/9/0/descent = 0.0 | ||
cache/0/9/0/underline_position = 0.0 | ||
cache/0/9/0/underline_thickness = 0.0 | ||
cache/0/9/0/scale = 1.0 | ||
cache/0/10/0/ascent = 0.0 | ||
cache/0/10/0/descent = 0.0 | ||
cache/0/10/0/underline_position = 0.0 | ||
cache/0/10/0/underline_thickness = 0.0 | ||
cache/0/10/0/scale = 1.0 | ||
cache/0/15/0/ascent = 0.0 | ||
cache/0/15/0/descent = 0.0 | ||
cache/0/15/0/underline_position = 0.0 | ||
cache/0/15/0/underline_thickness = 0.0 | ||
cache/0/15/0/scale = 1.0 | ||
|
||
[node name="Level" type="Node2D"] | ||
script = ExtResource( 1 ) | ||
script = ExtResource("1") | ||
Next_Scene = "res://MainMenu/MainMenu.tscn" | ||
|
||
[node name="CanvasLayer" type="CanvasLayer" parent="."] | ||
|
||
[node name="ColorRect" type="ColorRect" parent="CanvasLayer"] | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
color = Color( 0.662745, 1, 0.537255, 1 ) | ||
color = Color(0.662745, 1, 0.537255, 1) | ||
|
||
[node name="Button" type="Button" parent="CanvasLayer"] | ||
anchors_preset = 8 | ||
anchor_left = 0.5 | ||
anchor_top = 0.5 | ||
anchor_right = 0.5 | ||
anchor_bottom = 0.5 | ||
margin_left = -53.0 | ||
margin_top = -21.0 | ||
margin_right = 55.0 | ||
margin_bottom = 19.0 | ||
custom_fonts/font = ExtResource( 2 ) | ||
offset_left = -53.0 | ||
offset_top = -21.0 | ||
offset_right = 55.0 | ||
offset_bottom = 19.0 | ||
theme_override_fonts/font = SubResource("FontFile_4wxgj") | ||
text = "GO BACK" | ||
__meta__ = { | ||
"_edit_use_anchors_": false | ||
} | ||
|
||
[node name="Sprite" type="Sprite" parent="CanvasLayer"] | ||
position = Vector2( 156.129, 131.574 ) | ||
scale = Vector2( 0.5, 0.5 ) | ||
texture = ExtResource( 3 ) | ||
script = ExtResource( 4 ) | ||
|
||
[node name="Sprite2D" type="Sprite2D" parent="CanvasLayer"] | ||
position = Vector2(156.129, 131.574) | ||
scale = Vector2(0.5, 0.5) | ||
texture = ExtResource("3") | ||
script = ExtResource("4") | ||
|
||
[connection signal="pressed" from="CanvasLayer/Button" to="." method="_on_Button_pressed"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
extends Sprite | ||
extends Sprite2D | ||
|
||
var speed = 2 * 60 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
extends CanvasLayer | ||
|
||
export (String, FILE, "*.tscn") var First_Level: String | ||
@export var First_Level: String # (String, FILE, "*.tscn") | ||
|
||
func _ready()->void: | ||
get_tree().get_nodes_in_group("MainMenu")[0].grab_focus() #Godot doesn't have buttons auto grab_focus when noone has focus | ||
MenuEvent.connect("Options", self, "on_options") | ||
get_tree().get_nodes_in_group("MainMenu")[0].grab_focus() | ||
MenuEvent.connect("OptionsSignal", on_options) | ||
|
||
if OS.get_name() == "HTML5": | ||
$"BG/MarginContainer/VBoxMain/HBoxContainer/ButtonContainer/Exit".visible = false | ||
#Localization | ||
SettingsLanguage.connect("ReTranslate", self, "retranslate") | ||
SettingsLanguage.connect("ReTranslate", retranslate) | ||
retranslate() | ||
|
||
func on_options(value:bool)->void: | ||
if !value && !MenuEvent.Paused: | ||
if !value && !MenuEvent.Paused_val: | ||
get_tree().get_nodes_in_group("MainMenu")[0].grab_focus() | ||
|
||
func _on_NewGame_pressed()->void: | ||
Game.emit_signal("NewGame") | ||
Game.emit_signal("ChangeScene", First_Level) | ||
|
||
func _on_Options_pressed()->void: | ||
MenuEvent.Options = true | ||
MenuEvent.Options_val = true | ||
|
||
func _on_Exit_pressed()->void: | ||
Game.emit_signal("Exit") | ||
|
||
#Localization | ||
func retranslate()->void: | ||
find_node("NewGame").text = tr("NEW_GAME") | ||
find_node("Options").text = tr("OPTIONS") | ||
find_node("Exit").text = tr("EXIT") | ||
find_child("NewGame").text = tr("NEW_GAME") | ||
find_child("Options").text = tr("OPTIONS") | ||
find_child("Exit").text = tr("EXIT") |
Oops, something went wrong.