Skip to content

Commit

Permalink
#16 Udemy 2.5D RPG Add enemies, After folder reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
John Ludlow committed Sep 6, 2024
1 parent 6f283da commit 4f29550
Show file tree
Hide file tree
Showing 14 changed files with 773 additions and 43 deletions.
28 changes: 14 additions & 14 deletions Udemy25dRpg/Resources/Tiles.tres

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions Udemy25dRpg/Scenes/Characters/Enemy.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[gd_scene load_steps=103 format=3 uid="uid://26cy6bbsdt37"]
[gd_scene load_steps=105 format=3 uid="uid://26cy6bbsdt37"]

[ext_resource type="Texture2D" uid="uid://ckonrd67f8enh" path="res://Assets/Sprites/Characters/Enemy Knight/Attack/0_Demons_of_Darkness_Slashing_000.png" id="1_gty22"]
[ext_resource type="Texture2D" uid="uid://cjdjjbuattvtu" path="res://Assets/Sprites/Characters/Enemy Knight/Idle/0_Demons_of_Darkness_Idle_000.png" id="1_le6bp"]
[ext_resource type="Script" path="res://Scenes/Characters/Enemy.cs" id="1_tph2b"]
[ext_resource type="Script" path="res://Scenes/Characters/Enemy/Enemy.cs" id="1_p0gp1"]
[ext_resource type="Texture2D" uid="uid://b6a43k3p3mr14" path="res://Assets/Sprites/Characters/Enemy Knight/Idle/0_Demons_of_Darkness_Idle_001.png" id="2_1v34l"]
[ext_resource type="Texture2D" uid="uid://d264uonsup8d1" path="res://Assets/Sprites/Characters/Enemy Knight/Attack/0_Demons_of_Darkness_Slashing_001.png" id="2_rlvkw"]
[ext_resource type="Texture2D" uid="uid://dl6cypbwp1oss" path="res://Assets/Sprites/Characters/Enemy Knight/Idle/0_Demons_of_Darkness_Idle_002.png" id="3_2ngr4"]
Expand Down Expand Up @@ -100,6 +100,8 @@
[ext_resource type="Texture2D" uid="uid://i8cbfoeexo0o" path="res://Assets/Sprites/Characters/Enemy Knight/TakeHit/0_Demons_of_Darkness_Hurt_009.png" id="97_ewh1w"]
[ext_resource type="Texture2D" uid="uid://docs320wpoxoc" path="res://Assets/Sprites/Characters/Enemy Knight/TakeHit/0_Demons_of_Darkness_Hurt_010.png" id="98_ok0ba"]
[ext_resource type="Texture2D" uid="uid://b4pv0ny4xgeme" path="res://Assets/Sprites/Characters/Enemy Knight/TakeHit/0_Demons_of_Darkness_Hurt_011.png" id="99_5kr26"]
[ext_resource type="PackedScene" uid="uid://chsjgdc42gn10" path="res://Scenes/Characters/StateMachine.tscn" id="101_x0083"]
[ext_resource type="Script" path="res://Scenes/Characters/Enemy/EnemyIdleState.cs" id="102_6c8r3"]

