fix scale on hit the wall
This commit is contained in:
+3
-8
@@ -50,6 +50,7 @@ func setup(type: String, wave: int) -> void:
|
||||
health = 28 + wave * 4
|
||||
score_value = 10
|
||||
damage_to_player = 8
|
||||
enemy_level = 1
|
||||
"bat":
|
||||
move_speed = 5.5 + wave * 0.15
|
||||
health = 14 + wave * 2
|
||||
@@ -59,6 +60,7 @@ func setup(type: String, wave: int) -> void:
|
||||
mesh_node.scale = Vector3(0.7, 0.7, 0.7)
|
||||
COLOR_CHASE = Color(0.6, 0.2, 0.8)
|
||||
mat.albedo_color = COLOR_CHASE
|
||||
enemy_level = 2
|
||||
"ogre":
|
||||
move_speed = 1.8 + wave * 0.08
|
||||
health = 80 + wave * 12
|
||||
@@ -68,6 +70,7 @@ func setup(type: String, wave: int) -> void:
|
||||
mesh_node.scale = Vector3(1.5, 1.5, 1.5)
|
||||
COLOR_CHASE = Color(0.3, 0.7, 0.3)
|
||||
mat.albedo_color = COLOR_CHASE
|
||||
enemy_level = 3
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
match state:
|
||||
@@ -97,7 +100,6 @@ func _chase(delta: float) -> void:
|
||||
|
||||
func _fly(delta: float) -> void:
|
||||
var speed_now := Vector2(fly_vel.x, fly_vel.z).length()
|
||||
print_debug("speed is ", speed_now)
|
||||
velocity = fly_vel
|
||||
velocity.y = 0.0
|
||||
move_and_slide()
|
||||
@@ -150,9 +152,6 @@ func receive_kick(direction: Vector3, force: float) -> void:
|
||||
fly_vel.y = 0.0
|
||||
state = State.FLYING
|
||||
mat.albedo_color = COLOR_FLY
|
||||
var tw := create_tween()
|
||||
tw.tween_property(mesh_node, "scale:y", base_scale * 0.35, 0.06)
|
||||
tw.tween_property(mesh_node, "scale:y", base_scale, 0.18)
|
||||
|
||||
func _start_merge(other: Node) -> void:
|
||||
is_upgrading = true
|
||||
@@ -195,10 +194,6 @@ func _enter_stun() -> void:
|
||||
state = State.STUNNED
|
||||
stun_timer = stun_time
|
||||
mat.albedo_color = COLOR_STUN
|
||||
var bs := base_scale
|
||||
var tw := create_tween()
|
||||
tw.tween_property(mesh_node, "scale", Vector3(bs * 1.6, bs * 0.25, bs * 1.6), 0.07)
|
||||
tw.tween_property(mesh_node, "scale", Vector3(bs, bs, bs), 0.22)
|
||||
|
||||
func _enter_chase() -> void:
|
||||
state = State.CHASING
|
||||
|
||||
@@ -268,6 +268,9 @@ func _spawn_upgraded_enemy(pos: Vector3, type: String, level: int, w: int) -> Ch
|
||||
(col_shape.shape as BoxShape3D).size = old_size * s
|
||||
var color := Color(1.0, 1.0, 0.5) if level > 2 else Color(1.0, 0.9, 0.3)
|
||||
tw.tween_property(enemy.mat, "albedo_color", color, 0.25)
|
||||
#var bs := scale
|
||||
#tw.tween_property(enemy.mesh_node, "scale", Vector3(bs * 1.6, bs * 0.25, bs * 1.6), 0.07)
|
||||
#tw.tween_property(enemy.mesh_node, "scale", Vector3(bs, bs, bs), 0.22)
|
||||
return enemy
|
||||
|
||||
func _on_enemy_merged(_upgrade: bool) -> void:
|
||||
|
||||
Reference in New Issue
Block a user