Upload del repo clone di twang
This commit is contained in:
parent
9c164ceb04
commit
a20252c357
13 changed files with 1873 additions and 0 deletions
35
Spawner.h
Normal file
35
Spawner.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
#include "Arduino.h"
|
||||
|
||||
class Spawner
|
||||
{
|
||||
public:
|
||||
void Spawn(int pos, int rate, int sp, int dir, long activate);
|
||||
void Kill();
|
||||
int Alive();
|
||||
int _pos;
|
||||
int _rate;
|
||||
int _sp;
|
||||
int _dir;
|
||||
long _lastSpawned;
|
||||
long _activate;
|
||||
private:
|
||||
int _alive;
|
||||
};
|
||||
|
||||
void Spawner::Spawn(int pos, int rate, int sp, int dir, long activate){
|
||||
_pos = pos;
|
||||
_rate = rate;
|
||||
_sp = sp;
|
||||
_dir = dir;
|
||||
_activate = millis()+activate;
|
||||
_alive = 1;
|
||||
}
|
||||
|
||||
void Spawner::Kill(){
|
||||
_alive = 0;
|
||||
_lastSpawned = 0;
|
||||
}
|
||||
|
||||
int Spawner::Alive(){
|
||||
return _alive;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue