An open API service indexing awesome lists of open source software.

https://github.com/peterhellberg/fps

A simple FPS in Zig, based on https://github.com/lizard-demon/fps
https://github.com/peterhellberg/fps

example fps zig

Last synced: 23 days ago
JSON representation

A simple FPS in Zig, based on https://github.com/lizard-demon/fps

Awesome Lists containing this project

README

          

# FPS

A simple FPS in [Zig](https://ziglang.org),
based on

> [!Note]
> Requires Zig 0.15.2+

## Screenshot

![Screenshot](/img/fps.png)

## Build

Build a small native binary;

```sh {name=build}
zig build --release=small
```

> [!Tip]
> The `--release` flag for `zig build` takes the following values:
>
> - `fast`
> - `safe`
> - `small`

### Run

Build and run a small native binary;

```sh {name=native}
zig build run --release=small
```

Build and run a small [WebAssembly](https://webassembly.org/) binary in your browser;

```sh {name=web}
zig build run --release=small -Dtarget=wasm32-emscripten
```

### Test

You can run all the test cases like this;

```sh {name=test}
zig build test
```

## Input

Key | Action
--------------|------------------
**W,A,S,D** | Move
**Mouse** | Look around
**Space** | Jump (with audio)
**Click** | Capture mouse
**Escape** | Release mouse
**Q** | Quit
**P** | Print player state