Rework controls for 1000 and 10000 entity spawns

This commit is contained in:
Jared Miller 2025-12-15 11:15:10 -05:00
parent 4bee083cc4
commit 6b8d1e1929
2 changed files with 4 additions and 6 deletions

View file

@ -227,8 +227,7 @@ pub fn main() !void {
fn handleInput(entities: *sandbox.Entities, rng: *std.Random, paused: *bool) void {
const shift = rl.isKeyDown(.left_shift) or rl.isKeyDown(.right_shift);
const ctrl = rl.isKeyDown(.left_control) or rl.isKeyDown(.right_control);
const add_count: usize = if (ctrl and shift) 10000 else if (shift) 1000 else 100;
const add_count: usize = if (shift) 10000 else 1000;
// add entities: = or +
if (rl.isKeyPressed(.equal) or rl.isKeyPressed(.kp_add)) {

View file

@ -67,16 +67,15 @@ pub fn drawMetrics(entities: *const sandbox.Entities, update_us: i64, render_us:
}
fn drawControls(font: rl.Font, metrics_height: i32) void {
const ctrl_box_height: i32 = @intFromFloat(small_line_height * 5 + box_padding * 2);
const ctrl_box_height: i32 = @intFromFloat(small_line_height * 4 + box_padding * 2);
const ctrl_box_y: i32 = 5 + metrics_height + 5;
rl.drawRectangle(5, ctrl_box_y, 175, ctrl_box_height, box_bg);
var y: f32 = @as(f32, @floatFromInt(ctrl_box_y)) + box_padding;
const controls = [_][]const u8{
"+/-: add/remove 100",
"shift +/-: 1000",
"ctrl+shift +/-: 10000",
"+/-: 1000 entities",
"shift +/-: 10000",
"space: pause",
"r: reset",
};