Tutorials completed.
This commit is contained in:
parent
d103dac31a
commit
98c8da0338
@ -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/Effect.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://Effects/EnemyDeathEffect.png" type="Texture" id=2]
|
[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]
|
[sub_resource type="AtlasTexture" id=1]
|
||||||
atlas = ExtResource( 2 )
|
atlas = ExtResource( 2 )
|
||||||
@ -56,3 +57,7 @@ frames = SubResource( 11 )
|
|||||||
animation = "Animate"
|
animation = "Animate"
|
||||||
offset = Vector2( 0, -8 )
|
offset = Vector2( 0, -8 )
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||||
|
stream = ExtResource( 3 )
|
||||||
|
autoplay = true
|
||||||
|
@ -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/Effect.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://Effects/HitEffect.png" type="Texture" id=2]
|
[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]
|
[sub_resource type="AtlasTexture" id=1]
|
||||||
atlas = ExtResource( 2 )
|
atlas = ExtResource( 2 )
|
||||||
@ -24,3 +25,7 @@ frames = SubResource( 3 )
|
|||||||
animation = "Animate"
|
animation = "Animate"
|
||||||
offset = Vector2( 0, -8 )
|
offset = Vector2( 0, -8 )
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||||
|
stream = ExtResource( 3 )
|
||||||
|
autoplay = true
|
||||||
|
@ -5,6 +5,7 @@ const EnemyDeathEffect = preload("res://Effects/EnemyDeathEffect.tscn")
|
|||||||
export var ACCELERATION = 300
|
export var ACCELERATION = 300
|
||||||
export var MAX_SPEED = 50
|
export var MAX_SPEED = 50
|
||||||
export var FRICTION = 200
|
export var FRICTION = 200
|
||||||
|
export var WANDER_TARGET_RANGE = 4
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
IDLE,
|
IDLE,
|
||||||
@ -22,6 +23,11 @@ onready var stats = $Stats
|
|||||||
onready var playerDetectionZone = $PlayerDetectionZone
|
onready var playerDetectionZone = $PlayerDetectionZone
|
||||||
onready var hurtbox = $Hurtbox
|
onready var hurtbox = $Hurtbox
|
||||||
onready var softCollision = $SoftCollision
|
onready var softCollision = $SoftCollision
|
||||||
|
onready var wanderController = $WanderController
|
||||||
|
onready var animationPlayer = $AnimationPlayer
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
state = pick_new_state([IDLE,WANDER])
|
||||||
|
|
||||||
func _physics_process(delta):
|
func _physics_process(delta):
|
||||||
knockback = knockback.move_toward(Vector2.ZERO, 200 * delta)
|
knockback = knockback.move_toward(Vector2.ZERO, 200 * delta)
|
||||||
@ -31,15 +37,21 @@ func _physics_process(delta):
|
|||||||
IDLE:
|
IDLE:
|
||||||
velocity = velocity.move_toward(Vector2.ZERO, FRICTION * delta)
|
velocity = velocity.move_toward(Vector2.ZERO, FRICTION * delta)
|
||||||
seek_player()
|
seek_player()
|
||||||
|
if wanderController.get_time_left() == 0:
|
||||||
|
update_wander()
|
||||||
|
|
||||||
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:
|
CHASE:
|
||||||
var player = playerDetectionZone.player
|
var player = playerDetectionZone.player
|
||||||
if player != null:
|
if player != null:
|
||||||
var direction = (player.global_position - global_position).normalized()
|
accelerate_towards_point(player.global_position,delta)
|
||||||
velocity = velocity.move_toward(direction * MAX_SPEED, ACCELERATION * delta)
|
|
||||||
else:
|
else:
|
||||||
state = IDLE
|
state = IDLE
|
||||||
sprite.flip_h = velocity.x < 0
|
sprite.flip_h = velocity.x < 0
|
||||||
@ -48,15 +60,29 @@ func _physics_process(delta):
|
|||||||
velocity += softCollision.get_push_vector() * delta * 400
|
velocity += softCollision.get_push_vector() * delta * 400
|
||||||
velocity = move_and_slide(velocity)
|
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():
|
func seek_player():
|
||||||
if playerDetectionZone.can_see_player():
|
if playerDetectionZone.can_see_player():
|
||||||
state = CHASE
|
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):
|
func _on_Hurtbox_area_entered(area):
|
||||||
stats.health -= area.damage
|
stats.health -= area.damage
|
||||||
knockback = area.knockback_vector * 120
|
knockback = area.knockback_vector * 120
|
||||||
hurtbox.create_hit_effect()
|
hurtbox.create_hit_effect()
|
||||||
|
hurtbox.start_invincibility(0.4)
|
||||||
#queue_free() # Replace with function body.
|
#queue_free() # Replace with function body.
|
||||||
|
|
||||||
func _on_Stats_no_health():
|
func _on_Stats_no_health():
|
||||||
@ -64,3 +90,10 @@ func _on_Stats_no_health():
|
|||||||
var enemyDeathEffect = EnemyDeathEffect.instance()
|
var enemyDeathEffect = EnemyDeathEffect.instance()
|
||||||
get_parent().add_child(enemyDeathEffect)
|
get_parent().add_child(enemyDeathEffect)
|
||||||
enemyDeathEffect.global_position = global_position
|
enemyDeathEffect.global_position = global_position
|
||||||
|
|
||||||
|
|
||||||
|
func _on_Hurtbox_invincibility_started():
|
||||||
|
animationPlayer.play("Start")
|
||||||
|
|
||||||
|
func _on_Hurtbox_invincibility_ended():
|
||||||
|
animationPlayer.play("Stop")
|
||||||
|
@ -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://Enemies/Bat.png" type="Texture" id=1]
|
||||||
[ext_resource path="res://Shadows/SmallShadow.png" type="Texture" id=2]
|
[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://Enemies/PlayerDetectionZone.tscn" type="PackedScene" id=6]
|
||||||
[ext_resource path="res://Overlap/Hitbox.tscn" type="PackedScene" id=7]
|
[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/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]
|
[sub_resource type="AtlasTexture" id=1]
|
||||||
atlas = ExtResource( 1 )
|
atlas = ExtResource( 1 )
|
||||||
@ -53,13 +60,63 @@ radius = 5.0
|
|||||||
[sub_resource type="CircleShape2D" id=11]
|
[sub_resource type="CircleShape2D" id=11]
|
||||||
radius = 5.0
|
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"]
|
[node name="Bat" type="KinematicBody2D"]
|
||||||
collision_layer = 16
|
collision_layer = 16
|
||||||
script = ExtResource( 4 )
|
script = ExtResource( 4 )
|
||||||
|
|
||||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||||
|
material = SubResource( 12 )
|
||||||
frames = SubResource( 6 )
|
frames = SubResource( 6 )
|
||||||
animation = "Fly"
|
animation = "Fly"
|
||||||
|
frame = 3
|
||||||
playing = true
|
playing = true
|
||||||
offset = Vector2( 0, -12 )
|
offset = Vector2( 0, -12 )
|
||||||
|
|
||||||
@ -101,7 +158,16 @@ shape = SubResource( 10 )
|
|||||||
[node name="CollisionShape2D" parent="SoftCollision" index="0"]
|
[node name="CollisionShape2D" parent="SoftCollision" index="0"]
|
||||||
shape = SubResource( 11 )
|
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="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"]
|
[connection signal="no_health" from="Stats" to="." method="_on_Stats_no_health"]
|
||||||
|
|
||||||
[editable path="Hurtbox"]
|
[editable path="Hurtbox"]
|
||||||
|
@ -9,5 +9,5 @@ func can_see_player():
|
|||||||
func _on_PlayerDetectionZone_body_entered(body):
|
func _on_PlayerDetectionZone_body_entered(body):
|
||||||
player = body
|
player = body
|
||||||
|
|
||||||
func _on_PlayerDetectionZone_body_exited(body):
|
func _on_PlayerDetectionZone_body_exited(_body):
|
||||||
player = null
|
player = null
|
||||||
|
24
ActionRPG-HeartBeast/Overlap/WanderController.gd
Normal file
24
ActionRPG-HeartBeast/Overlap/WanderController.gd
Normal file
@ -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()
|
12
ActionRPG-HeartBeast/Overlap/WanderController.tscn
Normal file
12
ActionRPG-HeartBeast/Overlap/WanderController.tscn
Normal file
@ -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"]
|
@ -1,5 +1,7 @@
|
|||||||
extends KinematicBody2D
|
extends KinematicBody2D
|
||||||
|
|
||||||
|
const PlayerHurtSound = preload("res://Player/PlayerHurtSound.tscn")
|
||||||
|
|
||||||
var velocity = Vector2.ZERO
|
var velocity = Vector2.ZERO
|
||||||
var input_vector = Vector2.ZERO
|
var input_vector = Vector2.ZERO
|
||||||
var roll_vector = Vector2.DOWN
|
var roll_vector = Vector2.DOWN
|
||||||
@ -19,6 +21,7 @@ enum {
|
|||||||
var state = MOVE
|
var state = MOVE
|
||||||
|
|
||||||
onready var animationPlayer = $AnimationPlayer
|
onready var animationPlayer = $AnimationPlayer
|
||||||
|
onready var blinkAnimationPlayer = $BlinkAnimationPlayer
|
||||||
onready var animationTree = $AnimationTree
|
onready var animationTree = $AnimationTree
|
||||||
onready var animationState = animationTree.get("parameters/playback")
|
onready var animationState = animationTree.get("parameters/playback")
|
||||||
onready var swordHitbox = $HitboxPivot/SwordHitbox
|
onready var swordHitbox = $HitboxPivot/SwordHitbox
|
||||||
@ -28,6 +31,7 @@ func _ready():
|
|||||||
stats.connect("no_health", self, "queue_free")
|
stats.connect("no_health", self, "queue_free")
|
||||||
animationTree.active = true
|
animationTree.active = true
|
||||||
swordHitbox.knockback_vector = roll_vector
|
swordHitbox.knockback_vector = roll_vector
|
||||||
|
blinkAnimationPlayer.play("Stop")
|
||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
match state:
|
match state:
|
||||||
@ -35,10 +39,10 @@ func _process(delta):
|
|||||||
move_state(delta)
|
move_state(delta)
|
||||||
|
|
||||||
ROLL:
|
ROLL:
|
||||||
roll_state(delta)
|
roll_state()
|
||||||
|
|
||||||
ATTACK:
|
ATTACK:
|
||||||
attack_state(delta)
|
attack_state()
|
||||||
|
|
||||||
func move_state(delta):
|
func move_state(delta):
|
||||||
input_vector.x = Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left")
|
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():
|
func roll_animation_finished():
|
||||||
state = MOVE
|
state = MOVE
|
||||||
|
|
||||||
func roll_state(delta):
|
func roll_state():
|
||||||
velocity = roll_vector * ROLL_SPEED
|
velocity = roll_vector * ROLL_SPEED
|
||||||
animationState.travel("Roll")
|
animationState.travel("Roll")
|
||||||
move()
|
move()
|
||||||
|
|
||||||
func attack_state(delta):
|
func attack_state():
|
||||||
#velocity = Vector2.ZERO
|
#velocity = Vector2.ZERO
|
||||||
#animationTree.set("parameters/Attack/blend_position", input_vector)
|
#animationTree.set("parameters/Attack/blend_position", input_vector)
|
||||||
velocity = Vector2.ZERO
|
velocity = Vector2.ZERO
|
||||||
@ -95,7 +99,17 @@ func attack_aninimation_finished():
|
|||||||
# pass
|
# pass
|
||||||
|
|
||||||
|
|
||||||
func _on_Hurtbox_area_entered(area):
|
func _on_Hurtbox_area_entered(_area):
|
||||||
stats.health -= 1
|
stats.health -= 1
|
||||||
hurtBox.start_invincibility(0.5)
|
hurtBox.start_invincibility(0.6)
|
||||||
hurtBox.create_hit_effect()
|
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")
|
||||||
|
@ -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.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://Player/Player.png" type="Texture" id=2]
|
[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://Player/SwordHitbox.gd" type="Script" id=4]
|
||||||
[ext_resource path="res://Overlap/Hurtbox.tscn" type="PackedScene" id=5]
|
[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://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]
|
[sub_resource type="CapsuleShape2D" id=1]
|
||||||
radius = 4.0
|
radius = 4.0
|
||||||
@ -64,6 +71,24 @@ tracks/3/keys = {
|
|||||||
"update": 1,
|
"update": 1,
|
||||||
"values": [ false, true ]
|
"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]
|
[sub_resource type="Animation" id=28]
|
||||||
resource_name = "AttackLeft"
|
resource_name = "AttackLeft"
|
||||||
@ -118,6 +143,24 @@ tracks/3/keys = {
|
|||||||
"update": 1,
|
"update": 1,
|
||||||
"values": [ false, true ]
|
"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]
|
[sub_resource type="Animation" id=29]
|
||||||
resource_name = "AttackRight"
|
resource_name = "AttackRight"
|
||||||
@ -172,6 +215,24 @@ tracks/3/keys = {
|
|||||||
"update": 1,
|
"update": 1,
|
||||||
"values": [ false, true ]
|
"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]
|
[sub_resource type="Animation" id=30]
|
||||||
resource_name = "AttackUp"
|
resource_name = "AttackUp"
|
||||||
@ -226,6 +287,24 @@ tracks/3/keys = {
|
|||||||
"update": 1,
|
"update": 1,
|
||||||
"values": [ false, true ]
|
"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]
|
[sub_resource type="Animation" id=9]
|
||||||
resource_name = "IdleDown"
|
resource_name = "IdleDown"
|
||||||
@ -351,6 +430,24 @@ tracks/1/keys = {
|
|||||||
"method": "roll_animation_finished"
|
"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]
|
[sub_resource type="Animation" id=43]
|
||||||
resource_name = "RollLeft"
|
resource_name = "RollLeft"
|
||||||
@ -381,6 +478,24 @@ tracks/1/keys = {
|
|||||||
"method": "roll_animation_finished"
|
"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]
|
[sub_resource type="Animation" id=42]
|
||||||
resource_name = "RollRight"
|
resource_name = "RollRight"
|
||||||
@ -411,6 +526,20 @@ tracks/1/keys = {
|
|||||||
"method": "roll_animation_finished"
|
"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]
|
[sub_resource type="Animation" id=44]
|
||||||
resource_name = "RollUp"
|
resource_name = "RollUp"
|
||||||
@ -441,10 +570,29 @@ tracks/1/keys = {
|
|||||||
"method": "roll_animation_finished"
|
"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]
|
[sub_resource type="Animation" id=6]
|
||||||
resource_name = "RunDown"
|
resource_name = "RunDown"
|
||||||
length = 0.6
|
length = 0.6
|
||||||
|
loop = true
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
tracks/0/path = NodePath("Sprite:frame")
|
tracks/0/path = NodePath("Sprite:frame")
|
||||||
tracks/0/interp = 1
|
tracks/0/interp = 1
|
||||||
@ -647,6 +795,54 @@ height = 12.0
|
|||||||
radius = 5.0
|
radius = 5.0
|
||||||
height = 6.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"]
|
[node name="Player" type="KinematicBody2D"]
|
||||||
collision_layer = 2
|
collision_layer = 2
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
@ -656,6 +852,7 @@ position = Vector2( 0, 1 )
|
|||||||
texture = ExtResource( 6 )
|
texture = ExtResource( 6 )
|
||||||
|
|
||||||
[node name="Sprite" type="Sprite" parent="."]
|
[node name="Sprite" type="Sprite" parent="."]
|
||||||
|
material = SubResource( 55 )
|
||||||
position = Vector2( 0, -9 )
|
position = Vector2( 0, -9 )
|
||||||
texture = ExtResource( 2 )
|
texture = ExtResource( 2 )
|
||||||
hframes = 60
|
hframes = 60
|
||||||
@ -694,7 +891,7 @@ parameters/Run/blend_position = Vector2( 0, 1 )
|
|||||||
|
|
||||||
[node name="HitboxPivot" type="Position2D" parent="."]
|
[node name="HitboxPivot" type="Position2D" parent="."]
|
||||||
position = Vector2( 0, -4 )
|
position = Vector2( 0, -4 )
|
||||||
rotation = 1.5708
|
rotation = 4.71239
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_gizmo_extents_": 8.0
|
"_gizmo_extents_": 8.0
|
||||||
}
|
}
|
||||||
@ -715,7 +912,17 @@ collision_layer = 4
|
|||||||
position = Vector2( 0, -4 )
|
position = Vector2( 0, -4 )
|
||||||
shape = SubResource( 52 )
|
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="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="HitboxPivot/SwordHitbox"]
|
||||||
[editable path="Hurtbox"]
|
[editable path="Hurtbox"]
|
||||||
|
16
ActionRPG-HeartBeast/Player/PlayerHurtSound.gd
Normal file
16
ActionRPG-HeartBeast/Player/PlayerHurtSound.gd
Normal file
@ -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
|
9
ActionRPG-HeartBeast/Player/PlayerHurtSound.tscn
Normal file
9
ActionRPG-HeartBeast/Player/PlayerHurtSound.tscn
Normal file
@ -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 )
|
16
ActionRPG-HeartBeast/WhiteColor_shader.tres
Normal file
16
ActionRPG-HeartBeast/WhiteColor_shader.tres
Normal file
@ -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;
|
||||||
|
}"
|
File diff suppressed because one or more lines are too long
@ -13,6 +13,6 @@ func create_grass_effect():
|
|||||||
get_parent().add_child(grassEffect)
|
get_parent().add_child(grassEffect)
|
||||||
grassEffect.global_position = global_position
|
grassEffect.global_position = global_position
|
||||||
|
|
||||||
func _on_Hurtbox_area_entered(area):
|
func _on_Hurtbox_area_entered(_area):
|
||||||
create_grass_effect()
|
create_grass_effect()
|
||||||
queue_free()
|
queue_free()
|
||||||
|
BIN
ActionRPG-HeartBeast/build/.DS_Store
vendored
BIN
ActionRPG-HeartBeast/build/.DS_Store
vendored
Binary file not shown.
BIN
ActionRPG-HeartBeast/build/web/.DS_Store
vendored
BIN
ActionRPG-HeartBeast/build/web/.DS_Store
vendored
Binary file not shown.
Binary file not shown.
@ -139,7 +139,7 @@
|
|||||||
<script type='text/javascript' src='index.js'></script>
|
<script type='text/javascript' src='index.js'></script>
|
||||||
<script type='text/javascript'>//<![CDATA[
|
<script type='text/javascript'>//<![CDATA[
|
||||||
|
|
||||||
const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":2291520,"index.wasm":13790961},"focusCanvas":true,"gdnativeLibs":[]};
|
const GODOT_CONFIG = {"args":[],"canvasResizePolicy":2,"executable":"index","experimentalVK":false,"fileSizes":{"index.pck":2313264,"index.wasm":13790961},"focusCanvas":true,"gdnativeLibs":[]};
|
||||||
var engine = new Engine(GODOT_CONFIG);
|
var engine = new Engine(GODOT_CONFIG);
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user