Stat bar and timer
This commit is contained in:
@@ -5,9 +5,7 @@ using Chickensoft.GodotNodeInterfaces;
|
||||
using Chickensoft.Introspection;
|
||||
using Godot;
|
||||
|
||||
public interface IGame : IProvide<IGameRepo>, INode3D
|
||||
{
|
||||
}
|
||||
public interface IGame : IProvide<IGameRepo>, INode3D;
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
public partial class Game : Node3D, IGame
|
||||
@@ -38,6 +36,7 @@ public partial class Game : Node3D, IGame
|
||||
GameLogic.Set(AppRepo);
|
||||
}
|
||||
|
||||
|
||||
public void OnResolved()
|
||||
{
|
||||
GameBinding = GameLogic.Bind();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=14 format=3 uid="uid://33ek675mfb5n"]
|
||||
[gd_scene load_steps=13 format=3 uid="uid://33ek675mfb5n"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/game/Game.cs" id="1_ytcii"]
|
||||
[ext_resource type="PackedScene" uid="uid://cfecvvav8kkp6" path="res://src/player/Player.tscn" id="3_kk6ly"]
|
||||
@@ -8,7 +8,6 @@
|
||||
[ext_resource type="PackedScene" uid="uid://bwbofurcvf3yh" path="res://src/minimap/Minimap.tscn" id="6_owlf4"]
|
||||
[ext_resource type="PackedScene" uid="uid://bn4gslp2gk8ds" path="res://src/map/dungeon/corridor/Corridor.tscn" id="6_swtay"]
|
||||
[ext_resource type="PackedScene" uid="uid://bbwgmqy3evhh2" path="res://src/map/dungeon/rooms/Room2.tscn" id="7_1ynbc"]
|
||||
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="9_p0lbc"]
|
||||
|
||||
[sub_resource type="Environment" id="Environment_fke5g"]
|
||||
|
||||
@@ -67,92 +66,68 @@ dungeon_size = Vector3i(10, 1, 10)
|
||||
|
||||
[node name="RoomsContainer" type="Node3D" parent="DungeonGenerator3D"]
|
||||
|
||||
[node name="DungeonRoom3D_0" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("7_1ynbc")]
|
||||
[node name="DungeonRoom3D_0" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("7_1ynbc")]
|
||||
transform = Transform3D(1.19249e-08, 0, -1, 0, 1, 0, 1, 0, 1.19249e-08, -15, 0, 15)
|
||||
script = ExtResource("9_p0lbc")
|
||||
size_in_voxels = Vector3i(5, 1, 1)
|
||||
|
||||
[node name="DungeonRoom3D_1" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_04w8n")]
|
||||
[node name="DungeonRoom3D_1" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_04w8n")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -15, 0, -35)
|
||||
script = ExtResource("9_p0lbc")
|
||||
|
||||
[node name="DungeonRoom3D_2" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_04w8n")]
|
||||
[node name="DungeonRoom3D_2" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_04w8n")]
|
||||
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 25, 0, -45)
|
||||
script = ExtResource("9_p0lbc")
|
||||
|
||||
[node name="DungeonRoom3D_3" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("7_1ynbc")]
|
||||
[node name="DungeonRoom3D_3" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("7_1ynbc")]
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 15, 0, -25)
|
||||
script = ExtResource("9_p0lbc")
|
||||
size_in_voxels = Vector3i(5, 1, 1)
|
||||
|
||||
[node name="Corridor_4" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
[node name="Corridor_4" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -15, 0, -15)
|
||||
script = ExtResource("9_p0lbc")
|
||||
|
||||
[node name="Corridor_5" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
[node name="Corridor_5" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -15, 0, -25)
|
||||
script = ExtResource("9_p0lbc")
|
||||
|
||||
[node name="Corridor_6" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
[node name="Corridor_6" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -15, 0, -45)
|
||||
script = ExtResource("9_p0lbc")
|
||||
|
||||
[node name="Corridor_7" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
[node name="Corridor_7" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5, 0, -45)
|
||||
script = ExtResource("9_p0lbc")
|
||||
|
||||
[node name="Corridor_8" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
[node name="Corridor_8" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5, 0, -45)
|
||||
script = ExtResource("9_p0lbc")
|
||||
|
||||
[node name="Corridor_9" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
[node name="Corridor_9" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 15, 0, -45)
|
||||
script = ExtResource("9_p0lbc")
|
||||
|
||||
[node name="Corridor_10" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
[node name="Corridor_10" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -15, 0, 45)
|
||||
script = ExtResource("9_p0lbc")
|
||||
|
||||
[node name="Corridor_11" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
[node name="Corridor_11" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -25, 0, 45)
|
||||
script = ExtResource("9_p0lbc")
|
||||
|
||||
[node name="Corridor_12" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
[node name="Corridor_12" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -25, 0, 35)
|
||||
script = ExtResource("9_p0lbc")
|
||||
|
||||
[node name="Corridor_13" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
[node name="Corridor_13" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -25, 0, 25)
|
||||
script = ExtResource("9_p0lbc")
|
||||
|
||||
[node name="Corridor_14" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
[node name="Corridor_14" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -25, 0, 15)
|
||||
script = ExtResource("9_p0lbc")
|
||||
|
||||
[node name="Corridor_15" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
[node name="Corridor_15" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -25, 0, 5)
|
||||
script = ExtResource("9_p0lbc")
|
||||
|
||||
[node name="Corridor_16" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
[node name="Corridor_16" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -25, 0, -5)
|
||||
script = ExtResource("9_p0lbc")
|
||||
|
||||
[node name="Corridor_17" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
[node name="Corridor_17" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -25, 0, -15)
|
||||
script = ExtResource("9_p0lbc")
|
||||
|
||||
[node name="Corridor_18" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
[node name="Corridor_18" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 35, 0, -45)
|
||||
script = ExtResource("9_p0lbc")
|
||||
|
||||
[node name="Corridor_19" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
[node name="Corridor_19" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 35, 0, -35)
|
||||
script = ExtResource("9_p0lbc")
|
||||
|
||||
[node name="Corridor_20" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
[node name="Corridor_20" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 45, 0, -35)
|
||||
script = ExtResource("9_p0lbc")
|
||||
|
||||
[node name="Corridor_21" type="Node3D" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
[node name="Corridor_21" parent="DungeonGenerator3D/RoomsContainer" instance=ExtResource("6_swtay")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 45, 0, -25)
|
||||
script = ExtResource("9_p0lbc")
|
||||
|
||||
@@ -24,6 +24,10 @@ public interface IGameRepo : IDisposable
|
||||
void SetPlayerGlobalPosition(Vector3 playerGlobalPosition);
|
||||
|
||||
public Weapon EquippedWeapon { get; }
|
||||
|
||||
public AutoProp<int> HPBarValue { get; }
|
||||
|
||||
public AutoProp<int> VTBarValue { get; }
|
||||
}
|
||||
|
||||
public class GameRepo : IGameRepo
|
||||
@@ -46,6 +50,10 @@ public class GameRepo : IGameRepo
|
||||
private Weapon _equippedWeapon;
|
||||
public Weapon EquippedWeapon => _equippedWeapon;
|
||||
|
||||
public AutoProp<int> HPBarValue { get; }
|
||||
|
||||
public AutoProp<int> VTBarValue { get; }
|
||||
|
||||
private bool _disposedValue;
|
||||
|
||||
public GameRepo()
|
||||
@@ -55,6 +63,8 @@ public class GameRepo : IGameRepo
|
||||
_isPaused = new AutoProp<bool>(false);
|
||||
_playerGlobalPosition = new AutoProp<Vector3>(Vector3.Zero);
|
||||
_equippedWeapon = new Weapon();
|
||||
HPBarValue = new AutoProp<int>(0);
|
||||
VTBarValue = new AutoProp<int>(0);
|
||||
}
|
||||
|
||||
public void Pause()
|
||||
|
||||
Reference in New Issue
Block a user