This framework is for helping students on the SP1 module to get started quickly on their projects. This framework only works on the Windows environment as it uses Windows API in some of its features.
- Game loop
- Key press detection
- Go to a certain console coordinate
- Colours in console
- Frame rate limiter
- Team leader should fork this project into their own repository
- Add your team mates as collaborators
- Read and understand the code
- Team leader should add this repository as a upstream remote repository if you want to get the latest bug fix or improvements. Configuring a remote for a fork
- Periodically sync changes to this repository to get latest awesome code. Syncing a fork
- Start working on your project! Remember to commit often!
The framework is a basic bare bones implementation of a game loop. You should not mess around with the main files unless you know what you are doing.
There are certain functions that you should be implementing.
Initializes the game variables, load data, allocate memory, etc. Code that should run before the game starts should be here.
Detects input from input sources, e.g. keyboard. This is where you detect if the user has given any input to the game, and set your flags accordingly.
This is the meat of your code, the game logic should be done here. i.e. reaction to input, enemy movement, enemy spawning, win game condition, lose game condition, state of game, etc. Sounds can be played here.
Renders the current state of game onto screen. Go to a specific coordinate on the screen, set colours, write output, etc.
Code for cleaning up of game, writing of files, close files, free up memory, etc.
###Console functions in the framework
Inits the console size, and give it a title, pass in a C-Style string
Call this before you quit the game. Returns the console to show output from the STDOUT stream
Clears the data buffer, hence "clearing the screen", preparing for new data.
These 3 functions writes to the buffer at that coordinate, you can use C-Style strings, C++ string class or a char. The attribute is a optional parameter.
Call this at the end of the render() function so that the contents of the buffer will be displayed onto the screen.
Gets the screen data buffer, the buffer used in displaying the output. Do not use this unless you know what you are doing.
With the screen data buffer, flush the output to the console.
None yet