Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy up the code in game.cpp #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 8 additions & 23 deletions game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,28 @@

using namespace blit;

///////////////////////////////////////////////////////////////////////////
//
// init()
//
// setup your game here
//
void init() {
set_screen_mode(ScreenMode::hires);
set_screen_mode(ScreenMode::hires); // lores is the default
}

///////////////////////////////////////////////////////////////////////////
//
// 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
//
// This function is called to perform rendering of the game.
// `time` is the amount of milliseconds elapsed since the device was last reset.
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.pen = Pen(0, 0, 0);
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
//
// This is called to update your game state.
// `time` is the amount of milliseconds elapsed since the device was last reset and will always be 10ms after the last update.
void update(uint32_t time) {
}
}