Files
twang-mp/TWANG32/Spawner.h
per1234 840eab60aa Move sketch to appropriately named subfolder
The Arduino IDE requires that a sketch be located in a folder of the same name. Although the name of the repository does match the sketch name, when GitHub's popular Clone or download > Download ZIP feature is used to download the contents of a repository the branch/release/commit name is appended to the folder name, causing a mismatch.

When opening a file that does not meet this sketch/folder name matching requirement the Arduino IDE presents a dialog:

The file "TWANG32.ino" needs to be inside a sketch folder named "TWANG32".
Create this folder, move the file, and continue?

After clicking "OK" the Arduino IDE currently moves only the file TWANG32.ino to the new folder, leaving behind the other source files. This causes compilation of the sketch to fail:

TWANG32-master\TWANG32\TWANG32.ino:30:23: fatal error: twang_mpu.h: No such file or directory
2018-04-28 22:40:54 -07:00

36 lines
575 B
C++

#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;
}