Imported into Godot 4.3
This commit is contained in:
@ -1,12 +1,9 @@
|
||||
extends KinematicBody2D
|
||||
|
||||
const PlayerHurtSound = preload("res://Player/PlayerHurtSound.tscn")
|
||||
|
||||
var velocity = Vector2.ZERO
|
||||
var input_vector = Vector2.ZERO
|
||||
var roll_vector = Vector2.DOWN
|
||||
var stats = PlayerStats
|
||||
|
||||
const PlayerHurtSound = preload("res://Player/PlayerHurtSound.tscn")
|
||||
|
||||
const ACCELERATION = 500
|
||||
const MAX_SPEED = 80
|
||||
const ROLL_SPEED = 120
|
||||
@ -20,15 +17,15 @@ 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
|
||||
onready var hurtBox = $Hurtbox
|
||||
@onready var animationPlayer = $AnimationPlayer
|
||||
@onready var blinkAnimationPlayer = $BlinkAnimationPlayer
|
||||
@onready var animationTree = $AnimationTree
|
||||
@onready var animationState = animationTree.get("parameters/playback")
|
||||
@onready var swordHitbox = $HitboxPivot/SwordHitbox
|
||||
@onready var hurtBox = $Hurtbox
|
||||
|
||||
func _ready():
|
||||
stats.connect("no_health", self, "queue_free")
|
||||
stats.connect("no_health", Callable(self, "queue_free"))
|
||||
animationTree.active = true
|
||||
swordHitbox.knockback_vector = roll_vector
|
||||
blinkAnimationPlayer.play("Stop")
|
||||
@ -89,7 +86,9 @@ func attack_state():
|
||||
#velocity = move_and_slide(velocity)
|
||||
|
||||
func move():
|
||||
velocity = move_and_slide(velocity)
|
||||
set_velocity(velocity)
|
||||
move_and_slide()
|
||||
velocity = velocity
|
||||
|
||||
func attack_aninimation_finished():
|
||||
state = MOVE
|
||||
@ -103,7 +102,7 @@ func _on_Hurtbox_area_entered(_area):
|
||||
stats.health -= 1
|
||||
hurtBox.start_invincibility(0.6)
|
||||
hurtBox.create_hit_effect()
|
||||
var playerHurtSounds = PlayerHurtSound.instance()
|
||||
var playerHurtSounds = PlayerHurtSound.instantiate()
|
||||
get_tree().current_scene.add_child(playerHurtSounds)
|
||||
|
||||
|
||||
|
@ -1,8 +1,9 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Player.png-3d0801c65bdfc563657cfa304115f1c7.stex"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://7uqxws8djwvh"
|
||||
path="res://.godot/imported/Player.png-3d0801c65bdfc563657cfa304115f1c7.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
@ -10,26 +11,24 @@ metadata={
|
||||
[deps]
|
||||
|
||||
source_file="res://Player/Player.png"
|
||||
dest_files=[ "res://.import/Player.png-3d0801c65bdfc563657cfa304115f1c7.stex" ]
|
||||
dest_files=["res://.godot/imported/Player.png-3d0801c65bdfc563657cfa304115f1c7.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
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/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=false
|
||||
svg/scale=1.0
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,7 @@ extends AudioStreamPlayer
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
connect("finished", self, "queue_free")
|
||||
connect("finished", Callable(self, "queue_free"))
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
|
Reference in New Issue
Block a user