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.
Diff: Sprite/Sprite.cpp
- Revision:
- 8:21b6d4dbce44
- Parent:
- 7:68e06dda79f7
- Child:
- 9:96969b1c6bde
--- a/Sprite/Sprite.cpp Wed Apr 17 12:39:46 2019 +0000
+++ b/Sprite/Sprite.cpp Fri Apr 19 17:54:09 2019 +0000
@@ -9,53 +9,32 @@
_height = height;
_width = width;
_bitmap = bitmap;
- _pos = pos;
+ _pos = pos;
}
void Sprite::update()
{
- _pos.y += GRAVITY;
+
}
-void Sprite::render(N5110 &lcd) {
-
- lcd.drawSprite(_pos.x,_pos.y,_height,_width, _bitmap);
+void Sprite::render(N5110 &lcd)
+{
+
+ lcd.drawSprite(_pos.x,_pos.y,_height,_width, _bitmap);
};
-Vector2D Sprite::getPos() {
+Vector2D Sprite::getPos()
+{
return _pos;
};
-void Sprite::setPos(Vector2D pos) {
+void Sprite::setPos(Vector2D pos)
+{
_pos = pos;
};
-void Sprite::setBitmap(int * bitmap) {
- _bitmap = bitmap ;
+void Sprite::setBitmap(int * bitmap)
+{
+ _bitmap = bitmap ;
};
-
-void Sprite::flip() {
- int newBitmap [_height][_width] ;
- for (int i = 0;i < _height;i++) {
- for (int j = 0;j < _width;j++) {
-
- newBitmap[i][j] = 1;
- printf("%i\n",newBitmap[i][j]);
- };
- };
- _bitmap = (int *) newBitmap;
-
-
-//const int play[6][6] = {
-// {1,1,1,1,1,1},
-// {1,0,0,0,0,1},
-// {1,0,0,0,0,1},
-// {1,0,0,0,0,1},
-// {1,0,0,0,0,1},
-// {1,1,1,1,1,1}
-//};
-//
-//setBitmap((int *) play);
-
-};
\ No newline at end of file