Updating Robot Enemy
Add robot model and animations for enemy-update branch - Import robot.blend 3D model with punch and walking animations - Add 61 punch animation frames (frame_0001 through frame_0061) - Add 32 walking animation frames (frame_0001 through frame_0032) - Create robot.tres sprite resource - Update enemy.gd and enemy.tscn for robot integration - Refine PhonePhreak.blend model
This commit is contained in:
1 parent
2e9a427b57
commit
2a8d52f0b6
191 files changed
+4411
-18
No files matched your search
@@ -1,7 +1,7 @@
|
||||
extends CharacterBody2D
|
||||
|
||||
|
||||
var SPEED = Vector2(5, 0)
|
||||
var SPEED = Vector2(150, 0)
|
||||
const JUMP_VELOCITY = -400.0
|
||||
@onready var projectile: PackedScene = preload("res://scenes/core/projectile.tscn")
|
||||
var health_counter = 3
|
||||
@@ -11,11 +11,13 @@ var health_counter = 3
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
|
||||
$AnimatedSprite2D.play()
|
||||
$Timer.start()
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if abs(velocity.x) > 0.1:
|
||||
$AnimatedSprite2D.flip_h = velocity.x < 0
|
||||
if health_counter == 2:
|
||||
$ColorRect4.hide()
|
||||
if health_counter == 1:
|
||||
@@ -23,12 +25,12 @@ func _physics_process(delta: float) -> void:
|
||||
if health_counter == 0:
|
||||
queue_free()
|
||||
velocity += get_gravity() * delta
|
||||
move_and_slide()
|
||||
patrol()
|
||||
move_and_slide()
|
||||
|
||||
|
||||
func patrol():
|
||||
position += SPEED
|
||||
velocity.x = SPEED.x
|
||||
|
||||
|
||||
func _on_timer_timeout() -> void:
|
||||
|
||||
Reference in new issue
Block a user