Update docs/project-syntax-example/client.zrl

This commit is contained in:
zongor 2025-07-30 16:58:37 -04:00
parent 933c76dc06
commit e96e58fc8c
1 changed files with 8 additions and 8 deletions

View File

@ -1,15 +1,15 @@
use "common.ztl"; use "common.ztl";
fn main(argc real, argv str[]) { fn main(argc i32, argv str[]) {
let screen_width = 800; ! implied uint32 u32 screen_width = 800;
let screen_height = 450; ! implied uint32 u32 screen_height = 450;
let username = argv[1]; ! implied str str username = argv[1];
let password = argv[2]; ! implied str ste password = argv[2];
let me = Player(username, [0.0, 1.0, 2.0], PURPLE); ! implied Player struct Player me(username, [0.0, 1.0, 2.0], PURPLE);
let running = true; bool running = true;
while (running) { while (running) {
window("zwl client", screen_width, screen_height) { window("zwl client", screen_width, screen_height) {
splitbox(parent.size 0.25) { splitbox(parent.size 0.25) {
@ -25,7 +25,7 @@ fn main(argc real, argv str[]) {
model(Floor([0, 0, 0], 30)); model(Floor([0, 0, 0], 30));
me.update(); me.update();
model(Cube(me.pos, [0.5, 0.5, 0.5], me.appearance)); model(Cube(me.pos, [0.5, 0.5, 0.5], me.appearance));
if (let players = me.server.read("players")) { if (Player[] players = me.server.read("players")) {
for (p in players) { for (p in players) {
model(Cube(p.pos, [0.5, 0.5, 0.5], p.apperance)); model(Cube(p.pos, [0.5, 0.5, 0.5], p.apperance));
} }