Added logic for robot stalking light changing (not tweening correctly)

This commit is contained in:
Henry 2026-05-11 15:47:59 +01:00
parent 6482d52a04
commit cf7fa78fbb
6 changed files with 57 additions and 19 deletions

View file

@ -8,7 +8,7 @@ custom_features=""
export_filter="all_resources" export_filter="all_resources"
include_filter="" include_filter=""
exclude_filter="" exclude_filter=""
export_path="" export_path="../../Downloads/2026-05-10 232330 AI - Jam Build/index.html"
patches=PackedStringArray() patches=PackedStringArray()
patch_delta_encoding=false patch_delta_encoding=false
patch_delta_compression_level_zstd=19 patch_delta_compression_level_zstd=19

View file

@ -9,6 +9,8 @@ var stun_remaining: float = 0.0
var _delay_remaining: float = 0.0 var _delay_remaining: float = 0.0
var _spawn_transform: Transform3D var _spawn_transform: Transform3D
var stalking: bool = true
@onready var safety_zone = get_node("/root/Game/World/ElevatorSafeZone") @onready var safety_zone = get_node("/root/Game/World/ElevatorSafeZone")
@ -30,6 +32,9 @@ func _on_floor_started(delay: float, new_speed: float) -> void:
robot_ready = false robot_ready = false
func _physics_process(delta): func _physics_process(delta):
stalking_check()
if robot_win: if robot_win:
return return
@ -55,3 +60,24 @@ func _on_area_3d_area_entered(area: Area3D) -> void:
if area == safety and doors_open: if area == safety and doors_open:
robot_win = true robot_win = true
EventBus.game_lost.emit("ROBOT GOT IN") EventBus.game_lost.emit("ROBOT GOT IN")
func stalking_check():
var robot_position = self.global_transform.origin
var elevator = safety_zone.global_transform.origin
var distance = robot_position.distance_to(elevator)
var current_modulation = $Sprite3D.modulate
print(distance)
if distance >= 19:
$Sprite3D.modulate = Color(0.0, 0.0, 0.0)
if distance <= 15: #and stalking == true:
stalking == false
illuminate()
func illuminate():
var tween = create_tween()
tween.tween_property($Sprite3D, "modulate",Color(255,255,255), 5)

View file

@ -1,7 +1,7 @@
[gd_scene format=3 uid="uid://v07x1vbept3i"] [gd_scene format=3 uid="uid://v07x1vbept3i"]
[ext_resource type="Texture2D" uid="uid://ba2ywy388r8g1" path="res://images/bot.png" id="1_br0rw"] [ext_resource type="Texture2D" uid="uid://ba2ywy388r8g1" path="res://images/bot.png" id="1_br0rw"]
[ext_resource type="Script" path="res://scenes/robot.gd" id="1_ykvnc"] [ext_resource type="Script" uid="uid://c0ii52yy7qbcu" path="res://scenes/robot.gd" id="1_ykvnc"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_ykvnc"] [sub_resource type="CylinderShape3D" id="CylinderShape3D_ykvnc"]
height = 1.8903809 height = 1.8903809

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=3 format=3] [gd_scene format=3 uid="uid://sgakdvtoblmd"]
[ext_resource type="Script" path="res://scenes/title_screen.gd" id="1"] [ext_resource type="Script" uid="uid://ba3of2ykdjqcl" path="res://scenes/title_screen.gd" id="1"]
[sub_resource type="StyleBoxFlat" id="CardStyle"] [sub_resource type="StyleBoxFlat" id="CardStyle"]
bg_color = Color(0.05, 0.18, 0.05, 1) bg_color = Color(0.05, 0.18, 0.05, 1)
@ -14,43 +14,49 @@ corner_radius_top_right = 6
corner_radius_bottom_right = 6 corner_radius_bottom_right = 6
corner_radius_bottom_left = 6 corner_radius_bottom_left = 6
[node name="TitleScreen" type="CanvasLayer"] [node name="TitleScreen" type="CanvasLayer" unique_id=1795090261]
layer = 20
process_mode = 3 process_mode = 3
layer = 20
script = ExtResource("1") script = ExtResource("1")
[node name="Dim" type="ColorRect" parent="."] [node name="Dim" type="ColorRect" parent="." unique_id=10804812]
anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
mouse_filter = 2 mouse_filter = 2
color = Color(0, 0, 0, 0.85) color = Color(0, 0, 0, 0.85)
[node name="Center" type="CenterContainer" parent="."] [node name="Center" type="CenterContainer" parent="." unique_id=9544562]
anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
mouse_filter = 1
[node name="Card" type="PanelContainer" parent="Center"] [node name="Card" type="PanelContainer" parent="Center" unique_id=1305454967]
layout_mode = 2
theme_override_styles/panel = SubResource("CardStyle") theme_override_styles/panel = SubResource("CardStyle")
[node name="Margin" type="MarginContainer" parent="Center/Card"] [node name="Margin" type="MarginContainer" parent="Center/Card" unique_id=1871871714]
layout_mode = 2
theme_override_constants/margin_left = 64 theme_override_constants/margin_left = 64
theme_override_constants/margin_right = 64
theme_override_constants/margin_top = 48 theme_override_constants/margin_top = 48
theme_override_constants/margin_right = 64
theme_override_constants/margin_bottom = 48 theme_override_constants/margin_bottom = 48
[node name="Column" type="VBoxContainer" parent="Center/Card/Margin"] [node name="Column" type="VBoxContainer" parent="Center/Card/Margin" unique_id=1760144871]
layout_mode = 2
theme_override_constants/separation = 24 theme_override_constants/separation = 24
[node name="Title" type="Label" parent="Center/Card/Margin/Column"] [node name="Title" type="Label" parent="Center/Card/Margin/Column" unique_id=358683873]
layout_mode = 2
theme_override_colors/font_color = Color(0.2, 1, 0.2, 1)
theme_override_font_sizes/font_size = 48
text = "AGENTIC INCIDENT text = "AGENTIC INCIDENT
(A.I.)" (A.I.)"
horizontal_alignment = 1 horizontal_alignment = 1
theme_override_colors/font_color = Color(0.2, 1, 0.2, 1)
theme_override_font_sizes/font_size = 48
[node name="Prompt" type="Label" parent="Center/Card/Margin/Column"] [node name="Prompt" type="Label" parent="Center/Card/Margin/Column" unique_id=366312976]
text = "PRESS SPACE TO START" layout_mode = 2
horizontal_alignment = 1
theme_override_colors/font_color = Color(0.5, 1, 0.5, 1) theme_override_colors/font_color = Color(0.5, 1, 0.5, 1)
theme_override_font_sizes/font_size = 28 theme_override_font_sizes/font_size = 28
text = "PRESS SPACE TO START"
horizontal_alignment = 1

View file

@ -0,0 +1,5 @@
extends RayCast3D
#
#func _physics_process(delta: float) -> void:
#if is_colliding():
#

View file

@ -0,0 +1 @@
uid://mx21sweu0r3b