program main use raylib use player use json i32 screen_width = 800 i32 screen_height = 450 i32 i, status f32 time bool player_updated, exist str username str password call getarg(1, username) call getarg(2, password) open(u, file=file_input) defer close(u) inquire(unit=u, size=sz) Player me(username=username, pos=(0.0, 1.0, 2.0), apperance=PURPLE) Player(:) players = me.login(password) Camera3D camera = Camera3D(pos = (me.pos.x, me.pos.y + 10.0, me.pos.z + 10.0), !Camera pos target = (me.pos.x, me.pos.y, me.pos.z), !Camera looking at point up = (0.0, 1.0, 0.0), !Camera up vector(rotation towards target) fovy = 45.0, !Camera field - of - view Y projection = CAMERA_PERSPECTIVE) !Camera projection type init_window(screen_width, screen_height, "zwl client : raylib") set_target_fps(60) !Main game loop do while (.not. window_should_close()) ! Detect window close button or ESC key if (is_key_down(KEY_RIGHT)) then me.pos.x += 0.2 player_updated = .true. else if (is_key_down(KEY_LEFT)) then me.pos.x -= 0.2 player_updated = .true. else if (is_key_down(KEY_DOWN)) then me.pos.z += 0.2 player_updated = .true. else if (is_key_down(KEY_UP)) then me.pos.z -= 0.2 player_updated = .true. end if me.sync_camera(camera) time = get_time() if (modulo(time, 1.0) .ge. 0.98) then if (player_updated) then players = me.move() else players = me.ping() end if end if begin_drawing() clear_background(RAYWHITE) begin_mode_3d(camera) ! Draw floor draw_grid(30, 1.0) draw_cube(me.pos, 0.5, 0.5, 0.5, me.apperance) do i = 1, size(players) draw_cube(players(i).pos, 0.5, 0.5, 0.5, players(i).apperance) end do end_mode_3d() end_drawing() end do players = me.logout() close_window() !Close window and OpenGL context end program