mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-07-04 13:47:04 -04:00
Skip CAS and go straight to world after mock loading screen
- Renamed lot to world - Technically, the game isn't true 2.5D but rather 3D, so we need a 3D camera
This commit is contained in:
parent
068dcbfae9
commit
aa284c424f
1 changed files with 23 additions and 7 deletions
30
src/main.zig
30
src/main.zig
|
@ -6,7 +6,7 @@ const MAX_INPUT_CHARS = 9;
|
|||
const GameScreen = enum {
|
||||
login,
|
||||
cas,
|
||||
lot,
|
||||
world,
|
||||
};
|
||||
|
||||
// Still in the proof of concept phase, don't midn the mess
|
||||
|
@ -22,6 +22,14 @@ pub fn main() anyerror!void {
|
|||
var current_screen: GameScreen = .login;
|
||||
var frame_counter: i32 = 0;
|
||||
|
||||
var camera = rl.Camera3D{
|
||||
.position = rl.Vector3.init(5.0, 4.0, 5.0),
|
||||
.target = rl.Vector3.init(0, 2.0, 0),
|
||||
.up = rl.Vector3.init(0, 1.0, 0),
|
||||
.fovy = 60,
|
||||
.projection = rl.CameraProjection.camera_perspective,
|
||||
};
|
||||
|
||||
// var textBox = rl.Rectangle.init(screen_width / 2.0 - 100, 180, 50);
|
||||
// var mouseOnText = false;
|
||||
// var letterCount = 0;
|
||||
|
@ -47,11 +55,13 @@ pub fn main() anyerror!void {
|
|||
.login => {
|
||||
frame_counter += 1;
|
||||
|
||||
if (frame_counter > 120) current_screen = .cas;
|
||||
if (frame_counter > 120) current_screen = .world;
|
||||
},
|
||||
//
|
||||
.cas => {},
|
||||
.lot => {},
|
||||
.world => {
|
||||
camera.update(rl.CameraMode.camera_third_person);
|
||||
},
|
||||
}
|
||||
// ------------------
|
||||
|
||||
|
@ -68,11 +78,17 @@ pub fn main() anyerror!void {
|
|||
// Loading text
|
||||
rl.drawText("Reticulating splines...", 20, screen_height - 30, 20, rl.Color.white);
|
||||
},
|
||||
.cas => {
|
||||
rl.clearBackground(rl.Color.black);
|
||||
},
|
||||
.cas => {},
|
||||
//
|
||||
.lot => {},
|
||||
.world => {
|
||||
rl.clearBackground(rl.Color.ray_white);
|
||||
|
||||
camera.begin();
|
||||
defer camera.end();
|
||||
rl.drawGrid(64, 1.0);
|
||||
},
|
||||
}
|
||||
|
||||
rl.drawFPS(10, 10);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue