Added the game scene
There are no berries yet and the bird floats if the screen size isnt 1920 by 1080 but I am still making good progress
This commit is contained in:
1 parent
9dc4bdfdb1
commit
3b0f47492d
11 files changed
+136
-2
No files matched your search
@@ -0,0 +1,7 @@
|
|||||||
|
<Project Sdk="Godot.NET.Sdk/4.4.1">
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<EnableDynamicLoading>true</EnableDynamicLoading>
|
||||||
|
<RootNamespace>BerryDashGodotRemake</RootNamespace>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio 2012
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Berry Dash Godot Remake", "Berry Dash Godot Remake.csproj", "{52B1C37F-037D-494E-BAF1-252292499806}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
ExportDebug|Any CPU = ExportDebug|Any CPU
|
||||||
|
ExportRelease|Any CPU = ExportRelease|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{52B1C37F-037D-494E-BAF1-252292499806}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{52B1C37F-037D-494E-BAF1-252292499806}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{52B1C37F-037D-494E-BAF1-252292499806}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU
|
||||||
|
{52B1C37F-037D-494E-BAF1-252292499806}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU
|
||||||
|
{52B1C37F-037D-494E-BAF1-252292499806}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU
|
||||||
|
{52B1C37F-037D-494E-BAF1-252292499806}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
[gd_scene load_steps=3 format=3 uid="uid://bgt46l5p8qrwc"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://dfv3cmvcskd6t" path="res://Scripts/Player.cs" id="1_gl6un"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://5ecdlqnn0u6g" path="res://Textures/Icons/Bird1.png" id="1_iukft"]
|
||||||
|
|
||||||
|
[node name="Game" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Center" type="Node2D" parent="."]
|
||||||
|
position = Vector2(960, 540)
|
||||||
|
|
||||||
|
[node name="Player" type="Node2D" parent="."]
|
||||||
|
position = Vector2(960, 978)
|
||||||
|
script = ExtResource("1_gl6un")
|
||||||
|
|
||||||
|
[node name="Texture" type="Sprite2D" parent="Player"]
|
||||||
|
scale = Vector2(1.675, 1.675)
|
||||||
|
texture = ExtResource("1_iukft")
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
[gd_scene load_steps=7 format=3 uid="uid://bg4fa11htun38"]
|
[gd_scene load_steps=8 format=3 uid="uid://bg4fa11htun38"]
|
||||||
|
|
||||||
[ext_resource type="FontFile" uid="uid://dq7nkk7n7wrq4" path="res://Fonts/Lexend.ttf" id="1_tt5f1"]
|
[ext_resource type="FontFile" uid="uid://dq7nkk7n7wrq4" path="res://Fonts/Lexend.ttf" id="1_tt5f1"]
|
||||||
|
[ext_resource type="Script" uid="uid://bc4miccifwrk0" path="res://Scripts/SceneSwitcher.cs" id="2_8saeu"]
|
||||||
[ext_resource type="AudioStream" uid="uid://6v4630hrkeg6" path="res://Audio/Music/Menu.mp3" id="2_853f1"]
|
[ext_resource type="AudioStream" uid="uid://6v4630hrkeg6" path="res://Audio/Music/Menu.mp3" id="2_853f1"]
|
||||||
|
|
||||||
[sub_resource type="LabelSettings" id="LabelSettings_tt5f1"]
|
[sub_resource type="LabelSettings" id="LabelSettings_tt5f1"]
|
||||||
@@ -137,6 +138,8 @@ theme_override_styles/hover = SubResource("StyleBoxFlat_853f1")
|
|||||||
theme_override_styles/pressed = SubResource("StyleBoxFlat_8saeu")
|
theme_override_styles/pressed = SubResource("StyleBoxFlat_8saeu")
|
||||||
theme_override_styles/normal = SubResource("StyleBoxFlat_tt5f1")
|
theme_override_styles/normal = SubResource("StyleBoxFlat_tt5f1")
|
||||||
text = "Play"
|
text = "Play"
|
||||||
|
script = ExtResource("2_8saeu")
|
||||||
|
ScenePath = "res://Scenes/Game.tscn"
|
||||||
|
|
||||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||||
stream = ExtResource("2_853f1")
|
stream = ExtResource("2_853f1")
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using Godot;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
public partial class Player : Node2D {
|
||||||
|
private float MovementSpeed = 800f;
|
||||||
|
|
||||||
|
public override void _Ready() {
|
||||||
|
Position = new Vector2(x: DisplayServer.WindowGetSize().X / 2, y: 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void _Process(double delta) {
|
||||||
|
var ScreenSize = GetViewport().GetVisibleRect().Size;
|
||||||
|
var WindowSize = DisplayServer.WindowGetSize();
|
||||||
|
var Scale = WindowSize / ScreenSize;
|
||||||
|
|
||||||
|
Vector2 Pos = Position;
|
||||||
|
Pos.Y = (DisplayServer.WindowGetSize().Y - 90) / Scale.Y;
|
||||||
|
|
||||||
|
if (Input.IsKeyPressed((Key)Key.Left) || Input.IsKeyPressed((Key)Key.A)) {
|
||||||
|
Pos.X -= MovementSpeed * (float)delta;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Input.IsKeyPressed((Key)Key.Right) || Input.IsKeyPressed((Key)Key.D)) {
|
||||||
|
Pos.X += MovementSpeed * (float)delta;
|
||||||
|
}
|
||||||
|
|
||||||
|
Position = Pos;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://dfv3cmvcskd6t
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
using Godot;
|
||||||
|
|
||||||
|
public partial class SceneSwitcher : Button {
|
||||||
|
[Export]
|
||||||
|
public string ScenePath = ""; // Set this in the Inspector
|
||||||
|
|
||||||
|
public override void _Ready() {
|
||||||
|
Pressed += OnButtonPressed;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnButtonPressed() {
|
||||||
|
if (string.IsNullOrEmpty(ScenePath)) {
|
||||||
|
GD.PrintErr("Scene path not set!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var error = GetTree().ChangeSceneToFile(ScenePath);
|
||||||
|
|
||||||
|
if (error != Error.Ok) {
|
||||||
|
GD.PrintErr("Failed to change scene: " + error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://bc4miccifwrk0
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://5ecdlqnn0u6g"
|
||||||
|
path="res://.godot/imported/Bird1.png-ea98819da12161c623b9d14119eadbcf.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://Textures/Icons/Bird1.png"
|
||||||
|
dest_files=["res://.godot/imported/Bird1.png-ea98819da12161c623b9d14119eadbcf.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
|
||||||
+1
-1
@@ -12,7 +12,7 @@ config_version=5
|
|||||||
|
|
||||||
config/name="Berry Dash Godot Remake"
|
config/name="Berry Dash Godot Remake"
|
||||||
run/main_scene="uid://bg4fa11htun38"
|
run/main_scene="uid://bg4fa11htun38"
|
||||||
config/features=PackedStringArray("4.4", "Mobile")
|
config/features=PackedStringArray("4.4", "C#", "Mobile")
|
||||||
config/icon="res://icon.svg"
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|||||||
Reference in new issue
Block a user