Basic projectile implementation

This commit is contained in:
2024-09-15 02:37:32 -07:00
parent b42b248c0b
commit 470b853916
7 changed files with 209 additions and 47 deletions

View File

@@ -123,6 +123,7 @@ namespace GameJamDungeon
var attackSpeed = PlayerData.Inventory.EquippedWeapon.Value.WeaponStats.AttackSpeed;
AnimationPlayer.SetSpeedScale((float)attackSpeed);
AnimationPlayer.Play("attack");
SwordSlashAnimation.Play("attack");
})
.Handle((in PlayerLogic.Output.ThrowItem output) =>
{
@@ -131,7 +132,6 @@ namespace GameJamDungeon
this.Provide();
PlayerLogic.Start();
GameRepo.SetPlayerData(PlayerData);
SwordSlashAnimation.Position = GetViewport().GetVisibleRect().Size / 2;
GlobalPosition = GameRepo.PlayerGlobalPosition.Value;
GameRepo.PlayerGlobalPosition.Sync += PlayerGlobalPosition_Sync;
HealthTimer.Timeout += OnHealthTimerTimeout;
@@ -177,6 +177,7 @@ namespace GameJamDungeon
{
PlayerLogic.Input(new PlayerLogic.Input.PhysicsTick(delta));
SwordSlashAnimation.Position = GetViewport().GetVisibleRect().Size / 2;
MoveAndSlide();
PlayerLogic.Input(new PlayerLogic.Input.Moved(GlobalPosition, GlobalTransform));

View File

@@ -1,14 +1,9 @@
[gd_scene load_steps=19 format=3 uid="uid://cfecvvav8kkp6"]
[gd_scene load_steps=34 format=3 uid="uid://cfecvvav8kkp6"]
[ext_resource type="Script" path="res://src/player/Player.cs" id="1_xcol5"]
[ext_resource type="Texture2D" uid="uid://bokx3h8kfdo5i" path="res://src/vfx/slash/slash_0000_Classic_30.png" id="2_la11l"]
[ext_resource type="Script" path="res://src/hitbox/Hitbox.cs" id="2_lb3qc"]
[ext_resource type="Script" path="res://src/player/PlayerStatResource.cs" id="2_xq68d"]
[ext_resource type="Texture2D" uid="uid://byosr5gk51237" path="res://src/vfx/slash/slash_0001_Classic_29.png" id="3_ux3f1"]
[ext_resource type="Texture2D" uid="uid://nh071o6ii03j" path="res://src/vfx/slash/slash_0002_Classic_28.png" id="4_gqnq0"]
[ext_resource type="Texture2D" uid="uid://bodfblud4kea3" path="res://src/vfx/slash/slash_0003_Classic_27.png" id="5_eebal"]
[ext_resource type="Texture2D" uid="uid://de55prolicl0u" path="res://src/vfx/slash/slash_0004_Classic_26.png" id="6_ngag5"]
[ext_resource type="Texture2D" uid="uid://bp0msic3uk3kc" path="res://src/vfx/slash/slash_0005_Layer-1.png" id="7_tp5uu"]
[ext_resource type="Texture2D" uid="uid://c6r3dhnkuw22w" path="res://src/vfx/Weapon Strikes/FIRE_STRIKE_1.0.png" id="5_wr6lo"]
[ext_resource type="PackedScene" uid="uid://ctwtksu2406c" path="res://src/player/dont_look_in_here/player_model.tscn" id="10_prmgx"]
[sub_resource type="Resource" id="Resource_btp2w"]
@@ -44,25 +39,13 @@ length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SwordSlashAnimation:frame")
tracks/0/path = NodePath("Hitbox/HitboxCollision:disabled")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [0]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Hitbox/HitboxCollision:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
@@ -72,22 +55,10 @@ length = 0.7
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("SwordSlashAnimation:frame")
tracks/0/path = NodePath("Hitbox/HitboxCollision:disabled")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.0667, 0.1667, 0.2667, 0.366667, 0.433333, 0.5, 0.6333),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [0, 1, 2, 3, 4, 5, 6, 7]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Hitbox/HitboxCollision:disabled")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.1667, 0.3333),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
@@ -100,29 +71,148 @@ _data = {
"attack": SubResource("Animation_0jjwv")
}
[sub_resource type="AtlasTexture" id="AtlasTexture_fha34"]
atlas = ExtResource("5_wr6lo")
region = Rect2(0, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_6es8e"]
atlas = ExtResource("5_wr6lo")
region = Rect2(450, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_ajsk2"]
atlas = ExtResource("5_wr6lo")
region = Rect2(1350, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_m6lxd"]
atlas = ExtResource("5_wr6lo")
region = Rect2(2250, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_66iny"]
atlas = ExtResource("5_wr6lo")
region = Rect2(3150, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_ifj8k"]
atlas = ExtResource("5_wr6lo")
region = Rect2(4050, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_0sse1"]
atlas = ExtResource("5_wr6lo")
region = Rect2(4950, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_biijj"]
atlas = ExtResource("5_wr6lo")
region = Rect2(5850, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_ox7ae"]
atlas = ExtResource("5_wr6lo")
region = Rect2(6750, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_0jda2"]
atlas = ExtResource("5_wr6lo")
region = Rect2(7650, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_6i1pl"]
atlas = ExtResource("5_wr6lo")
region = Rect2(8550, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_ivimc"]
atlas = ExtResource("5_wr6lo")
region = Rect2(9450, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_3pwkw"]
atlas = ExtResource("5_wr6lo")
region = Rect2(10350, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_fr7ff"]
atlas = ExtResource("5_wr6lo")
region = Rect2(11250, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_yopcg"]
atlas = ExtResource("5_wr6lo")
region = Rect2(12150, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_j6465"]
atlas = ExtResource("5_wr6lo")
region = Rect2(13050, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_sqdiu"]
atlas = ExtResource("5_wr6lo")
region = Rect2(13950, 0, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_p3jka"]
atlas = ExtResource("5_wr6lo")
region = Rect2(0, 450, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_1g7qb"]
atlas = ExtResource("5_wr6lo")
region = Rect2(900, 450, 450, 450)
[sub_resource type="AtlasTexture" id="AtlasTexture_7ab4x"]
atlas = ExtResource("5_wr6lo")
region = Rect2(1800, 450, 450, 450)
[sub_resource type="SpriteFrames" id="SpriteFrames_ywvvo"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": null
"texture": SubResource("AtlasTexture_fha34")
}, {
"duration": 1.0,
"texture": ExtResource("2_la11l")
"texture": SubResource("AtlasTexture_6es8e")
}, {
"duration": 1.0,
"texture": ExtResource("3_ux3f1")
"texture": SubResource("AtlasTexture_ajsk2")
}, {
"duration": 1.0,
"texture": ExtResource("4_gqnq0")
"texture": SubResource("AtlasTexture_m6lxd")
}, {
"duration": 1.0,
"texture": ExtResource("5_eebal")
"texture": SubResource("AtlasTexture_66iny")
}, {
"duration": 1.0,
"texture": ExtResource("6_ngag5")
"texture": SubResource("AtlasTexture_ifj8k")
}, {
"duration": 1.0,
"texture": ExtResource("7_tp5uu")
"texture": SubResource("AtlasTexture_0sse1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_biijj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ox7ae")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_0jda2")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_6i1pl")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ivimc")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_3pwkw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_fr7ff")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_yopcg")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_j6465")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_sqdiu")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_p3jka")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_1g7qb")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_7ab4x")
}, {
"duration": 1.0,
"texture": null
@@ -179,12 +269,6 @@ libraries = {
"": SubResource("AnimationLibrary_w8l8m")
}
[node name="SwordSlashAnimation" type="AnimatedSprite2D" parent="."]
unique_name_in_owner = true
scale = Vector2(9.03192, 6.39623)
sprite_frames = SubResource("SpriteFrames_ywvvo")
animation = &"attack"
[node name="HealthTimer" type="Timer" parent="."]
unique_name_in_owner = true
process_mode = 1
@@ -193,3 +277,12 @@ autostart = true
[node name="player_model" parent="." instance=ExtResource("10_prmgx")]
visible = false
[node name="SwordSlashAnimation" type="AnimatedSprite2D" parent="."]
unique_name_in_owner = true
texture_filter = 1
position = Vector2(900, 565)
scale = Vector2(1.8, 1.8)
sprite_frames = SubResource("SpriteFrames_ywvvo")
animation = &"attack"
frame = 6

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c6r3dhnkuw22w"
path="res://.godot/imported/FIRE_STRIKE_1.0.png-99f3e00032e79a9fb3eea29378859d3a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/vfx/Weapon Strikes/FIRE_STRIKE_1.0.png"
dest_files=["res://.godot/imported/FIRE_STRIKE_1.0.png-99f3e00032e79a9fb3eea29378859d3a.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dw41v352onc0a"
path="res://.godot/imported/WATER_STRIKE_1.0.png-a6edb07d301bc64df48872862f6459ee.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://src/vfx/Weapon Strikes/WATER_STRIKE_1.0.png"
dest_files=["res://.godot/imported/WATER_STRIKE_1.0.png-a6edb07d301bc64df48872862f6459ee.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0