Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Game/Game.cpp
- Committer:
- joshdavy
- Date:
- 2019-04-19
- Revision:
- 8:21b6d4dbce44
- Parent:
- 7:68e06dda79f7
- Child:
- 9:96969b1c6bde
File content as of revision 8:21b6d4dbce44:
#include "Game.h" // Objects const int number_of_blocks = 4; Block blocks [number_of_blocks] = { { {5,30},{80,40} }, { {5,5},{80,10} }, { {10,24},{20,34} }, { {40,24},{44,26} } }; const int number_of_moving_blocks = 1; MovingBlock moving_blocks [number_of_moving_blocks] = { {2,30,30,1,1,0,0} }; Game::Game() { } void Game::init() { Vector2D pos = {32,10}; _player.init(6,6,pos); Vector2D goal = {70,19}; _level.init(blocks,moving_blocks,number_of_blocks, number_of_moving_blocks, goal); } Game::~Game() { } void Game::read_input(Gamepad &pad) { } void Game::update(Gamepad &pad) { _player.update(pad, blocks,number_of_blocks); } void Game::draw(N5110 &lcd) { lcd.clear(); _level.render(lcd); _player.render(lcd); lcd.refresh(); }