diff options
| -rw-r--r-- | src/main.zig | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/main.zig b/src/main.zig index 2f3c189..5754793 100644 --- a/src/main.zig +++ b/src/main.zig @@ -67,7 +67,7 @@ pub fn main() !void { var window = try sf.RenderWindow.create(.{ .x = constants.ScreenWidth, .y = constants.ScreenHeight }, 32, "zirc", sf.window.Style.none); defer window.destroy(); - window.setFramerateLimit(60); + window.setFramerateLimit(40); // Load the background skybox, really `skycylinder', and assign it to a // sprite -- it's set to repeating so that it goes on forever. We need to @@ -116,13 +116,12 @@ pub fn main() !void { } if (isKeyPressed(.Escape)) window.close(); - if (isKeyPressed(.C)) player.height -= 0.1; if (isKeyPressed(.V)) player.height += 0.1; - const rotation = 2.0 * PI / 100.0; - if (isKeyPressed(.R)) player.ang += rotation; - if (isKeyPressed(.T)) player.ang -= rotation; + const rotation = 2.0 * PI / 200.0; + if (isKeyPressed(.Left)) player.ang += rotation; + if (isKeyPressed(.Right)) player.ang -= rotation; const cos = std.math.cos(player.ang); const sin = std.math.sin(player.ang); @@ -130,14 +129,14 @@ pub fn main() !void { player.acc_x = 0; player.acc_y = 0; const acc_mag = 30; - if (isKeyPressed(.Right)) { - player.acc_x += sin; - player.acc_y -= cos; - } - if (isKeyPressed(.Left)) { + if (isKeyPressed(.R)) { player.acc_x -= sin; player.acc_y += cos; } + if (isKeyPressed(.T)) { + player.acc_x += sin; + player.acc_y -= cos; + } if (isKeyPressed(.Up) or isKeyPressed(.F)) { player.acc_x += cos; player.acc_y += sin; |
