Liu Liting 201199465

Dependencies:   mbed N5110

Committer:
Ting12138
Date:
Thu May 14 15:42:14 2020 +0000
Revision:
13:a57a48e5e256
Parent:
12:3b7811c3502c
the 2645 project

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Ting12138 12:3b7811c3502c 1 #ifndef FOODS_H
Ting12138 12:3b7811c3502c 2 #define FOODS_H
Ting12138 12:3b7811c3502c 3
Ting12138 12:3b7811c3502c 4 #include "mbed.h"
Ting12138 12:3b7811c3502c 5 #include "N5110.h"
Ting12138 12:3b7811c3502c 6 #include "Gamepad.h"
Ting12138 12:3b7811c3502c 7
Ting12138 12:3b7811c3502c 8 class foods
Ting12138 12:3b7811c3502c 9 {
Ting12138 12:3b7811c3502c 10
Ting12138 12:3b7811c3502c 11 public:
Ting12138 12:3b7811c3502c 12 foods();
Ting12138 12:3b7811c3502c 13 ~foods();
Ting12138 12:3b7811c3502c 14
Ting12138 12:3b7811c3502c 15 void init(int x,int bulk,int velocity);
Ting12138 12:3b7811c3502c 16 /**
Ting12138 12:3b7811c3502c 17 *param N5110 @details LCD screen
Ting12138 12:3b7811c3502c 18 *brief Displays food on screen
Ting12138 12:3b7811c3502c 19 */
Ting12138 12:3b7811c3502c 20 void draw(N5110 &lcd);
Ting12138 12:3b7811c3502c 21 // accessors and mutators
Ting12138 12:3b7811c3502c 22 /**
Ting12138 13:a57a48e5e256 23 * returns The new coordinate of foods
Ting12138 13:a57a48e5e256 24 * brief Updates the locations of foods
Ting12138 12:3b7811c3502c 25 */
Ting12138 12:3b7811c3502c 26 void update();
Ting12138 12:3b7811c3502c 27 /**
Ting12138 13:a57a48e5e256 28 * returns The new coordinate of foods
Ting12138 13:a57a48e5e256 29 * brief Resets the locations of foods
Ting12138 12:3b7811c3502c 30 */
Ting12138 12:3b7811c3502c 31 void replace();
Ting12138 12:3b7811c3502c 32 /**
Ting12138 13:a57a48e5e256 33 * returns The coordinate of foods
Ting12138 13:a57a48e5e256 34 * brief Retrieves the locations of foods
Ting12138 12:3b7811c3502c 35 */
Ting12138 13:a57a48e5e256 36 Vector2D get_locations();
Ting12138 12:3b7811c3502c 37
Ting12138 12:3b7811c3502c 38 private:
Ting12138 12:3b7811c3502c 39
Ting12138 13:a57a48e5e256 40 int _bulk; // the foods'raions
Ting12138 12:3b7811c3502c 41 int _x;
Ting12138 12:3b7811c3502c 42 int _y;
Ting12138 12:3b7811c3502c 43 int _velocity;
Ting12138 12:3b7811c3502c 44 };
Ting12138 12:3b7811c3502c 45 #endif