G.U.L.L.S. rebuilt to use PlatformIO
This commit is contained in:
36
include/RicochetHelper.h
Normal file
36
include/RicochetHelper.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef RICOCHETHELPER_H
|
||||
#define RICOCHETHELPER_H
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "FastLED.h"
|
||||
|
||||
class RicochetHelper {
|
||||
public:
|
||||
RicochetHelper() {}
|
||||
RicochetHelper(int16_t _startPosX, int16_t _startPosY, int16_t _width, int16_t _height,
|
||||
CRGB _color) : currentX(_startPosX), currentY(_startPosY), width(_width),
|
||||
height(_height), xDir(random(0, 101) > 51 ? -1 : 1), yDir(random(0, 100) > 51 ? -1 : 1) {}
|
||||
|
||||
int16_t getCurrentXPos() { return currentX; }
|
||||
int16_t getCurrentYPos() { return currentY; }
|
||||
|
||||
CRGB getCurrentColor() { return color; }
|
||||
|
||||
void setCurrentColor(uint16_t _color) { color = _color; }
|
||||
|
||||
void updatePositions();
|
||||
|
||||
private:
|
||||
int16_t
|
||||
currentX,
|
||||
currentY,
|
||||
width,
|
||||
height;
|
||||
int8_t
|
||||
xDir,
|
||||
yDir;
|
||||
CRGB
|
||||
color;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user