diff --git a/.DS_Store b/.DS_Store index 8ecaa61..870154f 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/ActionRPG-HeartBeast/.DS_Store b/ActionRPG-HeartBeast/.DS_Store index f01a4aa..a3b219d 100644 Binary files a/ActionRPG-HeartBeast/.DS_Store and b/ActionRPG-HeartBeast/.DS_Store differ diff --git a/ActionRPG-HeartBeast/Effects/GrassEffect.gd b/ActionRPG-HeartBeast/Effects/GrassEffect.gd new file mode 100644 index 0000000..03525a4 --- /dev/null +++ b/ActionRPG-HeartBeast/Effects/GrassEffect.gd @@ -0,0 +1,10 @@ +extends Node2D + +onready var animatedSprite = $AnimatedSprite + +func _ready(): + animatedSprite.frame = 0 + animatedSprite.play("Animate") + +func _on_AnimatedSprite_animation_finished(): + queue_free() diff --git a/ActionRPG-HeartBeast/Effects/GrassEffect.tscn b/ActionRPG-HeartBeast/Effects/GrassEffect.tscn new file mode 100644 index 0000000..f8cb10c --- /dev/null +++ b/ActionRPG-HeartBeast/Effects/GrassEffect.tscn @@ -0,0 +1,43 @@ +[gd_scene load_steps=9 format=2] + +[ext_resource path="res://Effects/GrassEffect.gd" type="Script" id=1] +[ext_resource path="res://Effects/GrassEffect.png" type="Texture" id=2] + +[sub_resource type="AtlasTexture" id=1] +atlas = ExtResource( 2 ) +region = Rect2( 0, 0, 32, 32 ) + +[sub_resource type="AtlasTexture" id=2] +atlas = ExtResource( 2 ) +region = Rect2( 32, 0, 32, 32 ) + +[sub_resource type="AtlasTexture" id=3] +atlas = ExtResource( 2 ) +region = Rect2( 64, 0, 32, 32 ) + +[sub_resource type="AtlasTexture" id=4] +atlas = ExtResource( 2 ) +region = Rect2( 96, 0, 32, 32 ) + +[sub_resource type="AtlasTexture" id=5] +atlas = ExtResource( 2 ) +region = Rect2( 128, 0, 32, 32 ) + +[sub_resource type="SpriteFrames" id=6] +animations = [ { +"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ) ], +"loop": false, +"name": "Animate", +"speed": 15.0 +} ] + +[node name="GrassEffect" type="Node2D"] +script = ExtResource( 1 ) + +[node name="AnimatedSprite" type="AnimatedSprite" parent="."] +frames = SubResource( 6 ) +animation = "Animate" +frame = 4 +centered = false + +[connection signal="animation_finished" from="AnimatedSprite" to="." method="_on_AnimatedSprite_animation_finished"] diff --git a/ActionRPG-HeartBeast/Overlap/Hitbox.tscn b/ActionRPG-HeartBeast/Overlap/Hitbox.tscn new file mode 100644 index 0000000..8571387 --- /dev/null +++ b/ActionRPG-HeartBeast/Overlap/Hitbox.tscn @@ -0,0 +1,7 @@ +[gd_scene format=2] + +[node name="Hitbox" type="Area2D"] +collision_layer = 0 +collision_mask = 0 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] diff --git a/ActionRPG-HeartBeast/Overlap/Hurtbox.tscn b/ActionRPG-HeartBeast/Overlap/Hurtbox.tscn new file mode 100644 index 0000000..c8be2c0 --- /dev/null +++ b/ActionRPG-HeartBeast/Overlap/Hurtbox.tscn @@ -0,0 +1,7 @@ +[gd_scene format=2] + +[node name="Hurtbox" type="Area2D"] +collision_layer = 0 +collision_mask = 0 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] diff --git a/ActionRPG-HeartBeast/Player/Player.gd b/ActionRPG-HeartBeast/Player/Player.gd index fa9da65..bf5b4d2 100644 --- a/ActionRPG-HeartBeast/Player/Player.gd +++ b/ActionRPG-HeartBeast/Player/Player.gd @@ -22,7 +22,7 @@ onready var animationState = animationTree.get("parameters/playback") func _ready(): animationTree.active = true -func _physics_process(delta): +func _process(delta): match state: MOVE: move_state(delta) diff --git a/ActionRPG-HeartBeast/Player/Player.tscn b/ActionRPG-HeartBeast/Player/Player.tscn index 0c84d52..8b9c310 100644 --- a/ActionRPG-HeartBeast/Player/Player.tscn +++ b/ActionRPG-HeartBeast/Player/Player.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=40 format=2] +[gd_scene load_steps=42 format=2] [ext_resource path="res://Player/Player.gd" type="Script" id=1] [ext_resource path="res://Player/Player.png" type="Texture" id=2] +[ext_resource path="res://Overlap/Hitbox.tscn" type="PackedScene" id=3] [sub_resource type="CapsuleShape2D" id=1] radius = 4.0 @@ -36,6 +37,30 @@ tracks/1/keys = { "method": "attack_aninimation_finished" } ] } +tracks/2/type = "value" +tracks/2/path = NodePath("HitboxPivot:rotation_degrees") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ 90.0 ] +} +tracks/3/type = "value" +tracks/3/path = NodePath("HitboxPivot/SwordHitbox/CollisionShape2D:disabled") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/keys = { +"times": PoolRealArray( 0.1, 0.4 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 1, +"values": [ false, true ] +} [sub_resource type="Animation" id=28] resource_name = "AttackLeft" @@ -66,6 +91,30 @@ tracks/1/keys = { "method": "attack_aninimation_finished" } ] } +tracks/2/type = "value" +tracks/2/path = NodePath("HitboxPivot:rotation_degrees") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ 180.0 ] +} +tracks/3/type = "value" +tracks/3/path = NodePath("HitboxPivot/SwordHitbox/CollisionShape2D:disabled") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/keys = { +"times": PoolRealArray( 0.1, 0.4 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 1, +"values": [ false, true ] +} [sub_resource type="Animation" id=29] resource_name = "AttackRight" @@ -77,7 +126,7 @@ tracks/0/loop_wrap = true tracks/0/imported = false tracks/0/enabled = true tracks/0/keys = { -"times": PoolRealArray( 0, 0.1, 0.2, 0.3 ), +"times": PoolRealArray( 0, 0.100979, 0.2, 0.3 ), "transitions": PoolRealArray( 1, 1, 1, 1 ), "update": 1, "values": [ 24, 25, 26, 27 ] @@ -96,6 +145,30 @@ tracks/1/keys = { "method": "attack_aninimation_finished" } ] } +tracks/2/type = "value" +tracks/2/path = NodePath("HitboxPivot:rotation_degrees") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ 0.0 ] +} +tracks/3/type = "value" +tracks/3/path = NodePath("HitboxPivot/SwordHitbox/CollisionShape2D:disabled") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/keys = { +"times": PoolRealArray( 0.1, 0.4 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 1, +"values": [ false, true ] +} [sub_resource type="Animation" id=30] resource_name = "AttackUp" @@ -126,6 +199,30 @@ tracks/1/keys = { "method": "attack_aninimation_finished" } ] } +tracks/2/type = "value" +tracks/2/path = NodePath("HitboxPivot:rotation_degrees") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ 270.0 ] +} +tracks/3/type = "value" +tracks/3/path = NodePath("HitboxPivot/SwordHitbox/CollisionShape2D:disabled") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/keys = { +"times": PoolRealArray( 0.106438, 0.4 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 1, +"values": [ false, true ] +} [sub_resource type="Animation" id=9] resource_name = "IdleDown" @@ -209,6 +306,18 @@ tracks/0/keys = { "update": 0, "values": [ 0 ] } +tracks/1/type = "value" +tracks/1/path = NodePath("HitboxPivot/SwordHitbox/CollisionShape2D:disabled") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ true ] +} [sub_resource type="Animation" id=6] resource_name = "RunDown" @@ -377,7 +486,11 @@ start_node = "Idle" [sub_resource type="AnimationNodeStateMachinePlayback" id=19] +[sub_resource type="CapsuleShape2D" id=40] +height = 12.0 + [node name="Player" type="KinematicBody2D"] +collision_layer = 2 script = ExtResource( 1 ) [node name="Sprite" type="Sprite" parent="."] @@ -411,3 +524,20 @@ parameters/playback = SubResource( 19 ) parameters/Attack/blend_position = Vector2( 0, 0 ) parameters/Idle/blend_position = Vector2( 0, 0 ) parameters/Run/blend_position = Vector2( 0, 0 ) + +[node name="HitboxPivot" type="Position2D" parent="."] +position = Vector2( 0, -4 ) +rotation = 4.71239 +__meta__ = { +"_gizmo_extents_": 8.0 +} + +[node name="SwordHitbox" parent="HitboxPivot" instance=ExtResource( 3 )] +position = Vector2( 15, 0 ) +collision_mask = 8 + +[node name="CollisionShape2D" parent="HitboxPivot/SwordHitbox" index="0"] +shape = SubResource( 40 ) +disabled = true + +[editable path="HitboxPivot/SwordHitbox"] diff --git a/ActionRPG-HeartBeast/World.tscn b/ActionRPG-HeartBeast/World.tscn index 6e465fd..0901867 100644 --- a/ActionRPG-HeartBeast/World.tscn +++ b/ActionRPG-HeartBeast/World.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=59 format=2] +[gd_scene load_steps=60 format=2] [ext_resource path="res://World/Bush.tscn" type="PackedScene" id=1] [ext_resource path="res://Player/Player.tscn" type="PackedScene" id=2] [ext_resource path="res://World/GrassBackground.png" type="Texture" id=3] [ext_resource path="res://World/DirtTileset.png" type="Texture" id=4] [ext_resource path="res://World/CliffTileset.png" type="Texture" id=5] +[ext_resource path="res://World/Grass.tscn" type="PackedScene" id=6] [sub_resource type="TileSet" id=1] 0/name = "DirtTileset.png 0" @@ -533,25 +534,60 @@ tile_data = PoolIntArray( 9, 0, 0, 10, 0, 2, 65545, 0, 65536, 65546, 0, 65538, 6 [node name="DirtCliffTileMap" type="TileMap" parent="."] tile_set = SubResource( 2 ) cell_size = Vector2( 32, 32 ) +collision_mask = 0 format = 1 tile_data = PoolIntArray( 0, 0, 4, 1, 0, 196609, 2, 0, 196609, 3, 0, 196610, 7, 0, 196608, 8, 0, 196609, 9, 0, 7, 65536, 0, 131075, 65545, 0, 131075, 196611, 0, 3, 196617, 0, 3, 262144, 0, 0, 262145, 0, 1, 262146, 0, 1, 262147, 0, 131079, 262152, 0, 196608, 262153, 0, 262151, 327680, 0, 131072, 327681, 0, 131073, 327682, 0, 131073, 327683, 0, 131074, 327689, 0, 131075 ) [node name="YSort" type="YSort" parent="."] [node name="Player" parent="YSort" instance=ExtResource( 2 )] -position = Vector2( 88, 64 ) +position = Vector2( 111, 71 ) __meta__ = { "_edit_group_": true } -[node name="Bush" parent="YSort" instance=ExtResource( 1 )] -position = Vector2( 56, 56 ) +[node name="Bushes" type="YSort" parent="YSort"] -[node name="Bush2" parent="YSort" instance=ExtResource( 1 )] -position = Vector2( 184, 136 ) +[node name="Bush" parent="YSort/Bushes" instance=ExtResource( 1 )] +position = Vector2( 62, 58 ) -[node name="Bush3" parent="YSort" instance=ExtResource( 1 )] +[node name="Bush2" parent="YSort/Bushes" instance=ExtResource( 1 )] +position = Vector2( 188, 145 ) + +[node name="Bush3" parent="YSort/Bushes" instance=ExtResource( 1 )] position = Vector2( 192, 56 ) -[node name="Bush4" parent="YSort" instance=ExtResource( 1 )] +[node name="Bush4" parent="YSort/Bushes" instance=ExtResource( 1 )] position = Vector2( 240, 152 ) + +[node name="Grass" type="YSort" parent="YSort"] + +[node name="Grass" parent="YSort/Grass" instance=ExtResource( 6 )] +position = Vector2( 32, 32 ) + +[node name="Grass2" parent="YSort/Grass" instance=ExtResource( 6 )] +position = Vector2( 209, 0 ) + +[node name="Grass3" parent="YSort/Grass" instance=ExtResource( 6 )] +position = Vector2( 272, 113 ) + +[node name="Grass4" parent="YSort/Grass" instance=ExtResource( 6 )] +position = Vector2( 255, 113 ) + +[node name="Grass5" parent="YSort/Grass" instance=ExtResource( 6 )] +position = Vector2( 271, 95 ) + +[node name="Grass6" parent="YSort/Grass" instance=ExtResource( 6 )] +position = Vector2( 81, 96 ) + +[node name="Grass7" parent="YSort/Grass" instance=ExtResource( 6 )] +position = Vector2( 80, 112 ) + +[node name="Grass8" parent="YSort/Grass" instance=ExtResource( 6 )] +position = Vector2( 64, 112 ) + +[node name="Grass9" parent="YSort/Grass" instance=ExtResource( 6 )] +position = Vector2( 48, 112 ) + +[node name="Grass10" parent="YSort/Grass" instance=ExtResource( 6 )] +position = Vector2( 128, 121 ) diff --git a/ActionRPG-HeartBeast/World/Grass.gd b/ActionRPG-HeartBeast/World/Grass.gd new file mode 100644 index 0000000..4320b28 --- /dev/null +++ b/ActionRPG-HeartBeast/World/Grass.gd @@ -0,0 +1,18 @@ +extends Node2D + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func create_grass_effect(): + var GrassEffect = load("res://Effects/GrassEffect.tscn") + var grassEffect = GrassEffect.instance() + var world = get_tree().current_scene + world.add_child(grassEffect) + grassEffect.global_position = global_position + +func _on_Hurtbox_area_entered(area): + create_grass_effect() + queue_free() diff --git a/ActionRPG-HeartBeast/World/Grass.tscn b/ActionRPG-HeartBeast/World/Grass.tscn new file mode 100644 index 0000000..ab9e0ac --- /dev/null +++ b/ActionRPG-HeartBeast/World/Grass.tscn @@ -0,0 +1,27 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://World/Grass.png" type="Texture" id=1] +[ext_resource path="res://World/Grass.gd" type="Script" id=2] +[ext_resource path="res://Overlap/Hurtbox.tscn" type="PackedScene" id=3] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 7, 7 ) + +[node name="Grass" type="Node2D"] +script = ExtResource( 2 ) + +[node name="Sprite" type="Sprite" parent="."] +texture = ExtResource( 1 ) +centered = false +offset = Vector2( -8, -8 ) + +[node name="Hurtbox" parent="." instance=ExtResource( 3 )] +collision_layer = 8 + +[node name="CollisionShape2D" parent="Hurtbox" index="0"] +position = Vector2( 8, 8 ) +shape = SubResource( 1 ) + +[connection signal="area_entered" from="Hurtbox" to="." method="_on_Hurtbox_area_entered"] + +[editable path="Hurtbox"] diff --git a/ActionRPG-HeartBeast/build/.DS_Store b/ActionRPG-HeartBeast/build/.DS_Store index 8439ea0..97df7fc 100644 Binary files a/ActionRPG-HeartBeast/build/.DS_Store and b/ActionRPG-HeartBeast/build/.DS_Store differ diff --git a/ActionRPG-HeartBeast/build/web/.DS_Store b/ActionRPG-HeartBeast/build/web/.DS_Store new file mode 100644 index 0000000..fdade54 Binary files /dev/null and b/ActionRPG-HeartBeast/build/web/.DS_Store differ diff --git a/ActionRPG-HeartBeast/build/web/ActionRPG-web.zip b/ActionRPG-HeartBeast/build/web/ActionRPG-web.zip index 225253b..dfe8a5f 100644 Binary files a/ActionRPG-HeartBeast/build/web/ActionRPG-web.zip and b/ActionRPG-HeartBeast/build/web/ActionRPG-web.zip differ diff --git a/ActionRPG-HeartBeast/build/web/index.html b/ActionRPG-HeartBeast/build/web/index.html index ed4ddd6..6df9323 100644 --- a/ActionRPG-HeartBeast/build/web/index.html +++ b/ActionRPG-HeartBeast/build/web/index.html @@ -139,7 +139,7 @@