mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-07-03 02:31:16 +00:00
Solid walls
This commit is contained in:
parent
eefe35fe73
commit
0322748d86
9 changed files with 94 additions and 52 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_resource type="Resource" script_class="RogueliteMapTheme" load_steps=49 format=3 uid="uid://cw6868vuvuynh"]
|
[gd_resource type="Resource" script_class="RogueliteMapTheme" load_steps=51 format=3 uid="uid://cw6868vuvuynh"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bwtif3if3ea0u" path="res://Scripts/Resources/RogueliteMapTheme.cs" id="1_2rtdw"]
|
[ext_resource type="Script" uid="uid://bwtif3if3ea0u" path="res://Scripts/Resources/RogueliteMapTheme.cs" id="1_2rtdw"]
|
||||||
[ext_resource type="Resource" uid="uid://cltxhkrqp055v" path="res://Resources/Items/Money_Pickup.tres" id="1_ae3bb"]
|
[ext_resource type="Resource" uid="uid://cltxhkrqp055v" path="res://Resources/Items/Money_Pickup.tres" id="1_ae3bb"]
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
[ext_resource type="PackedScene" uid="uid://db5dwj6nqo8fn" path="res://Scenes/Interactable/control_pad_gray_keycard.tscn" id="1_w43eq"]
|
[ext_resource type="PackedScene" uid="uid://db5dwj6nqo8fn" path="res://Scenes/Interactable/control_pad_gray_keycard.tscn" id="1_w43eq"]
|
||||||
[ext_resource type="Resource" uid="uid://oa8s6xydriib" path="res://Resources/Items/Generic_Keycard.tres" id="2_p3lfl"]
|
[ext_resource type="Resource" uid="uid://oa8s6xydriib" path="res://Resources/Items/Generic_Keycard.tres" id="2_p3lfl"]
|
||||||
[ext_resource type="PackedScene" uid="uid://l84on3kv2s52" path="res://Scenes/Door_Horizontal.tscn" id="2_y7x1u"]
|
[ext_resource type="PackedScene" uid="uid://l84on3kv2s52" path="res://Scenes/Door_Horizontal.tscn" id="2_y7x1u"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bs6o3htusgyjl" path="res://Scenes/Door_Horizontal_Hidden.tscn" id="3_sdu6a"]
|
|
||||||
[ext_resource type="Resource" uid="uid://dodwpect0ldjf" path="res://Resources/Items/Heart_Pickup.tres" id="3_tsgja"]
|
[ext_resource type="Resource" uid="uid://dodwpect0ldjf" path="res://Resources/Items/Heart_Pickup.tres" id="3_tsgja"]
|
||||||
[ext_resource type="PackedScene" uid="uid://mtn26qwp4yqy" path="res://Scenes/Items/Gray_Keycard.tscn" id="4_qjf5s"]
|
[ext_resource type="PackedScene" uid="uid://mtn26qwp4yqy" path="res://Scenes/Items/Gray_Keycard.tscn" id="4_qjf5s"]
|
||||||
[ext_resource type="Resource" uid="uid://bhbufxodybsw4" path="res://Resources/Items/Shield_Pickup.tres" id="4_qo6vk"]
|
[ext_resource type="Resource" uid="uid://bhbufxodybsw4" path="res://Resources/Items/Shield_Pickup.tres" id="4_qo6vk"]
|
||||||
|
|
@ -29,7 +28,9 @@
|
||||||
[ext_resource type="Script" uid="uid://rgx0g5iqksnn" path="res://Scripts/Resources/Loot/LootTable.cs" id="11_eegnh"]
|
[ext_resource type="Script" uid="uid://rgx0g5iqksnn" path="res://Scripts/Resources/Loot/LootTable.cs" id="11_eegnh"]
|
||||||
[ext_resource type="Resource" uid="uid://do11fodskgasi" path="res://Resources/RogueliteMaps/RGTestRoom1.tres" id="14_rjphh"]
|
[ext_resource type="Resource" uid="uid://do11fodskgasi" path="res://Resources/RogueliteMaps/RGTestRoom1.tres" id="14_rjphh"]
|
||||||
[ext_resource type="Resource" uid="uid://cur433g6oevmd" path="res://Resources/RogueliteMaps/RGLongAcidWalk.tres" id="15_2gg5d"]
|
[ext_resource type="Resource" uid="uid://cur433g6oevmd" path="res://Resources/RogueliteMaps/RGLongAcidWalk.tres" id="15_2gg5d"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bi6m7am6gry17" path="res://Scenes/Misc/Horizontal_North_Solid_Wall.tscn" id="15_qo6vk"]
|
||||||
[ext_resource type="Resource" uid="uid://cc53bb6th33hi" path="res://Resources/RogueliteMaps/RGHorizontal1x1.tres" id="16_402ix"]
|
[ext_resource type="Resource" uid="uid://cc53bb6th33hi" path="res://Resources/RogueliteMaps/RGHorizontal1x1.tres" id="16_402ix"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://q5mj5fqxy0dv" path="res://Scenes/Misc/Horizontal_South_Solid_Wall.tscn" id="16_ga54h"]
|
||||||
[ext_resource type="Resource" uid="uid://bew4cuec4pbms" path="res://Resources/RogueliteMaps/KeyRoom1.tres" id="17_52l5g"]
|
[ext_resource type="Resource" uid="uid://bew4cuec4pbms" path="res://Resources/RogueliteMaps/KeyRoom1.tres" id="17_52l5g"]
|
||||||
[ext_resource type="Resource" uid="uid://cwtma7mxged8a" path="res://Resources/RogueliteMaps/ShopRoom1.tres" id="18_gh41q"]
|
[ext_resource type="Resource" uid="uid://cwtma7mxged8a" path="res://Resources/RogueliteMaps/ShopRoom1.tres" id="18_gh41q"]
|
||||||
[ext_resource type="Resource" uid="uid://crqgvauqarfaq" path="res://Resources/RogueliteMaps/TreasureRoom1.tres" id="19_bn1n6"]
|
[ext_resource type="Resource" uid="uid://crqgvauqarfaq" path="res://Resources/RogueliteMaps/TreasureRoom1.tres" id="19_bn1n6"]
|
||||||
|
|
@ -37,6 +38,7 @@
|
||||||
[ext_resource type="Resource" uid="uid://bxvv82vno8ub1" path="res://Resources/RogueliteMaps/1x1_1.tres" id="23_p3lfl"]
|
[ext_resource type="Resource" uid="uid://bxvv82vno8ub1" path="res://Resources/RogueliteMaps/1x1_1.tres" id="23_p3lfl"]
|
||||||
[ext_resource type="Resource" uid="uid://d01146n5uo0gd" path="res://Resources/RogueliteMaps/1x2_1.tres" id="24_tsgja"]
|
[ext_resource type="Resource" uid="uid://d01146n5uo0gd" path="res://Resources/RogueliteMaps/1x2_1.tres" id="24_tsgja"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cl7s06sk106uo" path="res://Scenes/Props/VendingMachine.tscn" id="30_exyjy"]
|
[ext_resource type="PackedScene" uid="uid://cl7s06sk106uo" path="res://Scenes/Props/VendingMachine.tscn" id="30_exyjy"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dff3lrk4srymb" path="res://Scenes/Misc/Vertical_Solid_Wall.tscn" id="40_tsgja"]
|
||||||
[ext_resource type="Resource" uid="uid://bdpbekqhuuq4l" path="res://Resources/Items/Shield_Extend_Pickup.tres" id="41_tsgja"]
|
[ext_resource type="Resource" uid="uid://bdpbekqhuuq4l" path="res://Resources/Items/Shield_Extend_Pickup.tres" id="41_tsgja"]
|
||||||
[ext_resource type="Resource" uid="uid://ciybnocjfpshh" path="res://Resources/Items/Heart_Extend_Pickup.tres" id="42_qo6vk"]
|
[ext_resource type="Resource" uid="uid://ciybnocjfpshh" path="res://Resources/Items/Heart_Extend_Pickup.tres" id="42_qo6vk"]
|
||||||
[ext_resource type="PackedScene" uid="uid://c21m7w5ahpsd0" path="res://Scenes/Activable/Shroud.tscn" id="43_3kwn2"]
|
[ext_resource type="PackedScene" uid="uid://c21m7w5ahpsd0" path="res://Scenes/Activable/Shroud.tscn" id="43_3kwn2"]
|
||||||
|
|
@ -70,9 +72,10 @@ script = ExtResource("1_2rtdw")
|
||||||
TileSize = Vector2i(16, 16)
|
TileSize = Vector2i(16, 16)
|
||||||
RoomSizeInTiles = Vector2i(20, 10)
|
RoomSizeInTiles = Vector2i(20, 10)
|
||||||
HorizontalDoorPrefab = ExtResource("2_y7x1u")
|
HorizontalDoorPrefab = ExtResource("2_y7x1u")
|
||||||
HorizontalWallPrefab = ExtResource("3_sdu6a")
|
HorizontalNorthWallPrefab = ExtResource("15_qo6vk")
|
||||||
|
HorizontalSouthWallPrefab = ExtResource("16_ga54h")
|
||||||
VerticalDoorPrefab = ExtResource("5_mt0fe")
|
VerticalDoorPrefab = ExtResource("5_mt0fe")
|
||||||
VerticalWallPrefab = ExtResource("5_mt0fe")
|
VerticalWallPrefab = ExtResource("40_tsgja")
|
||||||
DoorLockPrefab = ExtResource("1_w43eq")
|
DoorLockPrefab = ExtResource("1_w43eq")
|
||||||
KeyCardPrefab = ExtResource("4_qjf5s")
|
KeyCardPrefab = ExtResource("4_qjf5s")
|
||||||
ChestPrefab = ExtResource("1_modrh")
|
ChestPrefab = ExtResource("1_modrh")
|
||||||
|
|
|
||||||
|
|
@ -411,8 +411,7 @@ expand_mode = 1
|
||||||
stretch_mode = 3
|
stretch_mode = 3
|
||||||
|
|
||||||
[node name="FPS" type="Label" parent="."]
|
[node name="FPS" type="Label" parent="."]
|
||||||
visible = false
|
z_index = 20
|
||||||
z_index = 10
|
|
||||||
z_as_relative = false
|
z_as_relative = false
|
||||||
anchors_preset = 3
|
anchors_preset = 3
|
||||||
anchor_left = 1.0
|
anchor_left = 1.0
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,7 @@ script = ExtResource("7_cgxuy")
|
||||||
Enemy = ExtResource("9_tyndx")
|
Enemy = ExtResource("9_tyndx")
|
||||||
|
|
||||||
[node name="NavigationRegion2D" type="NavigationRegion2D" parent="."]
|
[node name="NavigationRegion2D" type="NavigationRegion2D" parent="."]
|
||||||
|
visible = false
|
||||||
navigation_polygon = SubResource("NavigationPolygon_lrgk6")
|
navigation_polygon = SubResource("NavigationPolygon_lrgk6")
|
||||||
|
|
||||||
[node name="PlayerEnterDetector" type="Area2D" parent="."]
|
[node name="PlayerEnterDetector" type="Area2D" parent="."]
|
||||||
|
|
|
||||||
7
Scenes/Misc/Horizontal_North_Solid_Wall.tscn
Normal file
7
Scenes/Misc/Horizontal_North_Solid_Wall.tscn
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
[gd_scene load_steps=2 format=4 uid="uid://bi6m7am6gry17"]
|
||||||
|
|
||||||
|
[ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="1_vyess"]
|
||||||
|
|
||||||
|
[node name="TileMapLayer" type="TileMapLayer" groups=["Solid"]]
|
||||||
|
tile_map_data = PackedByteArray("AAD/////AAAKAAgAAAD//wAAAAAKAAkAAAAAAP//AAAKAAgAAAAAAAAAAAAKAAkAAAABAP//AAAKAAgAAAABAAAAAAAKAAkAAAD+////AAAKAAgAAAD+/wAAAAAKAAkAAAD+//7/AAABAAQAAAD///7/AAABAAQAAAAAAP7/AAABAAQAAAABAP7/AAABAAQAAAA=")
|
||||||
|
tile_set = ExtResource("1_vyess")
|
||||||
8
Scenes/Misc/Horizontal_South_Solid_Wall.tscn
Normal file
8
Scenes/Misc/Horizontal_South_Solid_Wall.tscn
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
[gd_scene load_steps=2 format=3 uid="uid://q5mj5fqxy0dv"]
|
||||||
|
|
||||||
|
[ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="1_pohia"]
|
||||||
|
|
||||||
|
[node name="TileMapLayer" type="TileMapLayer" groups=["Solid"]]
|
||||||
|
z_index = 1
|
||||||
|
tile_map_data = PackedByteArray(0, 0, 254, 255, 255, 255, 0, 0, 1, 0, 4, 0, 0, 0, 255, 255, 255, 255, 0, 0, 1, 0, 4, 0, 0, 0, 0, 0, 255, 255, 0, 0, 1, 0, 4, 0, 0, 0, 1, 0, 255, 255, 0, 0, 1, 0, 4, 0, 0, 0)
|
||||||
|
tile_set = ExtResource("1_pohia")
|
||||||
8
Scenes/Misc/Vertical_Solid_Wall.tscn
Normal file
8
Scenes/Misc/Vertical_Solid_Wall.tscn
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
[gd_scene load_steps=2 format=3 uid="uid://dff3lrk4srymb"]
|
||||||
|
|
||||||
|
[ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="1_m2u8i"]
|
||||||
|
|
||||||
|
[node name="TileMapLayer" type="TileMapLayer" groups=["Solid"]]
|
||||||
|
z_index = 1
|
||||||
|
tile_map_data = PackedByteArray(0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 254, 255, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 255, 255, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0)
|
||||||
|
tile_set = ExtResource("1_m2u8i")
|
||||||
|
|
@ -165,22 +165,21 @@ public partial class RogueliteRoom : Node2D
|
||||||
var connection = connectionChecker.Invoke(doorEdge, neighborPos);
|
var connection = connectionChecker.Invoke(doorEdge, neighborPos);
|
||||||
|
|
||||||
var connected = connection is not null;
|
var connected = connection is not null;
|
||||||
|
|
||||||
|
|
||||||
var door = this.CreateChildOf<Door>(marker, marker.Direction switch
|
|
||||||
{
|
|
||||||
DoorDirections.North => MapTheme.HorizontalDoorPrefab,
|
|
||||||
DoorDirections.South => MapTheme.HorizontalDoorPrefab,
|
|
||||||
DoorDirections.East => MapTheme.VerticalDoorPrefab,
|
|
||||||
DoorDirections.West => MapTheme.VerticalDoorPrefab,
|
|
||||||
_ => throw new ArgumentOutOfRangeException()
|
|
||||||
}, marker.GlobalPosition);
|
|
||||||
|
|
||||||
door.Close();
|
|
||||||
|
|
||||||
// door.State = DoorState.Closed;
|
|
||||||
if (connected)
|
if (connected)
|
||||||
{
|
{
|
||||||
|
var door = this.CreateChildOf<Door>(marker, marker.Direction switch
|
||||||
|
{
|
||||||
|
DoorDirections.North => MapTheme.HorizontalDoorPrefab,
|
||||||
|
DoorDirections.South => MapTheme.HorizontalDoorPrefab,
|
||||||
|
DoorDirections.East => MapTheme.VerticalDoorPrefab,
|
||||||
|
DoorDirections.West => MapTheme.VerticalDoorPrefab,
|
||||||
|
_ => throw new ArgumentOutOfRangeException()
|
||||||
|
}, marker.GlobalPosition);
|
||||||
|
|
||||||
|
door.Close();
|
||||||
|
|
||||||
|
// door.State = DoorState.Closed;
|
||||||
|
|
||||||
_doors.Add(door);
|
_doors.Add(door);
|
||||||
|
|
||||||
if (doorEdge == connection.From)
|
if (doorEdge == connection.From)
|
||||||
|
|
@ -200,7 +199,6 @@ public partial class RogueliteRoom : Node2D
|
||||||
//doorLock.Targets.Add(connection.ToDoor);
|
//doorLock.Targets.Add(connection.ToDoor);
|
||||||
doorLock.ActivationType = ActivationType.Open;
|
doorLock.ActivationType = ActivationType.Open;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (doorEdge == connection.To)
|
else if (doorEdge == connection.To)
|
||||||
{
|
{
|
||||||
|
|
@ -213,12 +211,29 @@ public partial class RogueliteRoom : Node2D
|
||||||
}
|
}
|
||||||
|
|
||||||
_connections.Add(connection);
|
_connections.Add(connection);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// var wall = this.CreateChild<Node2D>(WallPrefab, marker.GlobalPosition);
|
// Move marker based on direction
|
||||||
|
var newMarkerPosition = marker.Direction switch
|
||||||
|
{
|
||||||
|
DoorDirections.East => marker.GlobalPosition + new Vector2(-4,0),
|
||||||
|
DoorDirections.West => marker.GlobalPosition + new Vector2(-12,0),
|
||||||
|
DoorDirections.North => marker.GlobalPosition + new Vector2(0,0),
|
||||||
|
DoorDirections.South => marker.GlobalPosition + new Vector2(0,-2),
|
||||||
|
_ => marker.GlobalPosition
|
||||||
|
};
|
||||||
|
|
||||||
|
marker.GlobalPosition = newMarkerPosition;
|
||||||
|
|
||||||
|
var wall = this.CreateChildOf<Node2D>(marker, marker.Direction switch
|
||||||
|
{
|
||||||
|
DoorDirections.North => MapTheme.HorizontalNorthWallPrefab,
|
||||||
|
DoorDirections.South => MapTheme.HorizontalSouthWallPrefab,
|
||||||
|
DoorDirections.East => MapTheme.VerticalWallPrefab,
|
||||||
|
DoorDirections.West => MapTheme.VerticalWallPrefab,
|
||||||
|
_ => throw new ArgumentOutOfRangeException()
|
||||||
|
}, marker.GlobalPosition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -319,7 +334,6 @@ public partial class RogueliteRoom : Node2D
|
||||||
chest.LootTable.Add(loot);
|
chest.LootTable.Add(loot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SpawnedEnemyOnDeath(EnemyFSMProxy enemy)
|
private void SpawnedEnemyOnDeath(EnemyFSMProxy enemy)
|
||||||
|
|
@ -337,11 +351,12 @@ public partial class RogueliteRoom : Node2D
|
||||||
{
|
{
|
||||||
foreach (var connection in _connections)
|
foreach (var connection in _connections)
|
||||||
{
|
{
|
||||||
if(!connection.IsLocked)
|
if (!connection.IsLocked)
|
||||||
{
|
{
|
||||||
connection.FromDoor?.Open();
|
connection.FromDoor?.Open();
|
||||||
}
|
}
|
||||||
if(!connection.IsLocked)
|
|
||||||
|
if (!connection.IsLocked)
|
||||||
{
|
{
|
||||||
connection.ToDoor?.Open();
|
connection.ToDoor?.Open();
|
||||||
}
|
}
|
||||||
|
|
@ -352,11 +367,12 @@ public partial class RogueliteRoom : Node2D
|
||||||
{
|
{
|
||||||
foreach (var connection in _connections)
|
foreach (var connection in _connections)
|
||||||
{
|
{
|
||||||
if(!connection.IsLocked)
|
if (!connection.IsLocked)
|
||||||
{
|
{
|
||||||
connection.FromDoor?.Close();
|
connection.FromDoor?.Close();
|
||||||
}
|
}
|
||||||
if(!connection.IsLocked)
|
|
||||||
|
if (!connection.IsLocked)
|
||||||
{
|
{
|
||||||
connection.ToDoor?.Close();
|
connection.ToDoor?.Close();
|
||||||
}
|
}
|
||||||
|
|
@ -463,7 +479,5 @@ public partial class RogueliteRoom : Node2D
|
||||||
shroud.Scale = RoomSize;
|
shroud.Scale = RoomSize;
|
||||||
|
|
||||||
_shroud = shroud;
|
_shroud = shroud;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -8,6 +8,7 @@ using Cirno.Scripts.Misc;
|
||||||
using Cirno.Scripts.Resources;
|
using Cirno.Scripts.Resources;
|
||||||
using Godot.Collections;
|
using Godot.Collections;
|
||||||
using Cirno.Scripts.Utils;
|
using Cirno.Scripts.Utils;
|
||||||
|
using Environment = Godot.Environment;
|
||||||
|
|
||||||
public partial class GameManager : Node2D
|
public partial class GameManager : Node2D
|
||||||
{
|
{
|
||||||
|
|
@ -72,7 +73,7 @@ public partial class GameManager : Node2D
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
Instance = this;
|
Instance = this;
|
||||||
|
RenderingServer.SetDefaultClearColor(Colors.Black);
|
||||||
GlobalState.Session.LevelNumber = MapResource.LevelId;
|
GlobalState.Session.LevelNumber = MapResource.LevelId;
|
||||||
|
|
||||||
GlobalState.Instance.ResizeCursor();
|
GlobalState.Instance.ResizeCursor();
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,8 @@ public partial class RogueliteMapTheme : Resource
|
||||||
|
|
||||||
[ExportGroup("Prefabs")]
|
[ExportGroup("Prefabs")]
|
||||||
[Export] public PackedScene HorizontalDoorPrefab { get; set; }
|
[Export] public PackedScene HorizontalDoorPrefab { get; set; }
|
||||||
[Export] public PackedScene HorizontalWallPrefab { get; set; }
|
[Export] public PackedScene HorizontalNorthWallPrefab { get; set; }
|
||||||
|
[Export] public PackedScene HorizontalSouthWallPrefab { get; set; }
|
||||||
[Export] public PackedScene VerticalDoorPrefab { get; set; }
|
[Export] public PackedScene VerticalDoorPrefab { get; set; }
|
||||||
[Export] public PackedScene VerticalWallPrefab { get; set; }
|
[Export] public PackedScene VerticalWallPrefab { get; set; }
|
||||||
[Export] public PackedScene DoorLockPrefab { get; set; }
|
[Export] public PackedScene DoorLockPrefab { get; set; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue