more easy mode stuff

This commit is contained in:
pennyrigate 2023-04-28 18:27:34 -04:00
parent 82f2ebfc12
commit fd444d505c
6 changed files with 48 additions and 44 deletions

View file

@ -24,7 +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")
const EasyBullet = preload("res://objects/enemy/roboturret_proj.tscn")
func _ready():
if Engine.editor_hint:
@ -39,11 +39,6 @@ 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:
@ -52,8 +47,12 @@ func _physics_process(delta):
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):
if Game.is_easy_mode:
#Console.print("test")
Game.instance_node(EasyBullet,global_position.x,global_position.y,self)
var easy_bullet = EasyBullet.instance()
easy_bullet.target_group = "player"
easy_bullet.direction = sign(shoot_position.global_position.x - global_position.x)
easy_bullet.global_position = shoot_position.global_position
easy_bullet.speed = 100
get_parent().call_deferred("add_child", easy_bullet)
else:
# kill player and enter shooting state temporarily
collider.get_parent().die()
@ -62,7 +61,7 @@ func _physics_process(delta):
# muzzle flash
muzzle_flash.emitting = true
shooting = true
get_tree().create_timer(0.05, false).connect("timeout", self, "_stop_shoot")
get_tree().create_timer(0.5, false).connect("timeout", self, "_stop_shoot")
sprite.play("shoot")
# check other raycast to find collision passing through player
graphics_cast.force_raycast_update()