mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-17 21:13:47 +00:00
Strafing and crosshair for FSM player
This commit is contained in:
parent
5073cfea70
commit
af0261ce8e
6 changed files with 170 additions and 23 deletions
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=10 format=3 uid="uid://c4pr2707hbeph"]
|
||||
[gd_scene load_steps=21 format=3 uid="uid://c4pr2707hbeph"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bw2hakslndaxm" path="res://Scripts/Components/FSM/PlayerStateMachine.cs" id="1_mpmil"]
|
||||
[ext_resource type="Script" uid="uid://chwqogny2v8t1" path="res://Scripts/Components/FSM/Player/Init.cs" id="2_i6wc8"]
|
||||
|
|
@ -8,9 +8,59 @@
|
|||
[ext_resource type="PackedScene" uid="uid://crry0rgk7a8sm" path="res://Scenes/Weapons/BaseWeapon.tscn" id="6_8dcio"]
|
||||
[ext_resource type="Script" uid="uid://bo5sgbv1t8ril" path="res://Scripts/Components/Actors/PlayerAnimationProvider.cs" id="7_pmkfo"]
|
||||
[ext_resource type="Script" uid="uid://dq338w2lw5phl" path="res://Scripts/Components/Actors/KeyboardInputProvider.cs" id="8_i6wc8"]
|
||||
[ext_resource type="Script" uid="uid://d208gvthkstvc" path="res://Scripts/Components/Actors/PlayerCrosshairProvider.cs" id="9_s0ir4"]
|
||||
[ext_resource type="Texture2D" uid="uid://cfrvb1moh857m" path="res://Sprites/Crosshair.png" id="10_8dcio"]
|
||||
[ext_resource type="Script" uid="uid://3jxrxcqp3ndr" path="res://Scripts/Components/Actors/PlayerHitboxSpriteProvider.cs" id="10_gp3hw"]
|
||||
[ext_resource type="Texture2D" uid="uid://bwjrdlnysft15" path="res://Sprites/Actors/Focus_Circle.png" id="12_8dcio"]
|
||||
[ext_resource type="Texture2D" uid="uid://bf37ce6jskdel" path="res://Sprites/SmallHitbox.png" id="13_pmkfo"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_b3hxm"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_pmkfo"]
|
||||
atlas = ExtResource("10_8dcio")
|
||||
region = Rect2(0, 0, 8, 8)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_n5ijo"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_pmkfo")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_n5ijo"]
|
||||
atlas = ExtResource("12_8dcio")
|
||||
region = Rect2(0, 0, 32, 32)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_igu66"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_n5ijo")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_igu66"]
|
||||
atlas = ExtResource("13_pmkfo")
|
||||
region = Rect2(0, 0, 4, 4)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_5qlss"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_igu66")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="FSMPlayer" type="CharacterBody2D"]
|
||||
collision_layer = 2
|
||||
collision_mask = 97
|
||||
|
|
@ -21,10 +71,12 @@ InitialState = 1
|
|||
[node name="Init" type="Node2D" parent="."]
|
||||
script = ExtResource("2_i6wc8")
|
||||
|
||||
[node name="Active" type="Node2D" parent="." node_paths=PackedStringArray("_weaponProvider", "_animationProvider", "_inputProvider")]
|
||||
[node name="Active" type="Node2D" parent="." node_paths=PackedStringArray("_weaponProvider", "_animationProvider", "_crosshairProvider", "_hitboxSpriteProvider", "_inputProvider")]
|
||||
script = ExtResource("3_3tuio")
|
||||
_weaponProvider = NodePath("../WeaponProvider")
|
||||
_animationProvider = NodePath("../AnimationProvider")
|
||||
_crosshairProvider = NodePath("../CrosshairProvider")
|
||||
_hitboxSpriteProvider = NodePath("../StrafeSpriteProvider")
|
||||
_inputProvider = NodePath("../InputProvider")
|
||||
State = 1
|
||||
|
||||
|
|
@ -45,3 +97,25 @@ _animatedSprite = NodePath("../AnimatedSprite2D")
|
|||
|
||||
[node name="InputProvider" type="Node2D" parent="."]
|
||||
script = ExtResource("8_i6wc8")
|
||||
|
||||
[node name="CrosshairProvider" type="Node2D" parent="." node_paths=PackedStringArray("AnimatedSprite")]
|
||||
script = ExtResource("9_s0ir4")
|
||||
AnimatedSprite = NodePath("Crosshair")
|
||||
CrosshairDistance = 35.0
|
||||
|
||||
[node name="Crosshair" type="AnimatedSprite2D" parent="CrosshairProvider"]
|
||||
sprite_frames = SubResource("SpriteFrames_n5ijo")
|
||||
|
||||
[node name="StrafeSpriteProvider" type="Node2D" parent="." node_paths=PackedStringArray("Hitbox", "Circle")]
|
||||
show_behind_parent = true
|
||||
script = ExtResource("10_gp3hw")
|
||||
Hitbox = NodePath("Hitbox")
|
||||
Circle = NodePath("MagicCircle")
|
||||
|
||||
[node name="MagicCircle" type="AnimatedSprite2D" parent="StrafeSpriteProvider"]
|
||||
modulate = Color(1, 1, 1, 0.501961)
|
||||
sprite_frames = SubResource("SpriteFrames_igu66")
|
||||
|
||||
[node name="Hitbox" type="AnimatedSprite2D" parent="StrafeSpriteProvider"]
|
||||
z_index = 2
|
||||
sprite_frames = SubResource("SpriteFrames_5qlss")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue