Prepping for map stuff

This commit is contained in:
2025-05-08 09:24:22 -05:00
parent cf149e676c
commit f079f43664
7 changed files with 15 additions and 43 deletions

View File

@@ -21,9 +21,6 @@ var meshInstance:MeshInstance3D;
var underFootTile:int = -1;
var underFootPosition:Vector3;
var withinMapBounds:MapBounds;
var withinBoundsLastFrame:bool = true;
func _updateMaterial():
if !meshInstance:
return
@@ -140,14 +137,6 @@ func _ready() -> void:
func _process(delta:float) -> void:
if isPaused():
return;
# Handle entity leaving map bounds
if !withinMapBounds:
# if !withinBoundsLastFrame:
# print("Entity ", self.name, " was out of map bounds for two frames");
withinBoundsLastFrame = false;
else:
withinBoundsLastFrame = true;
# Update logic
updateOverworldLogic(delta)

8
scripts/Map/Map.gd Normal file
View File

@@ -0,0 +1,8 @@
class_name Map extends Node
@export var mapName:String = "Map"
@export var mapEnterEvent:Event = null
func _ready() -> void:
if mapEnterEvent:
mapEnterEvent.start()

1
scripts/Map/Map.gd.uid Normal file
View File

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

View File

@@ -1,15 +0,0 @@
extends Area3D
class_name MapBounds
func _ready() -> void:
pass
func _on_body_entered(body: Node3D) -> void:
if (!body is OverworldEntity):
return
(body as OverworldEntity).withinMapBounds = self;
func _on_body_exited(body: Node3D) -> void:
if (!body is OverworldEntity):
return
(body as OverworldEntity).withinMapBounds = null;

View File

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