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
3f6b9dc8cc
commit
c326c585bd
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 death_counter = 3
|
||||
@@ -11,11 +11,13 @@ var death_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 death_counter == 2:
|
||||
$ColorRect4.hide()
|
||||
if death_counter == 1:
|
||||
@@ -23,12 +25,12 @@ func _physics_process(delta: float) -> void:
|
||||
if death_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:
|
||||
|
||||
+14
-12
@@ -1,22 +1,19 @@
|
||||
[gd_scene format=3 uid="uid://dxx6mxv6x5yws"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://su208qu0ehcs" path="res://scenes/core/enemy.gd" id="1_7p1mj"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://cswcpt0qlk6vt" path="res://assets/sprites/robot.tres" id="2_rtu5a"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_aqe1g"]
|
||||
size = Vector2(168, 167)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_yg5ta"]
|
||||
size = Vector2(178, 168)
|
||||
size = Vector2(72, 187)
|
||||
|
||||
[node name="enemy" type="CharacterBody2D" unique_id=1471932521]
|
||||
collision_layer = 4
|
||||
collision_mask = 11
|
||||
script = ExtResource("1_7p1mj")
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="." unique_id=519837051]
|
||||
offset_right = 169.0
|
||||
offset_bottom = 166.0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1567529793]
|
||||
position = Vector2(85, 82)
|
||||
shape = SubResource("RectangleShape2D_aqe1g")
|
||||
@@ -28,30 +25,35 @@ collision_layer = 4
|
||||
collision_mask = 11
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" unique_id=72940614]
|
||||
position = Vector2(84, 79)
|
||||
position = Vector2(86, 72.5)
|
||||
shape = SubResource("RectangleShape2D_yg5ta")
|
||||
|
||||
[node name="ColorRect2" type="ColorRect" parent="." unique_id=797261471]
|
||||
offset_left = 4.0
|
||||
offset_top = -56.0
|
||||
offset_top = -81.0
|
||||
offset_right = 44.0
|
||||
offset_bottom = -16.0
|
||||
offset_bottom = -41.0
|
||||
color = Color(0, 1, 0, 1)
|
||||
|
||||
[node name="ColorRect3" type="ColorRect" parent="." unique_id=76071947]
|
||||
offset_left = 61.0
|
||||
offset_top = -57.0
|
||||
offset_top = -82.0
|
||||
offset_right = 101.0
|
||||
offset_bottom = -17.0
|
||||
offset_bottom = -42.0
|
||||
color = Color(0, 1, 0, 1)
|
||||
|
||||
[node name="ColorRect4" type="ColorRect" parent="." unique_id=526458105]
|
||||
offset_left = 126.0
|
||||
offset_top = -58.0
|
||||
offset_top = -83.0
|
||||
offset_right = 166.0
|
||||
offset_bottom = -18.0
|
||||
offset_bottom = -43.0
|
||||
color = Color(0, 1, 0, 1)
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=987548519]
|
||||
position = Vector2(79, 75)
|
||||
sprite_frames = ExtResource("2_rtu5a")
|
||||
animation = &"walk"
|
||||
|
||||
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
|
||||
[connection signal="area_entered" from="Area2D" to="." method="_on_area_2d_area_entered"]
|
||||
[connection signal="body_entered" from="Area2D" to="." method="_on_area_2d_body_entered"]
|
||||
Reference in new issue
Block a user