Files
twang-mp/Lava.h
bdring 23df267c9f First upload
Basic port complete - ESP32 specific features coming soon
2018-03-19 08:31:45 -05:00

40 lines
712 B
C++

#include "Arduino.h"
class Lava
{
public:
void Spawn(int left, int right, int ontime, int offtime, int offset, int state);
void Kill();
int Alive();
int _left;
int _right;
int _ontime;
int _offtime;
int _offset;
long _lastOn;
int _state;
static const int OFF = 0;
static const int ON = 1;
private:
int _alive;
};
void Lava::Spawn(int left, int right, int ontime, int offtime, int offset, int state){
_left = left;
_right = right;
_ontime = ontime;
_offtime = offtime;
_offset = offset;
_alive = 1;
_lastOn = millis()-offset;
_state = state;
}
void Lava::Kill(){
_alive = 0;
}
int Lava::Alive(){
return _alive;
}