Skip to content
← Back to Community
C++ 2d Game starter
Profile icon
ANDREWVOSS

An easy-to-use game starter with builtin classes for basic graphics and some code for basic movement and controls. Also has conditional compilation, so you can run it on your PC (Windows or Linux).

Voters
Profile icon
Dunce
Profile icon
EpicGamer007
Profile icon
DynamicSquid
Profile icon
ANDREWVOSS
Comments
hotnewtop
Profile icon
DynamicSquid

Nice! I like how there's almost no flickering :)

How did you clear the screen?

Profile icon
realTronsi

@DynamicSquid flickering usually comes from terminal buffering. He enables raw mode, which if I recall does disable some of this bbuffering. Also with terminal games you don't clear and redraw every "frame" per se, you can use escape sequences to move your cursor around and clear specific pixels. Even if you were to use escape sequences to clear the entire console, that would be usually faster than any native console clearing commands as it doesn't require a bunch of intermediate steps which are used for buffering, formatting, etc.

Profile icon
DynamicSquid

@realTronsi Oh okay. That's very similar to the way Windows does it, which I'm more familiar with

Profile icon
ANDREWVOSS

@DynamicSquid Yeah. It uses the ANSI escape code for clearing parts of the screen, which behaves a little weird on Windows and Ubuntu.