Compare commits
No commits in common. "ea0172c66da1f14514de59bb43756e6ceebaba70" and "ddffee61af9242c493dae432cf562498f3b0fff6" have entirely different histories.
ea0172c66d
...
ddffee61af
|
@ -1,3 +0,0 @@
|
||||||
[gd_resource type="ShaderMaterial" format=2]
|
|
||||||
|
|
||||||
[resource]
|
|
|
@ -8,7 +8,7 @@ var frozen = false
|
||||||
var target
|
var target
|
||||||
|
|
||||||
func _physics_process(delta):
|
func _physics_process(delta):
|
||||||
if target != null and is_instance_valid(target) and not target.dead:
|
if target != null and is_instance_valid(target):
|
||||||
var target_texture = target.get_node("Sprite").frames.get_frame("idle", 0)
|
var target_texture = target.get_node("Sprite").frames.get_frame("idle", 0)
|
||||||
var target_sprite_size = Vector2(target_texture.get_width(), target_texture.get_width())
|
var target_sprite_size = Vector2(target_texture.get_width(), target_texture.get_width())
|
||||||
var target_center = target.global_position + (target_sprite_size / 2)
|
var target_center = target.global_position + (target_sprite_size / 2)
|
||||||
|
|
|
@ -19,6 +19,7 @@ script = ExtResource( 2 )
|
||||||
use_parent_material = true
|
use_parent_material = true
|
||||||
frames = ExtResource( 1 )
|
frames = ExtResource( 1 )
|
||||||
animation = "idle"
|
animation = "idle"
|
||||||
|
frame = 3
|
||||||
playing = true
|
playing = true
|
||||||
centered = false
|
centered = false
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ flip_h = true
|
||||||
use_parent_material = true
|
use_parent_material = true
|
||||||
frames = ExtResource( 1 )
|
frames = ExtResource( 1 )
|
||||||
animation = "idle"
|
animation = "idle"
|
||||||
frame = 4
|
frame = 1
|
||||||
playing = true
|
playing = true
|
||||||
centered = false
|
centered = false
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ script = ExtResource( 2 )
|
||||||
use_parent_material = true
|
use_parent_material = true
|
||||||
frames = ExtResource( 1 )
|
frames = ExtResource( 1 )
|
||||||
animation = "idle"
|
animation = "idle"
|
||||||
frame = 2
|
frame = 1
|
||||||
playing = true
|
playing = true
|
||||||
centered = false
|
centered = false
|
||||||
|
|
||||||
|
|
|
@ -4,13 +4,13 @@ var velocity = Vector2.ZERO
|
||||||
var sin_timer = .0
|
var sin_timer = .0
|
||||||
var speed = 64
|
var speed = 64
|
||||||
var poisoned = false
|
var poisoned = false
|
||||||
var damage = 8
|
var damage = 5
|
||||||
var frozen = false
|
var frozen = false
|
||||||
var target
|
var target
|
||||||
|
|
||||||
func _physics_process(delta):
|
func _physics_process(delta):
|
||||||
sin_timer += delta
|
sin_timer += delta
|
||||||
if target != null and is_instance_valid(target) and not target.dead:
|
if target != null and is_instance_valid(target):
|
||||||
var target_texture = target.get_node("Sprite").frames.get_frame("idle", 0)
|
var target_texture = target.get_node("Sprite").frames.get_frame("idle", 0)
|
||||||
var target_sprite_size = Vector2(target_texture.get_width(), target_texture.get_width())
|
var target_sprite_size = Vector2(target_texture.get_width(), target_texture.get_width())
|
||||||
var target_center = target.global_position + (target_sprite_size / 2)
|
var target_center = target.global_position + (target_sprite_size / 2)
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
extends KinematicBody2D
|
extends KinematicBody2D
|
||||||
|
|
||||||
var empty_material = load("res://res/shaders/empty_material.tscn")
|
|
||||||
var hp
|
var hp
|
||||||
var dead = false
|
|
||||||
var dead_timer = .0
|
|
||||||
var poisoned = false
|
var poisoned = false
|
||||||
var poisoned_timer = .0
|
var poisoned_timer = .0
|
||||||
var speed_multiplier = 1
|
var speed_multiplier = 1
|
||||||
|
@ -18,22 +15,9 @@ var frozen = false
|
||||||
func deal_damage(amount):
|
func deal_damage(amount):
|
||||||
hp -= amount
|
hp -= amount
|
||||||
if hp <= 0:
|
if hp <= 0:
|
||||||
death()
|
call_deferred("free")
|
||||||
|
|
||||||
func death():
|
|
||||||
dead = true
|
|
||||||
$Area2D.call_deferred("free")
|
|
||||||
remove_from_group("enemy")
|
|
||||||
material = empty_material
|
|
||||||
$Sprite.material = empty_material
|
|
||||||
|
|
||||||
func _physics_process(delta):
|
func _physics_process(delta):
|
||||||
if dead:
|
|
||||||
dead_timer += delta
|
|
||||||
$Sprite.modulate.a = 1 - (dead_timer / 2)
|
|
||||||
if dead_timer >= 2.0:
|
|
||||||
self.call_deferred("free")
|
|
||||||
|
|
||||||
if poisoned:
|
if poisoned:
|
||||||
poisoned_timer += delta
|
poisoned_timer += delta
|
||||||
poison_damage_timer += delta
|
poison_damage_timer += delta
|
||||||
|
|
Loading…
Reference in New Issue