controller-support
HumanoidSandvichDispenser 2023-08-17 22:14:06 -07:00
parent bc6332e847
commit 3fed7f1171
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
4 changed files with 61 additions and 70 deletions

View File

@ -2,11 +2,18 @@ using Godot;
namespace SupaLidlGame.BoundingBoxes;
public partial class CameraBounds : Area2D
public partial class CameraBounds : Node
{
[Export]
public Area2D Trigger { get; set; }
[Export]
public RectangleShape2D Bounds { get; set; }
public override void _Ready()
{
BodyEntered += OnBodyEntered;
Trigger.BodyEntered += OnBodyEntered;
Trigger.BodyExited += OnBodyExited;
base._Ready();
}
@ -15,7 +22,15 @@ public partial class CameraBounds : Area2D
if (body is Characters.Player player)
{
var camera = player.Camera;
//camera.LimitLeft =
}
}
private void OnBodyExited(Node2D body)
{
if (body is Characters.Player player)
{
var camera = player.Camera;
camera.LimitLeft = -1024;
}
}
}

View File

@ -6,6 +6,9 @@ namespace SupaLidlGame.Entities;
public partial class Projectile : RigidBody2D
{
[Signal]
public delegate void HitEventHandler(BoundingBox box);
//public virtual Vector2 Velocity => Direction * Speed;
public virtual Vector2 Velocity
{
@ -88,6 +91,7 @@ public partial class Projectile : RigidBody2D
Hitbox.Knockback,
knockbackVector: Direction
);
EmitSignal(SignalName.Hit, box);
}
}

View File

