First upload
Basic port complete - ESP32 specific features coming soon
This commit is contained in:
39
Lava.h
Normal file
39
Lava.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user