Stick_Runner
Dependencies: FXOS8700CQ Gamepad N5110 SDFileSystem mbed
Fork of Stick_Runner by
Diff: Character/Character.cpp
- Revision:
- 2:98a41609c827
- Parent:
- 1:db9ff66f67c8
- Child:
- 3:0c690f1c04d8
--- a/Character/Character.cpp Fri Apr 28 16:30:47 2017 +0000 +++ b/Character/Character.cpp Tue May 02 18:42:45 2017 +0000 @@ -1,26 +1,18 @@ #include "Character.h" -Character::Character() -{ -} - -Character::~Character() -{ - -} void Character::init() { charPosX = 42; charPosY = 75; charStatus = true; - // counter = 0; + } void Character::draw(N5110 &lcd) { - // draw Character in screen buffer. + lcd.setPixel(charPosX,charPosY); @@ -49,14 +41,6 @@ } -void Character::characterStatus(Vector2D p) -{ - if(((charPosX-5<p.x)&&(charPosX+5>p.x))&&((charPosY-5<p.y)&&(charPosY+5>p.y))) - { - - charStatus = false; - } -} void Character::updateCharacter(Direction d,float mag) @@ -140,9 +124,21 @@ Vector2D p = {charPosX,charPosY}; return p; } -bool Character::getCharacterStatus(){ + +void Character::characterStatus(Vector2D p) +{ + if(((charPosX-5<p.x)&&(charPosX+5>p.x))&&((charPosY-5<p.y)&&(charPosY+5>p.y))) + { + + charStatus = false; + } +} + + +bool Character::getCharacterStatus() +{ return charStatus; - } +} \ No newline at end of file