diff --git a/ActionRPG-HeartBeast/Effects/EnemyDeathEffect.tscn b/ActionRPG-HeartBeast/Effects/EnemyDeathEffect.tscn index a61bf88..af63fec 100644 --- a/ActionRPG-HeartBeast/Effects/EnemyDeathEffect.tscn +++ b/ActionRPG-HeartBeast/Effects/EnemyDeathEffect.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=14 format=2] +[gd_scene load_steps=15 format=2] [ext_resource path="res://Effects/Effect.gd" type="Script" id=1] [ext_resource path="res://Effects/EnemyDeathEffect.png" type="Texture" id=2] +[ext_resource path="res://Music and Sounds/EnemyDie.wav" type="AudioStream" id=3] [sub_resource type="AtlasTexture" id=1] atlas = ExtResource( 2 ) @@ -56,3 +57,7 @@ frames = SubResource( 11 ) animation = "Animate" offset = Vector2( 0, -8 ) script = ExtResource( 1 ) + +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 3 ) +autoplay = true diff --git a/ActionRPG-HeartBeast/Effects/HitEffect.tscn b/ActionRPG-HeartBeast/Effects/HitEffect.tscn index a1ca0af..9815e8d 100644 --- a/ActionRPG-HeartBeast/Effects/HitEffect.tscn +++ b/ActionRPG-HeartBeast/Effects/HitEffect.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=6 format=2] +[gd_scene load_steps=7 format=2] [ext_resource path="res://Effects/Effect.gd" type="Script" id=1] [ext_resource path="res://Effects/HitEffect.png" type="Texture" id=2] +[ext_resource path="res://Music and Sounds/Hit.wav" type="AudioStream" id=3] [sub_resource type="AtlasTexture" id=1] atlas = ExtResource( 2 ) @@ -24,3 +25,7 @@ frames = SubResource( 3 ) animation = "Animate" offset = Vector2( 0, -8 ) script = ExtResource( 1 ) + +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 3 ) +autoplay = true diff --git a/ActionRPG-HeartBeast/Enemies/Bat.gd b/ActionRPG-HeartBeast/Enemies/Bat.gd index de9d630..372383f 100644 --- a/ActionRPG-HeartBeast/Enemies/Bat.gd +++ b/ActionRPG-HeartBeast/Enemies/Bat.gd @@ -5,6 +5,7 @@ const EnemyDeathEffect = preload("res://Effects/EnemyDeathEffect.tscn") export var ACCELERATION = 300 export var MAX_SPEED = 50 export var FRICTION = 200 +export var WANDER_TARGET_RANGE = 4 enum { IDLE, @@ -22,6 +23,11 @@ onready var stats = $Stats onready var playerDetectionZone = $PlayerDetectionZone onready var hurtbox = $Hurtbox onready var softCollision = $SoftCollision +onready var wanderController = $WanderController +onready var animationPlayer = $AnimationPlayer + +func _ready(): + state = pick_new_state([IDLE,WANDER]) func _physics_process(delta): knockback = knockback.move_toward(Vector2.ZERO, 200 * delta) @@ -31,15 +37,21 @@ func _physics_process(delta): IDLE: velocity = velocity.move_toward(Vector2.ZERO, FRICTION * delta) seek_player() - + if wanderController.get_time_left() == 0: + update_wander() + WANDER: - pass - + seek_player() + if wanderController.get_time_left() == 0: + update_wander() + accelerate_towards_point(wanderController.target_position,delta) + if global_position.distance_to(wanderController.target_position) <= WANDER_TARGET_RANGE: + update_wander() + CHASE: var player = playerDetectionZone.player if player != null: - var direction = (player.global_position - global_position).normalized() - velocity = velocity.move_toward(direction * MAX_SPEED, ACCELERATION * delta) + accelerate_towards_point(player.global_position,delta) else: state = IDLE sprite.flip_h = velocity.x < 0 @@ -48,15 +60,29 @@ func _physics_process(delta): velocity += softCollision.get_push_vector() * delta * 400 velocity = move_and_slide(velocity) - +func accelerate_towards_point(point,delta): + var direction = global_position.direction_to(point) + sprite.flip_h = velocity.x < 0 + velocity = velocity.move_toward(direction * MAX_SPEED, ACCELERATION * delta) + +func update_wander(): + state = pick_new_state([IDLE, WANDER]) + wanderController.start_wander_timer(rand_range(1,3)) + func seek_player(): if playerDetectionZone.can_see_player(): state = CHASE +func pick_new_state(state_list): + #return state_list.pick_random() + state_list.shuffle() + return state_list.pop_front() + func _on_Hurtbox_area_entered(area): stats.health -= area.damage knockback = area.knockback_vector * 120 hurtbox.create_hit_effect() + hurtbox.start_invincibility(0.4) #queue_free() # Replace with function body. func _on_Stats_no_health(): @@ -64,3 +90,10 @@ func _on_Stats_no_health(): var enemyDeathEffect = EnemyDeathEffect.instance() get_parent().add_child(enemyDeathEffect) enemyDeathEffect.global_position = global_position + + +func _on_Hurtbox_invincibility_started(): + animationPlayer.play("Start") + +func _on_Hurtbox_invincibility_ended(): + animationPlayer.play("Stop") diff --git a/ActionRPG-HeartBeast/Enemies/Bat.tscn b/ActionRPG-HeartBeast/Enemies/Bat.tscn index b58c8e6..2957609 100644 --- a/ActionRPG-HeartBeast/Enemies/Bat.tscn +++ b/ActionRPG-HeartBeast/Enemies/Bat.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=20 format=2] +[gd_scene load_steps=26 format=2] [ext_resource path="res://Enemies/Bat.png" type="Texture" id=1] [ext_resource path="res://Shadows/SmallShadow.png" type="Texture" id=2] @@ -8,6 +8,13 @@ [ext_resource path="res://Enemies/PlayerDetectionZone.tscn" type="PackedScene" id=6] [ext_resource path="res://Overlap/Hitbox.tscn" type="PackedScene" id=7] [ext_resource path="res://Overlap/SoftCollision.tscn" type="PackedScene" id=8] +[ext_resource path="res://Overlap/WanderController.tscn" type="PackedScene" id=9] +[ext_resource path="res://WhiteColor_shader.tres" type="Shader" id=10] + +[sub_resource type="ShaderMaterial" id=12] +resource_local_to_scene = true +shader = ExtResource( 10 ) +shader_param/active = false [sub_resource type="AtlasTexture" id=1] atlas = ExtResource( 1 ) @@ -53,13 +60,63 @@ radius = 5.0 [sub_resource type="CircleShape2D" id=11] radius = 5.0 +[sub_resource type="Animation" id=13] +length = 0.001 +tracks/0/type = "value" +tracks/0/path = NodePath("AnimatedSprite:material:shader_param/active") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ false ] +} + +[sub_resource type="Animation" id=14] +resource_name = "Start" +length = 0.2 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath("AnimatedSprite:material:shader_param/active") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.1 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 1, +"values": [ true, false ] +} + +[sub_resource type="Animation" id=15] +resource_name = "Stop" +length = 0.1 +tracks/0/type = "value" +tracks/0/path = NodePath("AnimatedSprite:material:shader_param/active") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ false ] +} + [node name="Bat" type="KinematicBody2D"] collision_layer = 16 script = ExtResource( 4 ) [node name="AnimatedSprite" type="AnimatedSprite" parent="."] +material = SubResource( 12 ) frames = SubResource( 6 ) animation = "Fly" +frame = 3 playing = true offset = Vector2( 0, -12 ) @@ -101,7 +158,16 @@ shape = SubResource( 10 ) [node name="CollisionShape2D" parent="SoftCollision" index="0"] shape = SubResource( 11 ) +[node name="WanderController" parent="." instance=ExtResource( 9 )] + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +anims/RESET = SubResource( 13 ) +anims/Start = SubResource( 14 ) +anims/Stop = SubResource( 15 ) + [connection signal="area_entered" from="Hurtbox" to="." method="_on_Hurtbox_area_entered"] +[connection signal="invincibility_ended" from="Hurtbox" to="." method="_on_Hurtbox_invincibility_ended"] +[connection signal="invincibility_started" from="Hurtbox" to="." method="_on_Hurtbox_invincibility_started"] [connection signal="no_health" from="Stats" to="." method="_on_Stats_no_health"] [editable path="Hurtbox"] diff --git a/ActionRPG-HeartBeast/Enemies/PlayerDetectionZone.gd b/ActionRPG-HeartBeast/Enemies/PlayerDetectionZone.gd index 5ea092e..576a5c8 100644 --- a/ActionRPG-HeartBeast/Enemies/PlayerDetectionZone.gd +++ b/ActionRPG-HeartBeast/Enemies/PlayerDetectionZone.gd @@ -9,5 +9,5 @@ func can_see_player(): func _on_PlayerDetectionZone_body_entered(body): player = body -func _on_PlayerDetectionZone_body_exited(body): +func _on_PlayerDetectionZone_body_exited(_body): player = null diff --git a/ActionRPG-HeartBeast/Overlap/WanderController.gd b/ActionRPG-HeartBeast/Overlap/WanderController.gd new file mode 100644 index 0000000..de0bb3c --- /dev/null +++ b/ActionRPG-HeartBeast/Overlap/WanderController.gd @@ -0,0 +1,24 @@ +extends Node2D + +export(int) var wander_range = 32 + +onready var start_position = global_position +onready var target_position = global_position + +onready var timer = $Timer + +func _ready(): + update_target_position() + +func update_target_position(): + var target_vector = Vector2(rand_range(-wander_range,wander_range), rand_range(-wander_range,wander_range)) + target_position = start_position + target_vector + +func get_time_left(): + return timer.time_left + +func start_wander_timer(duration): + timer.start(duration) + +func _on_Timer_timeout(): + update_target_position() diff --git a/ActionRPG-HeartBeast/Overlap/WanderController.tscn b/ActionRPG-HeartBeast/Overlap/WanderController.tscn new file mode 100644 index 0000000..3fba76a --- /dev/null +++ b/ActionRPG-HeartBeast/Overlap/WanderController.tscn @@ -0,0 +1,12 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://Overlap/WanderController.gd" type="Script" id=1] + +[node name="WanderController" type="Node2D"] +script = ExtResource( 1 ) + +[node name="Timer" type="Timer" parent="."] +one_shot = true +autostart = true + +[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"] diff --git a/ActionRPG-HeartBeast/Player/Player.gd b/ActionRPG-HeartBeast/Player/Player.gd index 48febd1..db70376 100644 --- a/ActionRPG-HeartBeast/Player/Player.gd +++ b/ActionRPG-HeartBeast/Player/Player.gd @@ -1,5 +1,7 @@ extends KinematicBody2D +const PlayerHurtSound = preload("res://Player/PlayerHurtSound.tscn") + var velocity = Vector2.ZERO var input_vector = Vector2.ZERO var roll_vector = Vector2.DOWN @@ -19,6 +21,7 @@ enum { var state = MOVE onready var animationPlayer = $AnimationPlayer +onready var blinkAnimationPlayer = $BlinkAnimationPlayer onready var animationTree = $AnimationTree onready var animationState = animationTree.get("parameters/playback") onready var swordHitbox = $HitboxPivot/SwordHitbox @@ -28,6 +31,7 @@ func _ready(): stats.connect("no_health", self, "queue_free") animationTree.active = true swordHitbox.knockback_vector = roll_vector + blinkAnimationPlayer.play("Stop") func _process(delta): match state: @@ -35,10 +39,10 @@ func _process(delta): move_state(delta) ROLL: - roll_state(delta) + roll_state() ATTACK: - attack_state(delta) + attack_state() func move_state(delta): input_vector.x = Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left") @@ -71,12 +75,12 @@ func move_state(delta): func roll_animation_finished(): state = MOVE -func roll_state(delta): +func roll_state(): velocity = roll_vector * ROLL_SPEED animationState.travel("Roll") move() -func attack_state(delta): +func attack_state(): #velocity = Vector2.ZERO #animationTree.set("parameters/Attack/blend_position", input_vector) velocity = Vector2.ZERO @@ -95,7 +99,17 @@ func attack_aninimation_finished(): # pass -func _on_Hurtbox_area_entered(area): +func _on_Hurtbox_area_entered(_area): stats.health -= 1 - hurtBox.start_invincibility(0.5) + hurtBox.start_invincibility(0.6) hurtBox.create_hit_effect() + var playerHurtSounds = PlayerHurtSound.instance() + get_tree().current_scene.add_child(playerHurtSounds) + + +func _on_Hurtbox_invincibility_started(): + blinkAnimationPlayer.play("Start") + + +func _on_Hurtbox_invincibility_ended(): + blinkAnimationPlayer.play("Stop") diff --git a/ActionRPG-HeartBeast/Player/Player.tscn b/ActionRPG-HeartBeast/Player/Player.tscn index af26ee8..d9445d4 100644 --- a/ActionRPG-HeartBeast/Player/Player.tscn +++ b/ActionRPG-HeartBeast/Player/Player.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=57 format=2] +[gd_scene load_steps=64 format=2] [ext_resource path="res://Player/Player.gd" type="Script" id=1] [ext_resource path="res://Player/Player.png" type="Texture" id=2] @@ -6,6 +6,13 @@ [ext_resource path="res://Player/SwordHitbox.gd" type="Script" id=4] [ext_resource path="res://Overlap/Hurtbox.tscn" type="PackedScene" id=5] [ext_resource path="res://Shadows/MediumShadow.png" type="Texture" id=6] +[ext_resource path="res://Music and Sounds/Swipe.wav" type="AudioStream" id=7] +[ext_resource path="res://Music and Sounds/Evade.wav" type="AudioStream" id=8] +[ext_resource path="res://WhiteColor_shader.tres" type="Shader" id=9] + +[sub_resource type="ShaderMaterial" id=55] +shader = ExtResource( 9 ) +shader_param/active = true [sub_resource type="CapsuleShape2D" id=1] radius = 4.0 @@ -64,6 +71,24 @@ tracks/3/keys = { "update": 1, "values": [ false, true ] } +tracks/4/type = "audio" +tracks/4/path = NodePath("AudioStreamPlayer") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/keys = { +"clips": [ { +"end_offset": 0.0, +"start_offset": 0.0, +"stream": null +}, { +"end_offset": 0.0, +"start_offset": 0.0, +"stream": ExtResource( 7 ) +} ], +"times": PoolRealArray( 0.1, 0.101 ) +} [sub_resource type="Animation" id=28] resource_name = "AttackLeft" @@ -118,6 +143,24 @@ tracks/3/keys = { "update": 1, "values": [ false, true ] } +tracks/4/type = "audio" +tracks/4/path = NodePath("AudioStreamPlayer") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/keys = { +"clips": [ { +"end_offset": 0.0, +"start_offset": 0.0, +"stream": null +}, { +"end_offset": 0.0, +"start_offset": 0.0, +"stream": ExtResource( 7 ) +} ], +"times": PoolRealArray( 0.1, 0.101 ) +} [sub_resource type="Animation" id=29] resource_name = "AttackRight" @@ -172,6 +215,24 @@ tracks/3/keys = { "update": 1, "values": [ false, true ] } +tracks/4/type = "audio" +tracks/4/path = NodePath("AudioStreamPlayer") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/keys = { +"clips": [ { +"end_offset": 0.0, +"start_offset": 0.0, +"stream": null +}, { +"end_offset": 0.0, +"start_offset": 0.0, +"stream": ExtResource( 7 ) +} ], +"times": PoolRealArray( 0.1, 0.101 ) +} [sub_resource type="Animation" id=30] resource_name = "AttackUp" @@ -226,6 +287,24 @@ tracks/3/keys = { "update": 1, "values": [ false, true ] } +tracks/4/type = "audio" +tracks/4/path = NodePath("AudioStreamPlayer") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/keys = { +"clips": [ { +"end_offset": 0.0, +"start_offset": 0.0, +"stream": null +}, { +"end_offset": 0.0, +"start_offset": 0.0, +"stream": ExtResource( 7 ) +} ], +"times": PoolRealArray( 0.1, 0.101 ) +} [sub_resource type="Animation" id=9] resource_name = "IdleDown" @@ -351,6 +430,24 @@ tracks/1/keys = { "method": "roll_animation_finished" } ] } +tracks/2/type = "audio" +tracks/2/path = NodePath("AudioStreamPlayer") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"clips": [ { +"end_offset": 0.0, +"start_offset": 0.0, +"stream": null +}, { +"end_offset": 0.0, +"start_offset": 0.0, +"stream": ExtResource( 8 ) +} ], +"times": PoolRealArray( 0.1, 0.101 ) +} [sub_resource type="Animation" id=43] resource_name = "RollLeft" @@ -381,6 +478,24 @@ tracks/1/keys = { "method": "roll_animation_finished" } ] } +tracks/2/type = "audio" +tracks/2/path = NodePath("AudioStreamPlayer") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"clips": [ { +"end_offset": 0.0, +"start_offset": 0.0, +"stream": null +}, { +"end_offset": 0.0, +"start_offset": 0.0, +"stream": ExtResource( 8 ) +} ], +"times": PoolRealArray( 0.1, 0.101 ) +} [sub_resource type="Animation" id=42] resource_name = "RollRight" @@ -411,6 +526,20 @@ tracks/1/keys = { "method": "roll_animation_finished" } ] } +tracks/2/type = "audio" +tracks/2/path = NodePath("AudioStreamPlayer") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"clips": [ { +"end_offset": 0.0, +"start_offset": 0.0, +"stream": ExtResource( 8 ) +} ], +"times": PoolRealArray( 0.1 ) +} [sub_resource type="Animation" id=44] resource_name = "RollUp" @@ -441,10 +570,29 @@ tracks/1/keys = { "method": "roll_animation_finished" } ] } +tracks/2/type = "audio" +tracks/2/path = NodePath("AudioStreamPlayer") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"clips": [ { +"end_offset": 0.0, +"start_offset": 0.0, +"stream": null +}, { +"end_offset": 0.0, +"start_offset": 0.0, +"stream": ExtResource( 8 ) +} ], +"times": PoolRealArray( 0.1, 0.101 ) +} [sub_resource type="Animation" id=6] resource_name = "RunDown" length = 0.6 +loop = true tracks/0/type = "value" tracks/0/path = NodePath("Sprite:frame") tracks/0/interp = 1 @@ -647,6 +795,54 @@ height = 12.0 radius = 5.0 height = 6.0 +[sub_resource type="Animation" id=56] +length = 0.001 +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:material:shader_param/active") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ true ] +} + +[sub_resource type="Animation" id=53] +resource_name = "Start" +length = 0.2 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:material:shader_param/active") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.1 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 1, +"values": [ true, false ] +} + +[sub_resource type="Animation" id=54] +resource_name = "Stop" +length = 0.1 +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:material:shader_param/active") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ false ] +} + [node name="Player" type="KinematicBody2D"] collision_layer = 2 script = ExtResource( 1 ) @@ -656,6 +852,7 @@ position = Vector2( 0, 1 ) texture = ExtResource( 6 ) [node name="Sprite" type="Sprite" parent="."] +material = SubResource( 55 ) position = Vector2( 0, -9 ) texture = ExtResource( 2 ) hframes = 60 @@ -694,7 +891,7 @@ parameters/Run/blend_position = Vector2( 0, 1 ) [node name="HitboxPivot" type="Position2D" parent="."] position = Vector2( 0, -4 ) -rotation = 1.5708 +rotation = 4.71239 __meta__ = { "_gizmo_extents_": 8.0 } @@ -715,7 +912,17 @@ collision_layer = 4 position = Vector2( 0, -4 ) shape = SubResource( 52 ) +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 8 ) + +[node name="BlinkAnimationPlayer" type="AnimationPlayer" parent="."] +anims/RESET = SubResource( 56 ) +anims/Start = SubResource( 53 ) +anims/Stop = SubResource( 54 ) + [connection signal="area_entered" from="Hurtbox" to="." method="_on_Hurtbox_area_entered"] +[connection signal="invincibility_ended" from="Hurtbox" to="." method="_on_Hurtbox_invincibility_ended"] +[connection signal="invincibility_started" from="Hurtbox" to="." method="_on_Hurtbox_invincibility_started"] [editable path="HitboxPivot/SwordHitbox"] [editable path="Hurtbox"] diff --git a/ActionRPG-HeartBeast/Player/PlayerHurtSound.gd b/ActionRPG-HeartBeast/Player/PlayerHurtSound.gd new file mode 100644 index 0000000..26af586 --- /dev/null +++ b/ActionRPG-HeartBeast/Player/PlayerHurtSound.gd @@ -0,0 +1,16 @@ +extends AudioStreamPlayer + + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" + + +# Called when the node enters the scene tree for the first time. +func _ready(): + connect("finished", self, "queue_free") + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _process(delta): +# pass diff --git a/ActionRPG-HeartBeast/Player/PlayerHurtSound.tscn b/ActionRPG-HeartBeast/Player/PlayerHurtSound.tscn new file mode 100644 index 0000000..288fb5f --- /dev/null +++ b/ActionRPG-HeartBeast/Player/PlayerHurtSound.tscn @@ -0,0 +1,9 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://Music and Sounds/Hurt.wav" type="AudioStream" id=1] +[ext_resource path="res://Player/PlayerHurtSound.gd" type="Script" id=2] + +[node name="PlayerHurtSound" type="AudioStreamPlayer"] +stream = ExtResource( 1 ) +autoplay = true +script = ExtResource( 2 ) diff --git a/ActionRPG-HeartBeast/WhiteColor_shader.tres b/ActionRPG-HeartBeast/WhiteColor_shader.tres new file mode 100644 index 0000000..888431a --- /dev/null +++ b/ActionRPG-HeartBeast/WhiteColor_shader.tres @@ -0,0 +1,16 @@ +[gd_resource type="Shader" format=2] + +[resource] +code = "shader_type canvas_item; + +uniform bool active = false; + +void fragment() { + vec4 previous_color = texture(TEXTURE, UV); + vec4 white_color = vec4(1.0,1.0,1.0,previous_color.a); + vec4 new_color = previous_color; + if (active == true) { + new_color = white_color; + } + COLOR = new_color; +}" diff --git a/ActionRPG-HeartBeast/World.tscn b/ActionRPG-HeartBeast/World.tscn index 4beec2c..d801b76 100644 --- a/ActionRPG-HeartBeast/World.tscn +++ b/ActionRPG-HeartBeast/World.tscn @@ -527,30 +527,30 @@ points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 ) position = Vector2( 160, 90 ) texture = ExtResource( 3 ) region_enabled = true -region_rect = Rect2( 0, 0, 880, 448 ) +region_rect = Rect2( 0, 0, 1424, 912 ) [node name="DirtPathTileMap" type="TileMap" parent="."] tile_set = SubResource( 1 ) cell_size = Vector2( 16, 16 ) format = 1 -tile_data = PoolIntArray( 9, 0, 0, 10, 0, 2, 65545, 0, 65536, 65546, 0, 65538, 65552, 0, 196608, 65553, 0, 7, 131081, 0, 65536, 131082, 0, 65538, 131089, 0, 65539, 196616, 0, 0, 196617, 0, 131078, 196618, 0, 131077, 196619, 0, 2, 196624, 0, 0, 196625, 0, 131080, 196626, 0, 1, 196627, 0, 2, 262148, 0, 0, 262149, 0, 1, 262150, 0, 1, 262151, 0, 1, 262152, 0, 131078, 262153, 0, 65537, 262154, 0, 65537, 262155, 0, 131077, 262156, 0, 2, 262160, 0, 65536, 262161, 0, 65537, 262162, 0, 65537, 262163, 0, 131077, 262164, 0, 2, 327680, 0, 0, 327681, 0, 1, 327682, 0, 1, 327683, 0, 1, 327684, 0, 65545, 327685, 0, 131073, 327686, 0, 131073, 327687, 0, 131073, 327688, 0, 131073, 327689, 0, 65542, 327690, 0, 65537, 327691, 0, 65537, 327692, 0, 131077, 327693, 0, 1, 327694, 0, 1, 327695, 0, 1, 327696, 0, 131078, 327697, 0, 65541, 327698, 0, 131073, 327699, 0, 131073, 327700, 0, 131074, 393216, 0, 131072, 393217, 0, 131073, 393218, 0, 131073, 393219, 0, 131073, 393220, 0, 131074, 393225, 0, 131072, 393226, 0, 65542, 393227, 0, 65537, 393228, 0, 65537, 393229, 0, 65537, 393230, 0, 65537, 393231, 0, 65537, 393232, 0, 65541, 393233, 0, 131074, 458762, 0, 131072, 458763, 0, 131073, 458764, 0, 131073, 458765, 0, 131073, 458766, 0, 131073, 458767, 0, 131073, 458768, 0, 131074, 720903, 0, 196611 ) +tile_data = PoolIntArray( -917480, 0, 0, -917479, 0, 1, -917478, 0, 1, -917477, 0, 1, -917476, 0, 1, -917475, 0, 1, -917474, 0, 2, -851949, 0, 0, -851948, 0, 1, -851947, 0, 1, -851946, 0, 1, -851945, 0, 1, -851944, 0, 131078, -851943, 0, 65537, -851942, 0, 65541, -851941, 0, 131073, -851940, 0, 131073, -851939, 0, 131073, -851938, 0, 9, -851937, 0, 2, -786421, 0, 0, -786420, 0, 1, -786419, 0, 5, -786418, 0, 196609, -786417, 0, 196609, -786416, 0, 196609, -786415, 0, 196609, -786414, 0, 196609, -786413, 0, 196614, -786412, 0, 131073, -786411, 0, 131073, -786410, 0, 131073, -786409, 0, 131073, -786408, 0, 131073, -786407, 0, 131073, -786406, 0, 131074, -786402, 0, 131072, -786401, 0, 196613, -786400, 0, 7, -720887, 0, 0, -720886, 0, 5, -720885, 0, 196614, -720884, 0, 131073, -720883, 0, 131074, -720864, 0, 196612, -720863, 0, 7, -655352, 0, 0, -655351, 0, 131078, -655350, 0, 65538, -655327, 0, 196612, -655326, 0, 7, -589816, 0, 65536, -589815, 0, 65537, -589814, 0, 65538, -589790, 0, 196612, -589789, 0, 7, -524280, 0, 131072, -524279, 0, 65542, -524278, 0, 65538, -524253, 0, 65539, -458743, 0, 65536, -458742, 0, 65538, -458717, 0, 65539, -393207, 0, 65536, -393206, 0, 65538, -393181, 0, 65539, -327671, 0, 65536, -327670, 0, 65538, -327645, 0, 65539, -262135, 0, 65536, -262134, 0, 65538, -262109, 0, 65539, -196599, 0, 65536, -196598, 0, 65538, -196573, 0, 65539, -131063, 0, 65536, -131062, 0, 65538, -131037, 0, 65539, -65527, 0, 65536, -65526, 0, 65538, -65502, 0, 0, -65501, 0, 131079, 9, 0, 65536, 10, 0, 65538, 34, 0, 65536, 35, 0, 65538, 65545, 0, 65536, 65546, 0, 65538, 65552, 0, 196608, 65553, 0, 7, 65570, 0, 65536, 65571, 0, 65538, 131081, 0, 65536, 131082, 0, 65538, 131089, 0, 65539, 131104, 0, 0, 131105, 0, 1, 131106, 0, 131078, 131107, 0, 131077, 131108, 0, 2, 196616, 0, 0, 196617, 0, 131078, 196618, 0, 131077, 196619, 0, 2, 196624, 0, 0, 196625, 0, 131080, 196626, 0, 1, 196627, 0, 2, 196639, 0, 0, 196640, 0, 131078, 196641, 0, 65537, 196642, 0, 65537, 196643, 0, 65537, 196644, 0, 131077, 196645, 0, 2, 262148, 0, 0, 262149, 0, 1, 262150, 0, 1, 262151, 0, 1, 262152, 0, 131078, 262153, 0, 65537, 262154, 0, 65537, 262155, 0, 131077, 262156, 0, 2, 262160, 0, 65536, 262161, 0, 65537, 262162, 0, 65537, 262163, 0, 131077, 262164, 0, 2, 262173, 0, 0, 262174, 0, 1, 262175, 0, 131078, 262176, 0, 65537, 262177, 0, 65537, 262178, 0, 65537, 262179, 0, 65537, 262180, 0, 65537, 262181, 0, 131077, 262182, 0, 1, 262183, 0, 1, 262184, 0, 5, 262185, 0, 196610, 327680, 0, 0, 327681, 0, 1, 327682, 0, 1, 327683, 0, 1, 327684, 0, 65545, 327685, 0, 131073, 327686, 0, 131073, 327687, 0, 131073, 327688, 0, 131073, 327689, 0, 65542, 327690, 0, 65537, 327691, 0, 65537, 327692, 0, 131077, 327693, 0, 1, 327694, 0, 1, 327695, 0, 1, 327696, 0, 131078, 327697, 0, 65541, 327698, 0, 131073, 327699, 0, 131073, 327700, 0, 196613, 327701, 0, 196609, 327702, 0, 196609, 327703, 0, 6, 327704, 0, 1, 327705, 0, 1, 327706, 0, 1, 327707, 0, 1, 327708, 0, 1, 327709, 0, 131078, 327710, 0, 65537, 327711, 0, 65537, 327712, 0, 65541, 327713, 0, 131073, 327714, 0, 131073, 327715, 0, 131073, 327716, 0, 131073, 327717, 0, 131073, 327718, 0, 131073, 327719, 0, 131073, 327720, 0, 131074, 393216, 0, 131072, 393217, 0, 131073, 393218, 0, 131073, 393219, 0, 131073, 393220, 0, 131074, 393225, 0, 65536, 393226, 0, 65537, 393227, 0, 65537, 393228, 0, 65537, 393229, 0, 65537, 393230, 0, 65537, 393231, 0, 65537, 393232, 0, 65541, 393233, 0, 131074, 393239, 0, 131072, 393240, 0, 131073, 393241, 0, 131073, 393242, 0, 131073, 393243, 0, 131073, 393244, 0, 131073, 393245, 0, 131073, 393246, 0, 131073, 393247, 0, 65542, 393248, 0, 65538, 458761, 0, 65536, 458762, 0, 65541, 458763, 0, 131073, 458764, 0, 131073, 458765, 0, 131073, 458766, 0, 131073, 458767, 0, 131073, 458768, 0, 131074, 458783, 0, 65536, 458784, 0, 65538, 524297, 0, 65536, 524298, 0, 65538, 524319, 0, 65536, 524320, 0, 65538, 589833, 0, 65536, 589834, 0, 65538, 589855, 0, 65536, 589856, 0, 65538, 655369, 0, 65536, 655370, 0, 65538, 655391, 0, 131072, 655392, 0, 9, 655393, 0, 2, 720903, 0, 196611, 720905, 0, 65536, 720906, 0, 65538, 720928, 0, 65536, 720929, 0, 65538, 786441, 0, 65536, 786442, 0, 65538, 786464, 0, 65540, 786465, 0, 131074, 851977, 0, 65536, 851978, 0, 65538, 852000, 0, 65539, 917513, 0, 65536, 917514, 0, 65538, 917536, 0, 65539, 983049, 0, 65536, 983050, 0, 131077, 983051, 0, 2, 983072, 0, 65539, 1048585, 0, 131072, 1048586, 0, 65542, 1048587, 0, 65538, 1048605, 0, 4, 1048606, 0, 196609, 1048607, 0, 196609, 1048608, 0, 196615, 1114122, 0, 131072, 1114123, 0, 196613, 1114124, 0, 6, 1114125, 0, 1, 1114126, 0, 2, 1114137, 0, 0, 1114138, 0, 5, 1114139, 0, 196609, 1114140, 0, 196609, 1114141, 0, 196615, 1179660, 0, 131072, 1179661, 0, 131073, 1179662, 0, 196613, 1179663, 0, 196609, 1179664, 0, 196609, 1179665, 0, 196609, 1179666, 0, 196609, 1179667, 0, 196609, 1179668, 0, 196609, 1179669, 0, 196609, 1179670, 0, 196609, 1179671, 0, 196609, 1179672, 0, 196609, 1179673, 0, 196614, 1179674, 0, 131074 ) [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 ) +tile_data = PoolIntArray( -655377, 0, 4, -655376, 0, 196609, -655375, 0, 196609, -655374, 0, 196609, -655373, 0, 196609, -655372, 0, 196609, -655371, 0, 196609, -655370, 0, 196609, -655369, 0, 196609, -655368, 0, 196609, -655367, 0, 196609, -655366, 0, 196609, -655365, 0, 196609, -655364, 0, 196609, -655363, 0, 196609, -655362, 0, 196609, -655361, 0, 196609, -720896, 0, 196609, -720895, 0, 196609, -720894, 0, 196609, -720893, 0, 196609, -720892, 0, 196609, -720891, 0, 196609, -720890, 0, 196609, -720889, 0, 196609, -720888, 0, 196609, -720887, 0, 196609, -720886, 0, 196609, -720885, 0, 196609, -720884, 0, 196609, -720883, 0, 196609, -720882, 0, 196609, -720881, 0, 196609, -720880, 0, 196609, -720879, 0, 196609, -720878, 0, 196609, -720877, 0, 196609, -720876, 0, 196609, -720875, 0, 196609, -720874, 0, 196609, -720873, 0, 196609, -720872, 0, 196609, -720871, 0, 196609, -720870, 0, 7, -589841, 0, 65539, -655334, 0, 65539, -524305, 0, 65539, -589798, 0, 65539, -458769, 0, 65539, -524262, 0, 65539, -393233, 0, 65539, -458726, 0, 65539, -327697, 0, 65539, -393190, 0, 65539, -262161, 0, 65539, -327654, 0, 65539, -196625, 0, 65539, -262135, 0, 0, -262134, 0, 1, -262133, 0, 1, -262132, 0, 1, -262131, 0, 2, -262118, 0, 65539, -131089, 0, 65539, -196600, 0, 196608, -196599, 0, 196614, -196598, 0, 131073, -196597, 0, 65544, -196596, 0, 131073, -196595, 0, 131074, -196582, 0, 65539, -65553, 0, 65539, -131061, 0, 65539, -131047, 0, 0, -131046, 0, 131079, -17, 0, 65539, -65526, 0, 4, -65525, 0, 196615, -65513, 0, 0, -65512, 0, 1, -65511, 0, 131078, -65510, 0, 65538, 65519, 0, 65539, 0, 0, 4, 1, 0, 196609, 2, 0, 196609, 3, 0, 196610, 7, 0, 196608, 8, 0, 196609, 9, 0, 8, 10, 0, 196615, 22, 0, 0, 23, 0, 131078, 24, 0, 65537, 25, 0, 65537, 26, 0, 65538, 131055, 0, 65539, 65536, 0, 131075, 65545, 0, 131075, 65558, 0, 65536, 65559, 0, 65537, 65560, 0, 65537, 65561, 0, 65537, 65562, 0, 65538, 196591, 0, 65539, 131094, 0, 131072, 131095, 0, 65542, 131096, 0, 65537, 131097, 0, 65537, 131098, 0, 65538, 262127, 0, 65539, 196611, 0, 3, 196617, 0, 3, 196631, 0, 65536, 196632, 0, 65537, 196633, 0, 65537, 196634, 0, 65538, 327663, 0, 65539, 262144, 0, 0, 262145, 0, 1, 262146, 0, 1, 262147, 0, 131079, 262152, 0, 196608, 262153, 0, 131081, 262154, 0, 1, 262155, 0, 1, 262156, 0, 2, 262167, 0, 131072, 262168, 0, 65542, 262169, 0, 65537, 262170, 0, 65538, 393199, 0, 65539, 327680, 0, 131072, 327681, 0, 131073, 327682, 0, 131073, 327683, 0, 131074, 327689, 0, 131072, 327690, 0, 65542, 327691, 0, 65541, 327692, 0, 131074, 327704, 0, 131072, 327705, 0, 131073, 327706, 0, 65543, 458735, 0, 65539, 393226, 0, 65540, 393227, 0, 131074, 393242, 0, 65539, 524271, 0, 65539, 458762, 0, 131075, 458778, 0, 65539, 589807, 0, 65539, 524290, 0, 0, 524291, 0, 2, 524311, 0, 4, 524312, 0, 196609, 524313, 0, 196609, 524314, 0, 262151, 655343, 0, 65539, 589826, 0, 131072, 589827, 0, 131074, 589847, 0, 65539, 589850, 0, 65539, 720879, 0, 65539, 655366, 0, 3, 655380, 0, 4, 655381, 0, 196610, 655383, 0, 131075, 655386, 0, 65539, 786415, 0, 65539, 720902, 0, 262148, 720903, 0, 196610, 720915, 0, 4, 720916, 0, 196615, 720921, 0, 0, 720922, 0, 131079, 851951, 0, 65539, 786438, 0, 65539, 786450, 0, 4, 786451, 0, 196615, 786454, 0, 196608, 786455, 0, 196609, 786456, 0, 196609, 786457, 0, 196614, 786458, 0, 65543, 917487, 0, 65539, 851972, 0, 4, 851973, 0, 196609, 851974, 0, 196616, 851975, 0, 7, 851985, 0, 4, 851986, 0, 196615, 851989, 0, 196611, 851994, 0, 65539, 983023, 0, 65539, 917507, 0, 0, 917508, 0, 131079, 917511, 0, 196612, 917512, 0, 196609, 917513, 0, 7, 917520, 0, 4, 917521, 0, 196615, 917526, 0, 196608, 917527, 0, 196610, 917530, 0, 65539, 1048559, 0, 65539, 983042, 0, 0, 983043, 0, 131078, 983044, 0, 65538, 983049, 0, 131076, 983050, 0, 2, 983055, 0, 0, 983056, 0, 131079, 983066, 0, 65539, 1114095, 0, 196612, 1114096, 0, 196609, 1114097, 0, 196609, 1114098, 0, 196609, 1114099, 0, 196609, 1114100, 0, 196609, 1114101, 0, 196609, 1114102, 0, 196609, 1114103, 0, 196609, 1114104, 0, 196609, 1114105, 0, 196609, 1114106, 0, 196609, 1114107, 0, 196609, 1114108, 0, 196609, 1114109, 0, 196609, 1114110, 0, 196609, 1114111, 0, 196609, 1048576, 0, 196609, 1048577, 0, 196609, 1048578, 0, 196614, 1048579, 0, 131073, 1048580, 0, 196613, 1048581, 0, 196609, 1048582, 0, 196609, 1048583, 0, 196609, 1048584, 0, 196609, 1048585, 0, 196614, 1048586, 0, 196613, 1048587, 0, 196609, 1048588, 0, 196609, 1048589, 0, 196609, 1048590, 0, 196609, 1048591, 0, 196614, 1048592, 0, 196613, 1048593, 0, 196609, 1048594, 0, 196609, 1048595, 0, 196609, 1048596, 0, 196609, 1048597, 0, 196609, 1048598, 0, 196609, 1048599, 0, 196609, 1048600, 0, 196609, 1048601, 0, 196609, 1048602, 0, 196615 ) [node name="Camera2D" type="Camera2D" parent="."] -position = Vector2( 111, 71 ) +position = Vector2( 167, 111 ) current = true smoothing_enabled = true [node name="YSort" type="YSort" parent="."] [node name="Player" parent="YSort" instance=ExtResource( 2 )] -position = Vector2( 111, 71 ) +position = Vector2( 167, 111 ) __meta__ = { "_edit_group_": true } @@ -569,6 +569,21 @@ position = Vector2( 188, 145 ) [node name="Bush3" parent="YSort/Bushes" instance=ExtResource( 1 )] position = Vector2( 192, 56 ) +[node name="Bush5" parent="YSort/Bushes" instance=ExtResource( 1 )] +position = Vector2( 536, 96 ) + +[node name="Bush6" parent="YSort/Bushes" instance=ExtResource( 1 )] +position = Vector2( 516, 16 ) + +[node name="Bush7" parent="YSort/Bushes" instance=ExtResource( 1 )] +position = Vector2( 438, 338 ) + +[node name="Bush8" parent="YSort/Bushes" instance=ExtResource( 1 )] +position = Vector2( 297, 327 ) + +[node name="Bush9" parent="YSort/Bushes" instance=ExtResource( 1 )] +position = Vector2( 230, 243 ) + [node name="Bush4" parent="YSort/Bushes" instance=ExtResource( 1 )] position = Vector2( 240, 152 ) @@ -609,11 +624,56 @@ position = Vector2( 128, 121 ) [node name="Tree" parent="YSort/Trees" instance=ExtResource( 10 )] position = Vector2( 127, 40 ) +[node name="Tree2" parent="YSort/Trees" instance=ExtResource( 10 )] +position = Vector2( 441, 28 ) + +[node name="Tree3" parent="YSort/Trees" instance=ExtResource( 10 )] +position = Vector2( 482, 234 ) + +[node name="Tree6" parent="YSort/Trees" instance=ExtResource( 10 )] +position = Vector2( 385, 399 ) + +[node name="Tree7" parent="YSort/Trees" instance=ExtResource( 10 )] +position = Vector2( 606, 296 ) + +[node name="Tree4" parent="YSort/Trees" instance=ExtResource( 10 )] +position = Vector2( 633, 182 ) + +[node name="Tree5" parent="YSort/Trees" instance=ExtResource( 10 )] +position = Vector2( 661, -28 ) + +[node name="Tree8" parent="YSort/Trees" instance=ExtResource( 10 )] +position = Vector2( 695, -289 ) + +[node name="Tree9" parent="YSort/Trees" instance=ExtResource( 10 )] +position = Vector2( 723, -276 ) + +[node name="Tree10" parent="YSort/Trees" instance=ExtResource( 10 )] +position = Vector2( 750, -263 ) + +[node name="Tree11" parent="YSort/Trees" instance=ExtResource( 10 )] +position = Vector2( 773, -243 ) + +[node name="Tree12" parent="YSort/Trees" instance=ExtResource( 10 )] +position = Vector2( 800, -231 ) + +[node name="Tree13" parent="YSort/Trees" instance=ExtResource( 10 )] +position = Vector2( 822, -208 ) + +[node name="Tree14" parent="YSort/Trees" instance=ExtResource( 10 )] +position = Vector2( 677, -310 ) + +[node name="Tree15" parent="YSort/Trees" instance=ExtResource( 10 )] +position = Vector2( 744, -295 ) + +[node name="Tree16" parent="YSort/Trees" instance=ExtResource( 10 )] +position = Vector2( 792, -272 ) + [node name="Bat" parent="YSort" instance=ExtResource( 8 )] -position = Vector2( 198, 35 ) +position = Vector2( 215, 34 ) [node name="Bat2" parent="YSort" instance=ExtResource( 8 )] -position = Vector2( 224, 122 ) +position = Vector2( 274, 89 ) [node name="Bat3" parent="YSort" instance=ExtResource( 8 )] position = Vector2( 37, 90 ) diff --git a/ActionRPG-HeartBeast/World/Grass.gd b/ActionRPG-HeartBeast/World/Grass.gd index 9290c5a..7f8e14a 100644 --- a/ActionRPG-HeartBeast/World/Grass.gd +++ b/ActionRPG-HeartBeast/World/Grass.gd @@ -13,6 +13,6 @@ func create_grass_effect(): get_parent().add_child(grassEffect) grassEffect.global_position = global_position -func _on_Hurtbox_area_entered(area): +func _on_Hurtbox_area_entered(_area): create_grass_effect() queue_free() diff --git a/ActionRPG-HeartBeast/build/.DS_Store b/ActionRPG-HeartBeast/build/.DS_Store index c6b9cfd..88857a6 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 index a09edd2..fdade54 100644 Binary files a/ActionRPG-HeartBeast/build/web/.DS_Store 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 9adc069..2a30c3c 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 ef0c3e8..c0d59f7 100644 --- a/ActionRPG-HeartBeast/build/web/index.html +++ b/ActionRPG-HeartBeast/build/web/index.html @@ -139,7 +139,7 @@