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:
- 4:afbf3dd71403
- Parent:
- 3:b34685dbdb8d
- Child:
- 7:68e06dda79f7
--- a/Sprite/Sprite.cpp Tue Apr 02 12:40:31 2019 +0000
+++ b/Sprite/Sprite.cpp Sat Apr 06 11:47:18 2019 +0000
@@ -1,16 +1,8 @@
#include "Sprite.h"
-
-
-Sprite::Sprite()
-{
+Sprite::Sprite() {}
-}
-
-Sprite::~Sprite()
-{
-
-}
+Sprite::~Sprite() {}
void Sprite::init(int height,int width,int * bitmap,Vector2D pos)
{
@@ -37,5 +29,35 @@
void Sprite::setPos(Vector2D pos) {
_pos = pos;
};
+
+void Sprite::setBitmap(int * bitmap) {
+ _bitmap = bitmap ;
+};
-
\ No newline at end of file
+void Sprite::flip() {
+ //int newBitmap [_height][_width] ;
+// for (int i = 0;i < _height;i++) {
+// for (int j = 0;j < _width;j++) {
+// printf("HI");
+// printf("%i,%i\n",i,j);
+//
+// newBitmap[i][j] = 1;//*((_bitmap+i*_height)+j);
+// 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