-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an early combat test and physics layers.
- Loading branch information
Showing
10 changed files
with
110 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
[gd_scene load_steps=3 format=3 uid="uid://op561o2k0d4o"] | ||
[gd_scene load_steps=5 format=3 uid="uid://op561o2k0d4o"] | ||
|
||
[ext_resource type="Script" path="res://scripts/mob/attackable/enemy/aqua_wizard.gd" id="1_2xua2"] | ||
[ext_resource type="PackedScene" uid="uid://bqpe013mgarni" path="res://scripts/mob/attackable/attackable_health.tscn" id="1_051d3"] | ||
[ext_resource type="PackedScene" uid="uid://b3p21o2ljivu2" path="res://assets/characters/npcs/aqua_wizard.glb" id="1_hf2bh"] | ||
|
||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_jxymx"] | ||
radius = 0.573225 | ||
height = 2.59712 | ||
|
||
[node name="AquaWizard" type="CharacterBody3D"] | ||
[node name="AquaWizard" type="CharacterBody3D" node_paths=PackedStringArray("health_manager")] | ||
script = ExtResource("1_2xua2") | ||
health_manager = NodePath("Visuals/Health") | ||
|
||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."] | ||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.29, 0) | ||
shape = SubResource("CapsuleShape3D_jxymx") | ||
|
||
[node name="Visuals" type="Node3D" parent="."] | ||
|
||
[node name="Health" parent="Visuals" instance=ExtResource("1_051d3")] | ||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.59677, 0) | ||
|
||
[node name="AquaWizard" parent="Visuals" instance=ExtResource("1_hf2bh")] | ||
transform = Transform3D(1.5, 0, 0, 0, 1.5, 0, 0, 0, 1.5, 0, 0, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,23 @@ | ||
[gd_scene load_steps=7 format=3 uid="uid://bmicgu6inl8e5"] | ||
[gd_scene load_steps=5 format=3 uid="uid://bmicgu6inl8e5"] | ||
|
||
[ext_resource type="Script" path="res://assets/characters/npcs/larry.gd" id="1_7b1nv"] | ||
[ext_resource type="Script" path="res://scripts/mob/attackable/health_manager.gd" id="1_ile63"] | ||
[ext_resource type="Script" path="res://scripts/mob/attackable/npc/larry.gd" id="1_mma82"] | ||
[ext_resource type="PackedScene" uid="uid://b3p21o2ljivu2" path="res://assets/characters/npcs/aqua_wizard.glb" id="1_perw3"] | ||
[ext_resource type="PackedScene" uid="uid://bb6pl2i42qjqf" path="res://scenes/ui/status_bars/health_bar.tscn" id="2_46ytx"] | ||
[ext_resource type="PackedScene" uid="uid://bqpe013mgarni" path="res://scripts/mob/attackable/attackable_health.tscn" id="2_8ta6c"] | ||
|
||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_tslik"] | ||
radius = 0.376215 | ||
height = 1.77435 | ||
|
||
[sub_resource type="ViewportTexture" id="ViewportTexture_vjeyi"] | ||
viewport_path = NodePath("Visuals/Health/SubViewport") | ||
|
||
[node name="Larry" type="CharacterBody3D" node_paths=PackedStringArray("health_manager")] | ||
script = ExtResource("1_7b1nv") | ||
health_manager = NodePath("Visuals/Health") | ||
[node name="Larry" type="CharacterBody3D"] | ||
script = ExtResource("1_mma82") | ||
|
||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."] | ||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.88408, 0) | ||
shape = SubResource("CapsuleShape3D_tslik") | ||
|
||
[node name="Visuals" type="Node3D" parent="."] | ||
|
||
[node name="Health" type="Node3D" parent="Visuals"] | ||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.72083, 0) | ||
script = ExtResource("1_ile63") | ||
metadata/_edit_lock_ = true | ||
|
||
[node name="SubViewport" type="SubViewport" parent="Visuals/Health"] | ||
transparent_bg = true | ||
size = Vector2i(530, 65) | ||
|
||
[node name="HealthBar" parent="Visuals/Health/SubViewport" instance=ExtResource("2_46ytx")] | ||
|
||
[node name="Sprite" type="Sprite3D" parent="Visuals/Health"] | ||
transform = Transform3D(0.15, 0, 0, 0, 0.15, 0, 0, 0, 0.15, 0, 0.0731125, 0) | ||
texture = SubResource("ViewportTexture_vjeyi") | ||
metadata/_edit_lock_ = true | ||
|
||
[node name="HideTimer" type="Timer" parent="Visuals/Health"] | ||
[node name="Health" parent="Visuals" instance=ExtResource("2_8ta6c")] | ||
|
||
[node name="Larry" parent="Visuals" instance=ExtResource("1_perw3")] | ||
metadata/_edit_lock_ = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[gd_scene load_steps=4 format=3 uid="uid://bqpe013mgarni"] | ||
|
||
[ext_resource type="Script" path="res://scripts/mob/attackable/health_manager.gd" id="1_tkq40"] | ||
[ext_resource type="PackedScene" uid="uid://bb6pl2i42qjqf" path="res://scenes/ui/status_bars/health_bar.tscn" id="2_xssh5"] | ||
|
||
[sub_resource type="ViewportTexture" id="ViewportTexture_pf4sx"] | ||
viewport_path = NodePath("SubViewport") | ||
|
||
[node name="Health" type="Node3D"] | ||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.72083, 0) | ||
script = ExtResource("1_tkq40") | ||
|
||
[node name="SubViewport" type="SubViewport" parent="."] | ||
transparent_bg = true | ||
size = Vector2i(520, 60) | ||
|
||
[node name="HealthBar" parent="SubViewport" instance=ExtResource("2_xssh5")] | ||
anchors_preset = 15 | ||
anchor_left = 0.0 | ||
anchor_top = 0.0 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
offset_left = 0.0 | ||
offset_top = 0.0 | ||
offset_right = 0.0 | ||
offset_bottom = 0.0 | ||
scale = Vector2(0.438, 0.438) | ||
|
||
[node name="Sprite" type="Sprite3D" parent="."] | ||
transform = Transform3D(0.15, 0, 0, 0, 0.15, 0, 0, 0, 0.15, 0, 0.0731125, 0) | ||
texture = SubResource("ViewportTexture_pf4sx") | ||
|
||
[node name="HideTimer" type="Timer" parent="."] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
class_name AquaWizard extends Attackable |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
class_name PhysicsUtils | ||
|
||
const WALL_MASK: int = 1 | ||
const ATTACKABLE_MASK: int = 2 | ||
const PLAYER_MASK: int = 3 | ||
const NPC_MASK: int = 4 | ||
static var ENEMY_MASK: int = 5 | ||
const ITEM_MASK: int = 6 | ||
|
||
const GROUND_MASK: int = 9 | ||
|
||
# Converts an array of layer numbers to a collision mask. | ||
static func arr_to_collision_mask(arr: PackedByteArray): | ||
var val = 0 | ||
for num in arr: | ||
val += pow(2, num - 1) | ||
return val |