Player Library
Diff: Player.cpp
- Revision:
- 10:43b537436eb5
- Parent:
- 9:002ea306683d
- Child:
- 11:1a8dc3242e13
diff -r 002ea306683d -r 43b537436eb5 Player.cpp --- a/Player.cpp Tue May 02 10:29:47 2017 +0000 +++ b/Player.cpp Wed May 03 13:32:14 2017 +0000 @@ -10,10 +10,12 @@ } -int sprite[3][3] = { - {1,0,1}, - {0,1,0}, - {1,0,1}, +int sprite[5][6] = { + {0,1,0,0,1,0}, + {1,1,0,0,1,1}, + {1,1,1,1,1,1}, + {1,1,1,1,1,1}, + {0,1,1,1,1,0}, }; int m = 0; @@ -22,7 +24,7 @@ void Player::init() //Delete Int { - _speed = 0.3; // default speed + _speed = 0.05;// default speed } @@ -35,7 +37,7 @@ m = m+1; } //printf("SPRITE %d %d \n", _x, _y); - lcd.drawSprite(_x,_y,3,3,(int *)sprite); + lcd.drawSprite(_x,_y,5,6,(int *)sprite); } @@ -55,7 +57,7 @@ void Player::update(Direction d,float mag) { - _speed = int(mag*10.0f); // scale is arbitrary, could be changed in future + _speed = int(mag*5.0f); // scale is arbitrary, could be changed in future // update y value depending on direction of movement @@ -97,11 +99,12 @@ if (_x <= 0) { _x = 0; } - if (_x > 81) { - _x = 81; + if (_x > 78) { + _x = 78; } - if (_y > 45) { - _y = 45; + if (_y > 43) { + _y = 43; } -} \ No newline at end of file +} +