upgrade to godot 4.1

item-info
John Montagu, the 4th Earl of Sandvich 2023-03-22 21:22:51 -07:00
parent ac14ed0aee
commit 7f042f0130
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
13 changed files with 75 additions and 20 deletions

View File

@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/forsen.png-c75844516d35dfe104cf50cd521a7820.c
[params] [params]
compress/mode=0 compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/hdr_compression=1 compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 compress/channel_pack=0
mipmaps/generate=false mipmaps/generate=false

View File

@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/point-light.png-2a3976318d4aaede46957261acffe
[params] [params]
compress/mode=0 compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/hdr_compression=1 compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 compress/channel_pack=0
mipmaps/generate=false mipmaps/generate=false

View File

@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/campfire.png-15ae3109f3a9a9b4ebf5bffb3876d86b
[params] [params]
compress/mode=0 compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/hdr_compression=1 compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 compress/channel_pack=0
mipmaps/generate=false mipmaps/generate=false

View File

@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/knife.png-29bc4ddc148b964cb9b086eec2187a96.ct
[params] [params]
compress/mode=0 compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/hdr_compression=1 compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 compress/channel_pack=0
mipmaps/generate=false mipmaps/generate=false

View File

@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/sword-swing.png-b3fe38b6ad54820f8f9984baa9ea7
[params] [params]
compress/mode=0 compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/hdr_compression=1 compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 compress/channel_pack=0
mipmaps/generate=false mipmaps/generate=false

View File

@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/tileset.png-f52e8e44f74a535dd898a49592afe6d9.
[params] [params]
compress/mode=0 compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/hdr_compression=1 compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 compress/channel_pack=0
mipmaps/generate=false mipmaps/generate=false

View File

@ -0,0 +1,14 @@
using Godot;
using System;
namespace SupaLidlGame.BoundingBoxes
{
public partial class ConnectorBox : Area2D
{
[Export]
public string ToArea { get; set; }
[Export]
public string ToConnector { get; set; }
}
}

View File

@ -6,16 +6,6 @@ namespace SupaLidlGame.Extensions
{ {
public static class AudioStreamPlayer2DExtensions public static class AudioStreamPlayer2DExtensions
{ {
public static AudioBuilder Derive(this AudioStreamPlayer2D audio)
{
var clone = audio.Duplicate() as AudioStreamPlayer2D;
clone.Finished += () =>
{
clone.QueueFree();
};
return new AudioBuilder(clone);
}
public static AudioStreamPlayer2D Clone( public static AudioStreamPlayer2D Clone(
this AudioStreamPlayer2D audio) this AudioStreamPlayer2D audio)
{ {

View File

@ -1,5 +1,6 @@
[gd_scene load_steps=7 format=3 uid="uid://dd6xy1y0m8smm"] [gd_scene load_steps=8 format=3 uid="uid://dd6xy1y0m8smm"]
[ext_resource type="Script" path="res://Utils/World.cs" id="1_1k6ew"]
[ext_resource type="Texture2D" uid="uid://gm2pcnfg7h8j" path="res://Assets/Sprites/tileset.png" id="1_k6myx"] [ext_resource type="Texture2D" uid="uid://gm2pcnfg7h8j" path="res://Assets/Sprites/tileset.png" id="1_k6myx"]
[ext_resource type="PackedScene" uid="uid://b2254pup8k161" path="res://Characters/Player.tscn" id="1_m35hr"] [ext_resource type="PackedScene" uid="uid://b2254pup8k161" path="res://Characters/Player.tscn" id="1_m35hr"]
[ext_resource type="PackedScene" uid="uid://ddcf6bfv212wj" path="res://Characters/ExampleEnemy.tscn" id="2_uti3y"] [ext_resource type="PackedScene" uid="uid://ddcf6bfv212wj" path="res://Characters/ExampleEnemy.tscn" id="2_uti3y"]
@ -1110,6 +1111,7 @@ physics_layer_0/collision_layer = 1
sources/0 = SubResource("TileSetAtlasSource_1pa1q") sources/0 = SubResource("TileSetAtlasSource_1pa1q")
[node name="World" type="Node2D"] [node name="World" type="Node2D"]
script = ExtResource("1_1k6ew")
[node name="TileMap" type="TileMap" parent="."] [node name="TileMap" type="TileMap" parent="."]
y_sort_enabled = true y_sort_enabled = true

View File

@ -1,4 +1,4 @@
<Project Sdk="Godot.NET.Sdk/4.0.0"> <Project Sdk="Godot.NET.Sdk/4.1.0-dev">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading> <EnableDynamicLoading>true</EnableDynamicLoading>

49
Utils/World.cs 100644
View File

@ -0,0 +1,49 @@
using Godot;
using SupaLidlGame.Characters;
using System.Collections.Generic;
namespace SupaLidlGame.Utils
{
public partial class World : Node2D
{
[Export]
public string StartingArea { get; set; }
[Export]
public string CurrentArea { get; protected set; }
[Export]
public Player CurrentPlayer { get; set; }
private Dictionary<string, TileMap> maps;
private string _currentConnector;
public World()
{
maps = new Dictionary<string, TileMap>();
}
public override void _Ready()
{
base._Ready();
}
public override void _Process(double delta)
{
base._Process(delta);
}
public void MoveToArea(string area, string connector)
{
if (area != CurrentArea)
{
// remove current map and load in the new map
TileMap map = GetNode<TileMap>(CurrentArea);
CurrentArea = area;
}
_currentConnector = connector;
}
}
}

View File

@ -16,9 +16,9 @@ dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.cte
[params] [params]
compress/mode=0 compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7 compress/lossy_quality=0.7
compress/hdr_compression=1 compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0 compress/normal_map=0
compress/channel_pack=0 compress/channel_pack=0
mipmaps/generate=false mipmaps/generate=false

View File

@ -12,7 +12,7 @@ config_version=5
config/name="SupaLidlGame" config/name="SupaLidlGame"
run/main_scene="res://Scenes/Level.tscn" run/main_scene="res://Scenes/Level.tscn"
config/features=PackedStringArray("4.0", "C#", "Forward Plus") config/features=PackedStringArray("4.1", "C#", "Forward Plus")
config/icon="res://icon.svg" config/icon="res://icon.svg"
[dotnet] [dotnet]