se faire taper dessus et pu être en fullscreen
This commit is contained in:
parent
74fa828082
commit
8114b979b4
@ -399,6 +399,7 @@ angular_velocity_max = 50.0
|
||||
color = Color(0.623529, 0, 0, 0.729412)
|
||||
|
||||
[node name="Atk_cooldown" type="Timer" parent="."]
|
||||
wait_time = 2.0
|
||||
autostart = true
|
||||
|
||||
[node name="LvlUp" type="CPUParticles2D" parent="."]
|
||||
|
@ -6,14 +6,16 @@ extends CharacterBody2D
|
||||
@onready var is_attacking: bool = false
|
||||
@onready var is_dying: bool = false
|
||||
|
||||
@export var level: int = 1
|
||||
@export var level: int = 7
|
||||
@export var hp: int = 100
|
||||
@export var maxhp: int = 100
|
||||
@export var maxvel: float = 2
|
||||
@export var experience: int = 0
|
||||
@export var state: String = "Idle"
|
||||
@export var damage: int = 5
|
||||
@export var maxAtks: int = 1
|
||||
|
||||
@onready var currAtks: int = 0
|
||||
@onready var anim: Node = get_node("Sprite")
|
||||
@onready var cooldown: Node = get_node("Atk_cooldown")
|
||||
@onready var lvlanim: Node = get_node("LvlUp")
|
||||
@ -47,10 +49,13 @@ func _process(delta):
|
||||
is_facing_left = velocity.x >= 0
|
||||
|
||||
# AI STUFF
|
||||
velocity = processAI(list,delta)
|
||||
#velocity = processAI(list,delta)
|
||||
|
||||
velocity.x += delta
|
||||
velocity.y += delta
|
||||
|
||||
if !hitanim.is_emitting():
|
||||
anim.modulate(Color(0,0,0,1))
|
||||
anim.modulate.a = 1
|
||||
|
||||
move_and_slide()
|
||||
|
||||
@ -98,7 +103,7 @@ func receive_damage(dmg):
|
||||
pass
|
||||
hp -= dmg
|
||||
hitanim.restart()
|
||||
anim.modulate(Color(0,0,0,.5))
|
||||
anim.modulate.a = 0.5
|
||||
if hp < 0:
|
||||
velocity = Vector2(0,0)
|
||||
setAnimState("Die")
|
||||
@ -118,16 +123,30 @@ func setLevel(lvl):
|
||||
lvlsnd.play()
|
||||
|
||||
if level > 2:
|
||||
cooldown.wait_time = 0.5
|
||||
cooldown.wait_time = 1
|
||||
|
||||
if level > 5:
|
||||
damage = 12
|
||||
|
||||
if level > 7:
|
||||
maxAtks = 2
|
||||
|
||||
maxhp += 5
|
||||
hp = maxhp
|
||||
|
||||
|
||||
func _on_atk_cooldown_timeout():
|
||||
currAtks = maxAtks
|
||||
attack()
|
||||
|
||||
|
||||
func _on_sprite_animation_looped():
|
||||
if is_attacking:
|
||||
currAtks -= 1
|
||||
stop_attack()
|
||||
if currAtks > 0:
|
||||
is_facing_left = !is_facing_left
|
||||
attack()
|
||||
is_dying = false
|
||||
|
||||
|
||||
|
@ -19,7 +19,6 @@ config/icon="res://icon.svg"
|
||||
|
||||
window/size/viewport_width=960
|
||||
window/size/viewport_height=540
|
||||
window/size/mode=3
|
||||
window/size/resizable=false
|
||||
window/stretch/mode="viewport"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user