52 lines
1.2 KiB
Plaintext
52 lines
1.2 KiB
Plaintext
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
|
|
import "luxe: asset" for Asset
|
|
import "luxe: math" for Math
|
|
import "luxe: io" for IO
|
|
|
|
import "luxe: system/physics/box_collider3D.modifier" for BoxCollider3D
|
|
import "camera: editor" for EditorCamera
|
|
import "outline/ready" for Ready
|
|
|
|
class Game is Ready {
|
|
|
|
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)
|
|
|
|
set_use_debug_camera(true)
|
|
|
|
_debug_cam = EditorCamera.new(world, camera, "any")
|
|
_debug_cam.speed = 1
|
|
|
|
// Scene.create(world, Asset.scene("scene/arena01"))
|
|
|
|
} //ready
|
|
|
|
tick(delta: Num) {
|
|
|
|
if(Input.key_state_released(Key.escape)) {
|
|
IO.shutdown()
|
|
}
|
|
|
|
if (_using_debug_cam) {
|
|
_debug_cam.tick(delta)
|
|
}
|
|
|
|
} //tick
|
|
|
|
set_use_debug_camera(use_debug: Bool) {
|
|
_using_debug_cam = use_debug
|
|
Input.set_mouse_capture(!use_debug)
|
|
Input.set_mouse_visible(use_debug)
|
|
}
|
|
|
|
} //Game
|