gba-sprite-engine/demos/demo4-conway/src/ActiveTrackingConwayScene.h

34 lines
736 B
C
Raw Normal View History

2018-11-30 16:32:22 +01:00
//
// Created by Wouter Groeneveld on 30/11/18.
//
#ifndef GBA_SPRITE_ENGINE_PROJECT_ACTIVETRACKINGCONWAYSCENE_H
#define GBA_SPRITE_ENGINE_PROJECT_ACTIVETRACKINGCONWAYSCENE_H
#include "ConwayScene.h"
struct cell {
bool taken;
2018-12-03 16:20:58 +01:00
int x, y, pos;
u8 futureState;
2018-11-30 16:32:22 +01:00
};
class ActiveTrackingConwayScene : public ConwayScene {
private:
2018-12-03 16:20:58 +01:00
int totalAmountAlive = 0;
int neighbourCount[MAP_SIZE] = {0};
cell activeCellIndex[MAP_SIZE + 1] = {0}, activeCellIndexBuffer[MAP_SIZE + 1] = {0};
2018-11-30 16:32:22 +01:00
public:
ActiveTrackingConwayScene(const std::shared_ptr<GBAEngine> &engine, u8 percentageSeed);
void tick(u16 keys) override;
void postload() override;
};
#endif //GBA_SPRITE_ENGINE_PROJECT_ACTIVETRACKINGCONWAYSCENE_H