Updated project to luxe 2025.11.1
This commit is contained in:
28
game.wren
28
game.wren
@ -7,7 +7,6 @@ import "luxe: assets" for Assets
|
||||
import "luxe: asset" for Asset
|
||||
import "luxe: math" for Math
|
||||
import "luxe: io" for IO
|
||||
import "debug: debug"
|
||||
|
||||
import "luxe: system/physics/box_collider3D.modifier" for BoxCollider3D
|
||||
import "luxe: system/physics/character3D.modifier" for Character3D
|
||||
@ -21,33 +20,30 @@ class Game is Ready {
|
||||
|
||||
super("ready! %(width) x %(height) @ %(scale)x")
|
||||
|
||||
// set_use_debug_camera(true)
|
||||
|
||||
// _debug_cam = EditorCamera.new(world, camera, "any")
|
||||
// _debug_cam.speed = 1
|
||||
|
||||
// Load both the Arena scene and the Player scene
|
||||
Scene.create(world, Asset.scene("scene/arena01"))
|
||||
Scene.create(world, Asset.scene("scene/player"))
|
||||
|
||||
// Get a reference to the Player entity
|
||||
_player = Entity.get_named(world, "Player")
|
||||
|
||||
// And create the first-person camera
|
||||
_fpscam = FirstPersonCamera.new(world, camera, "game")
|
||||
|
||||
var wpn: Entity = Prototype.create(world, Asset.prototype("prototype/wpn_waterpistol"))
|
||||
var socket = Entity.create(world)
|
||||
Transform.create(socket)
|
||||
Transform.link(socket, camera, TransformLinkAction.reset_local)
|
||||
Transform.set_pos(socket, 0.05, -0.2, -0.15)
|
||||
|
||||
Transform.link(wpn, socket, TransformLinkAction.reset_local)
|
||||
|
||||
// Put player above the floor
|
||||
Transform.set_pos_y(_player, 0.75)
|
||||
|
||||
// And link the camera to the Player entity
|
||||
// (linking is how you "parent" one Transform to another in luxe)
|
||||
Camera.set3D(camera, 85, width/height, 0.01, 500)
|
||||
Transform.link(camera, _player, TransformLinkAction.reset_local)
|
||||
Transform.set_pos_y(camera, 1.7)
|
||||
|
||||
// The mouse now belongs to me
|
||||
Input.set_mouse_capture(true)
|
||||
Input.set_mouse_visible(false)
|
||||
|
||||
// Pressing ~ will toggle the mouse cursor active/inactive
|
||||
Input.listen_for(InputType.key_down) {|key, scan, repeat, mod|
|
||||
if(scan == Scan.grave) {
|
||||
_fpscam.enabled = !_fpscam.enabled
|
||||
@ -63,7 +59,9 @@ class Game is Ready {
|
||||
IO.shutdown()
|
||||
}
|
||||
|
||||
// _debug_cam.tick(delta)
|
||||
// What? Where's the frickin' game code?
|
||||
// Look in the system directory.
|
||||
// The player is handled in player_input
|
||||
|
||||
} //tick
|
||||
|
||||
|
||||
Reference in New Issue
Block a user