pebble-pge-simple
Version:
Simple looping game engine for Pebble. Simple version without extra modules.
54 lines (35 loc) • 1.14 kB
Markdown
Simple looping game engine for Pebble. Available on
[](https://www.npmjs.com/package/pebble-pge-simple).
This is the simple version without all the other extra stuff the main module has.
`pebble package install pebble-pge-simple`
- Automatic looping of developer-supplied per-frame logic and rendering.
- Up to 30 frames per second.
- Implement only your game code - `AppTimer`, `LayerUpdateProc`, `Clicks`,
`Window` and `main` abstracted away.
To begin a new game watchapp, begin with the template file in `/docs/template.c.sample`:
> This is the bare minimum to make a looping game with PGE!
```
static void frame_logic() {
// Per-frame game logic here
}
static void frame_draw(GContext *ctx) {
// Per-frame game rendering here
}
static void button_click(int button_id, bool long_click) {
// Process click events
}
void pge_init() {
// Start the game
pge_begin(frame_logic, frame_draw, button_click);
}
void pge_deinit() {
// Finish the game
pge_finish();
}
```