Prepping for map stuff
This commit is contained in:
@@ -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
8
scripts/Map/Map.gd
Normal 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
1
scripts/Map/Map.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c37crdel0m5mw
|
@@ -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;
|
@@ -1 +0,0 @@
|
||||
uid://dbah1pmk8jola
|
Reference in New Issue
Block a user