[sub_resource type="SpriteFrames" id="SpriteFrames_nl2d3"]
animations = [{
Expand Down Expand Up @@ -435,7 +437,7 @@ collision_layer = 4
collision_mask = 7
floor_max_angle = 1.55334
floor_snap_length = 100.0
script = ExtResource("1_tph2b")
script = ExtResource("1_p0gp1")

[node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="."]
sprite_frames = SubResource("SpriteFrames_nl2d3")
Expand All @@ -446,3 +448,9 @@ frame_progress = 1.0
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0016498, -0.0394009, 0.0142541)
shape = SubResource("CapsuleShape3D_vahjm")

[node name="StateMachine" parent="." node_paths=PackedStringArray("PossibleStates") instance=ExtResource("101_x0083")]
PossibleStates = []

[node name="IdleState" type="Node" parent="StateMachine"]
script = ExtResource("102_6c8r3")
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Godot;
using System;

namespace Udemy25dRpg.Scenes.Characters;
namespace Udemy25dRpg.Scenes.Characters.Enemy;

public partial class Enemy : CharacterBody3D
{
Expand Down
448 changes: 448 additions & 0 deletions Udemy25dRpg/Scenes/Characters/Enemy/Enemy.tscn

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions Udemy25dRpg/Scenes/Characters/Enemy/EnemyIdleState.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using Godot;
using System;

namespace Udemy25dRpg.Scenes.Characters.Enemy;

public partial class EnemyIdleState : Node
{
}
27 changes: 12 additions & 15 deletions Udemy25dRpg/Scenes/Characters/Player.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[gd_scene load_steps=57 format=3 uid="uid://2als0j8j6wxe"]

[ext_resource type="Script" path="res://Scenes/Characters/Player.cs" id="1_huxwr"]
[ext_resource type="Script" path="res://Scenes/Characters/Player/Player.cs" id="1_cj25v"]
[ext_resource type="Texture2D" uid="uid://y4hs6pyks4tw" path="res://Assets/Sprites/Characters/Player/Idle Blinking/Idle Blinking_000.png" id="2_2r0yv"]
[ext_resource type="Texture2D" uid="uid://b7lhym3wvu5j6" path="res://Assets/Sprites/Characters/Player/Idle Blinking/Idle Blinking_001.png" id="3_5244l"]
[ext_resource type="Texture2D" uid="uid://cfcjcof4e5sim" path="res://Assets/Sprites/Characters/Player/Idle Blinking/Idle Blinking_002.png" id="4_w2fvd"]
Expand Down Expand Up @@ -38,10 +38,8 @@
[ext_resource type="Texture2D" uid="uid://c0e2lkwh8pug8" path="res://Assets/Sprites/Characters/Player/Kicking/Kicking_004.png" id="30_qlj7e"]
[ext_resource type="Texture2D" uid="uid://iw1x6vq1koq3" path="res://Assets/Sprites/Characters/Player/Kicking/Kicking_005.png" id="31_d7bf5"]
[ext_resource type="Texture2D" uid="uid://cfdxw0sp2nvjx" path="res://Assets/Sprites/Characters/Player/Sliding/Sliding_000.png" id="31_mg83m"]
[ext_resource type="Script" path="res://Scenes/Characters/PlayerIdleState.cs" id="31_w18mu"]
[ext_resource type="Texture2D" uid="uid://ch2kjq2341kk5" path="res://Assets/Sprites/Characters/Player/Kicking/Kicking_006.png" id="32_dq8nx"]
[ext_resource type="Texture2D" uid="uid://cgqfsw1vb5hxj" path="res://Assets/Sprites/Characters/Player/Sliding/Sliding_001.png" id="32_gvagx"]
[ext_resource type="Script" path="res://Scenes/Characters/PlayerMoveState.cs" id="32_vc70e"]
[ext_resource type="Texture2D" uid="uid://ce21e5068dl3o" path="res://Assets/Sprites/Characters/Player/Sliding/Sliding_002.png" id="33_aoq6e"]
[ext_resource type="Texture2D" uid="uid://buk3jem1k5h35" path="res://Assets/Sprites/Characters/Player/Kicking/Kicking_007.png" id="33_uuuus"]
[ext_resource type="Texture2D" uid="uid://cuvd240px1abr" path="res://Assets/Sprites/Characters/Player/Sliding/Sliding_003.png" id="34_356xb"]
Expand All @@ -51,9 +49,11 @@
[ext_resource type="Texture2D" uid="uid://d25iiuab77jhw" path="res://Assets/Sprites/Characters/Player/Kicking/Kicking_010.png" id="36_06eso"]
[ext_resource type="Texture2D" uid="uid://bdv4ygt2vid7x" path="res://Assets/Sprites/Characters/Player/Sliding/Sliding_005.png" id="36_vn2yp"]
[ext_resource type="Texture2D" uid="uid://dbgjebrr1akou" path="res://Assets/Sprites/Characters/Player/Kicking/Kicking_011.png" id="37_flpgl"]
[ext_resource type="Script" path="res://Scenes/Characters/PlayerDashState.cs" id="41_7ie7a"]
[ext_resource type="PackedScene" uid="uid://chsjgdc42gn10" path="res://Scenes/Characters/StateMachine.tscn" id="50_wog05"]
[ext_resource type="Script" path="res://Scenes/Characters/PlayerKickingState.cs" id="54_s5rbi"]
[ext_resource type="Script" path="res://Scenes/Characters/Player/PlayerIdleState.cs" id="51_u4a8w"]
[ext_resource type="Script" path="res://Scenes/Characters/Player/PlayerMoveState.cs" id="52_16s1s"]
[ext_resource type="Script" path="res://Scenes/Characters/Player/PlayerDashState.cs" id="53_pr28m"]
[ext_resource type="Script" path="res://Scenes/Characters/Player/PlayerKickingState.cs" id="54_yxqac"]

[sub_resource type="SpriteFrames" id="SpriteFrames_4gqhn"]
animations = [{
Expand Down Expand Up @@ -226,12 +226,13 @@ animations = [{
radius = 0.501583
height = 1.4337

[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("AnimatedSprite3DNode")]
[node name="Player" type="CharacterBody3D" node_paths=PackedStringArray("StateMachineNode", "AnimatedSprite3DNode")]
collision_layer = 2
collision_mask = 7
floor_max_angle = 1.55334
floor_snap_length = 100.0
script = ExtResource("1_huxwr")
script = ExtResource("1_cj25v")
StateMachineNode = NodePath("StateMachine")
AnimatedSprite3DNode = NodePath("AnimatedSprite3D")

[node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="."]
Expand All @@ -244,25 +245,21 @@ CurrentState = NodePath("IdleState")
PossibleStates = [NodePath("IdleState"), NodePath("MoveState"), NodePath("DashState"), NodePath("KickingState")]

[node name="IdleState" type="Node" parent="StateMachine"]
unique_name_in_owner = true
script = ExtResource("31_w18mu")
script = ExtResource("51_u4a8w")

[node name="MoveState" type="Node" parent="StateMachine"]
unique_name_in_owner = true
script = ExtResource("32_vc70e")
script = ExtResource("52_16s1s")

[node name="DashState" type="Node" parent="StateMachine" node_paths=PackedStringArray("DashTimer")]
unique_name_in_owner = true
script = ExtResource("41_7ie7a")
script = ExtResource("53_pr28m")
DashTimer = NodePath("Timer")

[node name="Timer" type="Timer" parent="StateMachine/DashState"]
wait_time = 0.5
one_shot = true

[node name="KickingState" type="Node" parent="StateMachine"]
unique_name_in_owner = true
script = ExtResource("54_s5rbi")
script = ExtResource("54_yxqac")

[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0281069, 0.0163012, -0.00011313)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Godot;

namespace Udemy25dRpg.Scenes.Characters;
namespace Udemy25dRpg.Scenes.Characters.Player;

public partial class Player : CharacterBody3D
{
Expand Down
Loading

0 comments on commit 4f29550

Please sign in to comment.