Mochu Yao explorer game
Dependencies: mbed
Diff: item/item.cpp
- Revision:
- 31:8e92b65e0779
- Parent:
- 17:1b4ecc01b79f
diff -r 65e639ace415 -r 8e92b65e0779 item/item.cpp --- a/item/item.cpp Wed Apr 29 03:18:13 2020 +0000 +++ b/item/item.cpp Wed Apr 29 04:49:10 2020 +0000 @@ -19,7 +19,7 @@ void item::init() { // Starting position of the item. _x = 40; - _y = 44; + _y = 15; } void item::set_item(int random_x, int random_y) { @@ -31,13 +31,13 @@ _x = 40; }//go back to the intial position else if (_y < 5 || _y > 75) { - _y = 50; };//go back to the intial position + _y = 15; };//go back to the intial position //according to the height of the line, the item must be generated upper the line but can not be so high //if y >40, the item need to be one the second line and if is lower it has to be one the lower line if (random_y > 40) { - _y = 40; + _y = 45; } else { - _y = 20; + _y = 15; } _x = random_x;//x can be every random value between 6 and 74 }