Stable scene loading and func_luxe updates

This commit is contained in:
2025-06-18 17:54:55 -07:00
parent 52ebf82e0a
commit 75502fe544
69 changed files with 389 additions and 330 deletions

View File

@ -1,4 +1,5 @@
import "luxe: world" for World, Entity, Transform, Sprite, Values, Tags, Camera, Scene, Body3D
import "luxe: world" for World, Entity, Transform, Sprite, Values, Tags, Camera
import "luxe: world/scene" for Scene
import "luxe: draw" for Draw, PathStyle
import "luxe: input" for Input, Key
import "luxe: assets" for Assets
@ -12,12 +13,11 @@ import "outline/ready" for Ready
class Game is Ready {
var opened_level: Bool = false
construct ready() {
super("ready! %(width) x %(height) @ %(scale)x")
Camera.set3D(camera, 85, width/height, 0.01, 500)
Transform.set_pos(camera, 0, 1, 4)
Transform.set_euler_x(camera, -0.25)
@ -26,17 +26,8 @@ class Game is Ready {
_debug_cam = EditorCamera.new(world, camera, "any")
_debug_cam.speed = 1
// Bandage fix for a bug where Jolt with crash the
// game if you load a scene with a collider when
// the world has zero mass. So here, I explicitly
// make a collider to give the world mass.
var mass_fix = Entity.create(world)
Log.print("Created mass_fix: %(Entity.get_uuid(mass_fix))")
Scene.create(world, Asset.scene("scene/arena01"))
// Entity.destroy(mass_fix)
// Scene.create(world, Asset.scene("scene/arena01"))
} //ready
tick(delta: Num) {
@ -45,11 +36,6 @@ class Game is Ready {
IO.shutdown()
}
if (Input.key_state_released(Key.key_o) && !opened_level) {
Scene.create(world, Asset.scene("scene/map_load"))
opened_level = true
}
if (_using_debug_cam) {
_debug_cam.tick(delta)
}