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: mbed
Objects/Object.h
- Committer:
- el19tb
- Date:
- 2020-05-18
- Revision:
- 38:a6e040bf0e35
- Parent:
- 32:84e79aa7858c
- Child:
- 40:8cc82e3fce06
File content as of revision 38:a6e040bf0e35:
#ifndef OBJECT_H
#define OBJECT_H
// holds information about object
struct ObjectInfo
{
float x; // x pos
int y; // y pos
int dir; // direction of object
char c; // type of object
};
struct Rect
{
float right_side;
float left_side;
float up;
float bottom;
};
// keeps track of functions related to Objects
class Object
{
public:
// constructor
Object();
int slow;
int medium;
int fast;
int row;
int seperation;
int grid;
int size;
int screenWidth;
int screenHeight;
ObjectInfo object;
Rect rectangle; // used to check for collision
public:
void setRow(int row);
void setSeperation(int seperation);
void setSprite(char type);
void determineVehicleRecParamaters(char c);
void createRect(int x, int y);
void determineLogRecParamaters(char c);
void setDir(int dir);
void speedSlow(int dir);
void speedMedium(int dir);
void speedFast(int dir);
void initializeLogParameters();
void initializeScreenParameters()
};
#endif