examples: Use decl literals (#221)
This commit is contained in:
parent
03ec79ef85
commit
d4fc514d54
37 changed files with 323 additions and 323 deletions
|
|
@ -35,15 +35,15 @@ pub fn main() anyerror!void {
|
|||
rl.beginDrawing();
|
||||
defer rl.endDrawing();
|
||||
|
||||
rl.clearBackground(rl.Color.white);
|
||||
rl.clearBackground(.white);
|
||||
|
||||
rl.drawText(rl.textFormat("Score: %08i", .{score}), 200, 80, 20, rl.Color.red);
|
||||
rl.drawText(rl.textFormat("Score: %08i", .{score}), 200, 80, 20, .red);
|
||||
|
||||
rl.drawText(rl.textFormat("HiScore: %08i", .{hiscore}), 200, 120, 20, rl.Color.green);
|
||||
rl.drawText(rl.textFormat("HiScore: %08i", .{hiscore}), 200, 120, 20, .green);
|
||||
|
||||
rl.drawText(rl.textFormat("Lives: %02i", .{lives}), 200, 160, 40, rl.Color.blue);
|
||||
rl.drawText(rl.textFormat("Lives: %02i", .{lives}), 200, 160, 40, .blue);
|
||||
|
||||
rl.drawText(rl.textFormat("Elapsed Time: %02.02f ms", .{rl.getFrameTime() * 1000}), 200, 220, 20, rl.Color.black);
|
||||
rl.drawText(rl.textFormat("Elapsed Time: %02.02f ms", .{rl.getFrameTime() * 1000}), 200, 220, 20, .black);
|
||||
//----------------------------------------------------------------------------------
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@ pub fn main() void {
|
|||
{
|
||||
// Update
|
||||
//----------------------------------------------------------------------------------
|
||||
framesCounter += if (rl.isKeyDown(rl.KeyboardKey.space)) 8 else 1;
|
||||
framesCounter += if (rl.isKeyDown(.space)) 8 else 1;
|
||||
|
||||
if (rl.isKeyPressed(rl.KeyboardKey.enter)) framesCounter = 0;
|
||||
if (rl.isKeyPressed(.enter)) framesCounter = 0;
|
||||
//----------------------------------------------------------------------------------
|
||||
// Draw
|
||||
//----------------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue