forked from 32blit/32blit-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
game.cpp
44 lines (38 loc) · 1.17 KB
/
game.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "game.hpp"
using namespace blit;
///////////////////////////////////////////////////////////////////////////
//
// init()
//
// setup your game here
//
void init() {
set_screen_mode(ScreenMode::hires);
}
///////////////////////////////////////////////////////////////////////////
//
// render(time)
//
// This function is called to perform rendering of the game. time is the
// amount if milliseconds elapsed since the start of your game
//
void render(uint32_t time) {
// clear the screen -- screen is a reference to the frame buffer and can be used to draw all things with the 32blit
screen.clear();
// draw some text at the top of the screen
screen.alpha = 255;
screen.mask = nullptr;
screen.pen = Pen(255, 255, 255);
screen.rectangle(Rect(0, 0, 320, 14));
screen.pen = Pen(0, 0, 0);
screen.text("Hello 32blit!", minimal_font, Point(5, 4));
}
///////////////////////////////////////////////////////////////////////////
//
// update(time)
//
// This is called to update your game state. time is the
// amount if milliseconds elapsed since the start of your game
//
void update(uint32_t time) {
}