forked from team-sg/hero-mark-2
made some changes :3
This commit is contained in:
parent
a0b48c76d1
commit
82f2ebfc12
10 changed files with 157 additions and 65 deletions
|
@ -24,6 +24,7 @@ var shooting = false
|
|||
var turns = 0
|
||||
|
||||
const BoneParticle = preload("res://objects/enemy/bone_particle.tscn")
|
||||
const EasyBullet = preload("res://objects/environment/turret/turret_bullet.tscn")
|
||||
|
||||
func _ready():
|
||||
if Engine.editor_hint:
|
||||
|
@ -38,6 +39,11 @@ func _ready():
|
|||
sprite.speed_scale = inverse_lerp(0.0, 25.0, walk_speed)
|
||||
|
||||
func _physics_process(delta):
|
||||
var easy_bullet = EasyBullet.instance()
|
||||
easy_bullet.direction = Vector2.RIGHT
|
||||
easy_bullet.global_position = global_position
|
||||
get_parent().call_deferred("add_child", easy_bullet)
|
||||
Game.instance_node(EasyBullet,global_position.x,global_position.y,self)
|
||||
if Engine.editor_hint:
|
||||
return
|
||||
if !shooting:
|
||||
|
@ -45,8 +51,12 @@ func _physics_process(delta):
|
|||
var collider = shoot_cast.get_collider()
|
||||
if collider != null && (collider.is_in_group("player") or collider.is_in_group("msx")):
|
||||
if Game.get_sector(global_position) == Game.get_sector(collider.global_position):
|
||||
# kill player and enter shooting state temporarily
|
||||
collider.get_parent().die()
|
||||
if Game.is_easy_mode:
|
||||
#Console.print("test")
|
||||
Game.instance_node(EasyBullet,global_position.x,global_position.y,self)
|
||||
else:
|
||||
# kill player and enter shooting state temporarily
|
||||
collider.get_parent().die()
|
||||
# play sound
|
||||
Audio.play_sound(Audio.a_die_robot, Audio.ac_boss)
|
||||
# muzzle flash
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue