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.
Dependencies: C12832 Servo mbed-rtos-edited mbed
Fork of NervousPuppySprintOne by
Diff: nervousPuppy.cpp
- Revision:
- 1:8fe6802d6971
- Parent:
- 0:f71b200c2f4d
- Child:
- 2:8415bea33a95
--- a/nervousPuppy.cpp Mon Jan 12 19:05:08 2015 +0000
+++ b/nervousPuppy.cpp Mon Jan 12 19:32:28 2015 +0000
@@ -1,13 +1,31 @@
#include "nervousPuppy.h"
nervousPuppy::nervousPuppy(){
-
+ bool isRunning = true;
+ while(isRunning){
+ if(isLonely()){} // MoveForward
+ else if(isScared()){} //MoveBack
+ }
+}
+
+bool nervousPuppy::isLonely(){
+ if(playerDistance > LONELY)return true;
+ else return false;
}
+bool nervousPuppy::isScared(){
+ if(playerDistance < SCARED)return true;
+ else return false;
+}
+
+float nervousPuppy::getPlayerDistance(){
+ return playerDistance;
+}
-
-int main() {
- while(1) {
+void nervousPuppy::setPlayerDistance(float dist){
+ playerDistance = dist;
+}
- }
+int main(){
+ nervousPuppy();
}
\ No newline at end of file
