add player point light settings to room config

This commit is contained in:
yuki 2025-11-24 18:52:20 -03:00
parent 0bed3833f8
commit 4dd9b31c27
2 changed files with 10 additions and 0 deletions

View file

@ -4,6 +4,10 @@ class_name RoomConfig extends Resource
## The initial player spawn point. ## The initial player spawn point.
## Only used if one wasn't provided to the room beforehand. ## Only used if one wasn't provided to the room beforehand.
@export var initial_spawn: Vector2i = Vector2i.ZERO @export var initial_spawn: Vector2i = Vector2i.ZERO
## Enables player's point light.
@export var enable_point_light: bool = false
## Intensity of player's point light.
@export_range(0,16,0.4) var point_light_energy: float = 0
@export_group('Camera') @export_group('Camera')
## Whether the camera will (initially) follow the player ot not. ## Whether the camera will (initially) follow the player ot not.
@ -11,6 +15,10 @@ class_name RoomConfig extends Resource
## Initial position of the camera. ## Initial position of the camera.
@export var camera_position: Vector2i = Vector2i.ZERO @export var camera_position: Vector2i = Vector2i.ZERO
@export_group('Lighting')
@export var enable_canvas_modulate: bool = false
@export var modulate_color: Color
@export_group('Room Loop') @export_group('Room Loop')
## Whether the room loops itself or not. ## Whether the room loops itself or not.
@export var loopable: bool = false @export var loopable: bool = false

View file

@ -22,5 +22,7 @@ func _instantiate_player() -> Player:
"invalid player initial spawn provided" "invalid player initial spawn provided"
) )
p.global_position = room.config.initial_spawn p.global_position = room.config.initial_spawn
if room.config.enable_point_light:
p.enable_point_light(true, room.config.point_light_energy)
return p return p