forked from team-sg/hero-mark-2
more easy mode stuff
This commit is contained in:
parent
82f2ebfc12
commit
fd444d505c
6 changed files with 48 additions and 44 deletions
|
@ -13,6 +13,8 @@ onready var remote_transform: RemoteTransform2D = $Pivot/RemoteTransform
|
|||
|
||||
func _ready() -> void:
|
||||
pivot.rotation = initial_angle * 0.785398 # TAU / 8.0
|
||||
#Easy mode
|
||||
if Game.is_easy_mode: speed *= Game.easy_mode_speed_factor
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if Engine.editor_hint:
|
|
@ -1,7 +1,7 @@
|
|||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://graphics/enemy/tin_eye.png" type="Texture" id=1]
|
||||
[ext_resource path="res://objects/enemy/ghost_scholar.gd" type="Script" id=2]
|
||||
[ext_resource path="res://objects/enemy/artificial_soul.gd" type="Script" id=2]
|
||||
[ext_resource path="res://graphics/enemy/artificial_soul.png" type="Texture" id=3]
|
||||
|
||||
[sub_resource type="Animation" id=2]
|
||||
|
@ -36,7 +36,7 @@ tracks/1/keys = {
|
|||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 3, 3.5 )
|
||||
|
||||
[node name="Ghost" type="Node2D"]
|
||||
[node name="ArtificialSoul" type="Node2D"]
|
||||
script = ExtResource( 2 )
|
||||
radius = 4.0
|
||||
speed = 2.0
|
||||
|
@ -50,7 +50,7 @@ rotation = 6.28319
|
|||
texture = ExtResource( 3 )
|
||||
|
||||
[node name="Eye" type="Sprite" parent="Hitbox/Sprite"]
|
||||
modulate = Color( 0.580934, 0.97985, 0.561144, 1 )
|
||||
modulate = Color( 0.560784, 1, 0.560784, 1 )
|
||||
position = Vector2( 1, 0 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue