Mochu Yao explorer game

Dependencies:   mbed

item/item.h

Committer:
el17my
Date:
2020-04-21
Revision:
3:672d4bd8225d
Parent:
2:89f04cd3bf45
Child:
8:201ef0618b7d

File content as of revision 3:672d4bd8225d:

#ifndef ITEM_H
#define ITEM_H

#include "mbed.h"

//* @the item file has three functions
//  1 generate an item in random position after one disappear
// 2 build the item's structer
// 3 build a barrier to increase difficulty
//* @date April 13th 2020
//* @author Yaomochu

class item
{
public:
    // Constructor and Destructor.
    item();
    ~item();

    // Initialises object.*/
    void init();
    //Generates the item and barrier. 
    void generate_item();
    //Sets the item coordinates.
    //rand_x = a random number that determines the x coordinate
    //rand_y = a random number that determines if the item's generated level
    void set_item(int random_x, int random_y);
    int *get_item_form();// rotating 
    int get_item_x();
    int get_item_y();


private:
    int _x;//the x coordinate of the item
    int _y;//the y coordinate of the item
    int _loop;//the loop is used for the item to rotating which means after a few loop it will change it's form
    bool _rotate_item;//when the loop reach a certain value the bool situation will determine if it will rotate 
};
#endif