Added bat enemies with stats and better touch controls
This commit is contained in:
@ -20,9 +20,11 @@ var state = MOVE
|
||||
onready var animationPlayer = $AnimationPlayer
|
||||
onready var animationTree = $AnimationTree
|
||||
onready var animationState = animationTree.get("parameters/playback")
|
||||
onready var swordHitbox = $HitboxPivot/SwordHitbox
|
||||
|
||||
func _ready():
|
||||
animationTree.active = true
|
||||
swordHitbox.knockback_vector = roll_vector
|
||||
|
||||
func _process(delta):
|
||||
match state:
|
||||
@ -42,6 +44,7 @@ func move_state(delta):
|
||||
|
||||
if input_vector != Vector2.ZERO:
|
||||
roll_vector = input_vector
|
||||
swordHitbox.knockback_vector = input_vector
|
||||
animationTree.set("parameters/Idle/blend_position", input_vector)
|
||||
animationTree.set("parameters/Run/blend_position", input_vector)
|
||||
animationTree.set("parameters/Attack/blend_position", input_vector)
|
||||
|
@ -1,8 +1,9 @@
|
||||
[gd_scene load_steps=53 format=2]
|
||||
[gd_scene load_steps=54 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]
|
||||
[ext_resource path="res://Player/SwordHitbox.gd" type="Script" id=4]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id=1]
|
||||
radius = 4.0
|
||||
@ -691,6 +692,7 @@ __meta__ = {
|
||||
[node name="SwordHitbox" parent="HitboxPivot" instance=ExtResource( 3 )]
|
||||
position = Vector2( 15, 0 )
|
||||
collision_mask = 8
|
||||
script = ExtResource( 4 )
|
||||
|
||||
[node name="CollisionShape2D" parent="HitboxPivot/SwordHitbox" index="0"]
|
||||
shape = SubResource( 40 )
|
||||
|
3
ActionRPG-HeartBeast/Player/SwordHitbox.gd
Normal file
3
ActionRPG-HeartBeast/Player/SwordHitbox.gd
Normal file
@ -0,0 +1,3 @@
|
||||
extends "res://Overlap/Hitbox.gd"
|
||||
|
||||
var knockback_vector = Vector2.ZERO
|
Reference in New Issue
Block a user