- Introduced a new JobComponent and JobQueue to manage jobs in the game. - Created two new jobs: DigJob and InfectJob with their respective scripts. - Updated CrystalGlowComponent, FreeCameraComponent, MushroomGlowComponent, WaterEffectComponent to improve logging messages. - Adjusted camera movement limits in FreeCameraGameCameraComponent for better control. - Added FiniteStateMachine class for managing states of entities. - Implemented GlowingIdle state as an example of using the state machine. - Included a utility function to fetch file paths by extension from a directory.
23 lines
701 B
GDScript
23 lines
701 B
GDScript
extends Node2D
|
|
class_name FreeCameraComponent
|
|
|
|
@onready var camera : GameCamera = $GameCamera
|
|
@export var tile_map : TileMap = null
|
|
|
|
func _ready() -> void:
|
|
|
|
if !tile_map:
|
|
Log.err("FreeCameraComponent: tile_map is not set")
|
|
|
|
# Stop the camera scrolling out of bounds of the map
|
|
var tile_size : Vector2i = tile_map.get_tileset().tile_size
|
|
var tilemap_size : Vector2i = tile_map.get_used_rect().end - tile_map.get_used_rect().position
|
|
var map_size_x : int = tile_size.x * tilemap_size.x
|
|
var map_size_y : int = tile_size.y * tilemap_size.y
|
|
|
|
camera.set_limit(SIDE_LEFT, 0)
|
|
camera.set_limit(SIDE_TOP, 0)
|
|
camera.set_limit(SIDE_RIGHT, map_size_x)
|
|
camera.set_limit(SIDE_BOTTOM, map_size_y)
|
|
|
|
pass
|