@ -1,25 +1,17 @@
[gd_scene load_steps=23 format=3 uid="uid://b2x17su05ou5w"]
[gd_scene load_steps=19 format=3 uid="uid://b2x17su05ou5w"]
[ext_resource type="PackedScene" uid="uid://clwv2owvk6abe" path="res://Scenes/BaseMap.tscn" id="1_ifiic"]
[ext_resource type="TileSet" uid="uid://l61kbx31ug4p" path="res://Scenes/Maps/ArenaTileset.tres" id="2_x0mh7"]
[ext_resource type="PackedScene" uid="uid://d2skjvvx6fal0" path="res://Characters/Doc.tscn" id="4_ej0f3"]
[ext_resource type="Shader" path="res://Shaders/Flash.gdshader" id="5_h8k5p"]
[ext_resource type="Texture2D" uid="uid://dl2q3k0w8e4fp" path="res://Assets/Sprites/Props/tree-dark.png" id="5_wlxp1"]
[ext_resource type="PackedScene" uid="uid://c1w7t6irnohfx" path="res://Entities/Torch.tscn" id="6_1wwor"]
[ext_resource type="Texture2D" uid="uid://ds0xg848g3jid" path="res://Assets/Sprites/Props/tree-dark-5.png" id="6_flapa"]
[ext_resource type="PackedScene" uid="uid://ceadk7pam7vab" path="res://Entities/TorchLamp.tscn" id="6_jy3pc"]
[ext_resource type="Texture2D" uid="uid://d1ukste16yq6v" path="res://Assets/Sprites/Particles/player-light.png" id="7_y7j0e"]
[ext_resource type="AudioStream" uid="uid://dy4qjflo1k28b" path="res://Assets/Sounds/calm-storm-ambient.mp3" id="8_wox7d"]
[ext_resource type="Script" path="res://BoundingBoxes/ConnectorBox.cs" id="9_fg062"]
[ext_resource type="Texture2D" uid="uid://c1a7lvb4uuwfy" path="res://Assets/Sprites/Particles/circle-16.png" id="11_yjp7m"]
[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_2sl6o"]
light_mode = 1
[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_mv7qr"]
light_mode = 1
[sub_resource type="ShaderMaterial" id="ShaderMaterial_tywlr"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_pl6cr"]
resource_local_to_scene = true
shader = ExtResource("5_h8k5p")
shader_parameter/color = Vector4(1, 1, 1, 1)
@ -109,64 +101,44 @@ position = Vector2(120, 95)
y_sort_enabled = true
position = Vector2(97, 120)
[node name="Static@TorchLamp14" parent="Props" index="8" instance=ExtResource("6_jy3pc")]
y_sort_enabled = true
position = Vector2(0, 120)
[node name="Static@TorchLamp16" parent="Props" index="9" instance=ExtResource("6_jy3pc")]
[node name="Static@TorchLamp16" parent="Props" index="8" instance=ExtResource("6_jy3pc")]
y_sort_enabled = true
position = Vector2(-96, 120)
[node name="Static@TorchLamp17" parent="Props" index="10" instance=ExtResource("6_jy3pc")]
[node name="Static@TorchLamp17" parent="Props" index="9" instance=ExtResource("6_jy3pc")]
y_sort_enabled = true
position = Vector2(-120, 95)
[node name="Static@TorchLamp19" parent="Props" index="11" instance=ExtResource("6_jy3pc")]
[node name="Static@TorchLamp19" parent="Props" index="10" instance=ExtResource("6_jy3pc")]
y_sort_enabled = true
position = Vector2(-120, -1)
[node name="Static@Torch" parent="Props" index="12" instance=ExtResource("6_1wwor")]
[node name="Static@Torch" parent="Props" index="11" instance=ExtResource("6_1wwor")]
visible = false
position = Vector2(-120, -112)
[node name="Static@Torch2" parent="Props" index="13" instance=ExtResource("6_1wwor")]
[node name="Static@Torch2" parent="Props" index="12" instance=ExtResource("6_1wwor")]
visible = false
position = Vector2(-72, -112)
[node name="Static@Torch3" parent="Props" index="14" instance=ExtResource("6_1wwor")]
[node name="Static@Torch3" parent="Props" index="13" instance=ExtResource("6_1wwor")]
visible = false
position = Vector2(-24, -113)
[node name="Static@Torch4" parent="Props" index="15" instance=ExtResource("6_1wwor")]
[node name="Static@Torch4" parent="Props" index="14" instance=ExtResource("6_1wwor")]
visible = false
position = Vector2(24, -112)
[node name="Static@Torch5" parent="Props" index="16" instance=ExtResource("6_1wwor")]
[node name="Static@Torch5" parent="Props" index="15" instance=ExtResource("6_1wwor")]
visible = false
position = Vector2(72, -112)
[node name="Static@Torch6" parent="Props" index="17" instance=ExtResource("6_1wwor")]
[node name="Static@Torch6" parent="Props" index="16" instance=ExtResource("6_1wwor")]
visible = false
position = Vector2(120, -112)
[node name="Tree" type="Node2D" parent="Props" index="18"]
z_index = 2
position = Vector2(136, 147)
[node name="Sprite2D" type="Sprite2D" parent="Props/Tree" index="0"]
material = SubResource("CanvasItemMaterial_2sl6o")
texture = ExtResource("5_wlxp1")
[node name="Tree2" type="Node2D" parent="Props" index="19"]
z_index = 2
position = Vector2(168, 51)
[node name="Sprite2D" type="Sprite2D" parent="Props/Tree2" index="0"]
material = SubResource("CanvasItemMaterial_mv7qr")
texture = ExtResource("6_flapa")
[node name="Doc" parent="Entities" index="0" instance=ExtResource("4_ej0f3")]
material = SubResource("ShaderMaterial_tywlr")
material = SubResource("ShaderMaterial_pl6cr")
[node name="PointLight2D" type="PointLight2D" parent="Entities" index="1"]
position = Vector2(168, -42)

View File

@ -8,6 +8,33 @@ shader = ExtResource("1_1rft7")
shader_parameter/a = 0.0
shader_parameter/b = 0.0
[sub_resource type="Animation" id="Animation_c026w"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ColorRect:material:shader_parameter/a")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("ColorRect:material:shader_parameter/b")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
[sub_resource type="Animation" id="Animation_4e8tt"]
resource_name = "enter"
length = 0.75
@ -37,33 +64,6 @@ tracks/1/keys = {
"values": [0.0]
}
[sub_resource type="Animation" id="Animation_c026w"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ColorRect:material:shader_parameter/a")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("ColorRect:material:shader_parameter/b")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
[sub_resource type="Animation" id="Animation_uvf4a"]
resource_name = "exit"
length = 0.25