Robotcode
1.0
|
Implements some routines that are useful for having a reachin target. More...
#include <Target.h>
Public Member Functions | |
Target () | |
constructor | |
Target (TargetShape s) | |
constructor with shape given | |
void | draw () |
draw on screen | |
void | setColor (int c) |
sets color from table | |
void | setShape (TargetShape c) |
sets shape | |
void | explode (double speed) |
start explosion | |
Public Attributes | |
int | color |
Color (numtable entry) | |
TargetShape | shape |
shape of the target | |
Vector2D | position |
position of target | |
Vector2D | size |
size of target (mm) | |
double | explodeState |
where in explosion are you? | |
double | explodeSpeed |
explosion speed | |
bool | isExplode |
is currently exploding? | |
Static Public Attributes | |
static double | colors [5][3] |
Implements some routines that are useful for having a reachin target.
This can change the target in color and stores a position. The main feature is that it can explode visually
Target::Target | ( | ) |
constructor
Constructor doesn't do much, but sets the Target to be invisible
Target::Target | ( | TargetShape | s | ) |
constructor with shape given
Constructor doesn't do much, but sets the Target to be invisible and sets the shape of it
void Target::draw | ( | void | ) |
draw on screen
Draws the target and draws a number of lines if the target is exploding
void Target::setColor | ( | int | c | ) |
sets color from table
set color from a color list
c | is the whished color 0: black 1: white |
void Target::setShape | ( | TargetShape | s | ) |
void Target::explode | ( | double | speed | ) |
start explosion
Starts an explosion
speed | cm/ms of the explosion |