Update docs/project-syntax-example/client.zrl
This commit is contained in:
parent
933c76dc06
commit
e96e58fc8c
|
@ -1,15 +1,15 @@
|
|||
use "common.ztl";
|
||||
|
||||
fn main(argc real, argv str[]) {
|
||||
let screen_width = 800; ! implied uint32
|
||||
let screen_height = 450; ! implied uint32
|
||||
fn main(argc i32, argv str[]) {
|
||||
u32 screen_width = 800;
|
||||
u32 screen_height = 450;
|
||||
|
||||
let username = argv[1]; ! implied str
|
||||
let password = argv[2]; ! implied str
|
||||
str username = argv[1];
|
||||
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) {
|
||||
window("zwl client", screen_width, screen_height) {
|
||||
splitbox(parent.size 0.25) {
|
||||
|
@ -25,7 +25,7 @@ fn main(argc real, argv str[]) {
|
|||
model(Floor([0, 0, 0], 30));
|
||||
me.update();
|
||||
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) {
|
||||
model(Cube(p.pos, [0.5, 0.5, 0.5], p.apperance));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue