-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e077dac
Showing
7 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class Cell | ||
{ | ||
private: | ||
bool nextAliveState; | ||
|
||
public: | ||
bool alive; | ||
void update(); | ||
|
||
Cell(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <Cell.hpp> | ||
|
||
class Grid | ||
{ | ||
private: | ||
Cell *cells = nullptr; | ||
|
||
public: | ||
int width, height; | ||
Grid(int _width, int _height); | ||
~Grid(); | ||
|
||
void update(); | ||
|
||
Cell &getCell(int xpos, int ypos, int localWidth); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <SFML/Graphics.hpp> | ||
|
||
int main() | ||
{ | ||
int width = 800; | ||
int height = 600; | ||
// Create the main window | ||
sf::RenderWindow window(sf::VideoMode(width, height), "Game of Life"); | ||
|
||
// Main Loop | ||
while (window.isOpen()) | ||
{ | ||
sf::Event event; | ||
while (window.pollEvent(event)) | ||
{ | ||
// Close window | ||
if (event.type == sf::Event::Closed) | ||
{ | ||
window.close(); | ||
} | ||
} | ||
} | ||
} |
Binary file not shown.
Binary file not shown.