Skip to content

Commit

Permalink
Merge pull request #121 from X-R-G-B/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Saverio976 authored Apr 9, 2023
2 parents d0b4c74 + 9673fec commit 2a0af55
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 19 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

## Dependencies

- https://miniaud.io/index.html
- sdl2
- sdl2_image
- sdl2_mixer
- sdl2_ttf
- SFML
- ncurses

Expand All @@ -26,8 +27,7 @@ Change game/graphical lib at runtime
## Install

```bash
cmake .
make
mkdir build && cd build && cmake . && make -j8
```

## Usage
Expand Down
8 changes: 4 additions & 4 deletions src/GameLibs/Nibbler/Component/NibblerMapComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include "NibblerCompType.hpp"
#include "NibblerMapComponent.hpp"

static const Arcade::Graph::Color foregroundColorDark(0, 220, 0, 0);
static const Arcade::Graph::Color backgroundColorDark(0, 220, 0, 0);
static const Arcade::Graph::Color foregroundColorBright(0, 150, 0, 0);
static const Arcade::Graph::Color backgroundColorBright(0, 150, 0, 0);
static const Arcade::Graph::Color foregroundColorDark(0, 255, 0, 0);
static const Arcade::Graph::Color backgroundColorDark(0, 255, 0, 0);
static const Arcade::Graph::Color foregroundColorBright(0, 200, 0, 0);
static const Arcade::Graph::Color backgroundColorBright(0, 200, 0, 0);

#define DARK_PARCELL "assets/snake/normal/bg_green_01.png"
#define LIGHT_PARCELL "assets/snake/normal/bg_green_02.png"
Expand Down
4 changes: 2 additions & 2 deletions src/GameLibs/Nibbler/Component/NibblerWallComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include "NibblerCompType.hpp"
#include "NibblerWallComponent.hpp"

static const Arcade::Graph::Color foregroundColor(160, 80, 0, 0);
static const Arcade::Graph::Color backgroundColor(120, 80, 0, 0);
static const Arcade::Graph::Color foregroundColor(255, 255, 100, 0);
static const Arcade::Graph::Color backgroundColor(255, 255, 100, 0);

#define WALL_PATH "assets/snake/normal/box_02.png"
#define DEFAULT_CHAR "#####\n#####\n#####"
Expand Down
6 changes: 3 additions & 3 deletions src/GameLibs/Nibbler/System/SnakeGrowSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ void Nibbler::System::SnakeGrowSystem::addNewBodyPartToSnake(Arcade::ECS::IEntit
body.path = NIBBLERBODYPATH;
body.rect = {0, 0, PARCELL_SIZE, PARCELL_SIZE};
body.currentRectIndex = 0;
body.ttyData.defaultChar = "#";
body.ttyData.background = {0, 255, 255, 0};
body.ttyData.foreground = {0, 255, 0, 0};
body.ttyData.defaultChar = "#####\n#####\n#####";
body.ttyData.background = {255, 255, 255, 0};
body.ttyData.foreground = {255, 255, 255, 0};
placeNewBody(entityManager, forward, body, idNbr);
entity.addComponent(forward);
growCompGrow.lastIdBodyComp = id;
Expand Down
8 changes: 4 additions & 4 deletions src/GameLibs/Snake/Component/SnakeMapComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
#include "GraphStruct.hpp"
#include "SnakeMapComponent.hpp"

static const Arcade::Graph::Color foregroundColorDark(0, 220, 0, 0);
static const Arcade::Graph::Color backgroundColorDark(0, 220, 0, 0);
static const Arcade::Graph::Color foregroundColorBright(0, 150, 0, 0);
static const Arcade::Graph::Color backgroundColorBright(0, 150, 0, 0);
static const Arcade::Graph::Color foregroundColorDark(0, 255, 0, 0);
static const Arcade::Graph::Color backgroundColorDark(0, 255, 0, 0);
static const Arcade::Graph::Color foregroundColorBright(0, 200, 0, 0);
static const Arcade::Graph::Color backgroundColorBright(0, 200, 0, 0);

#define DARK_PARCELL "assets/snake/normal/bg_green_01.png"
#define LIGHT_PARCELL "assets/snake/normal/bg_green_02.png"
Expand Down
6 changes: 3 additions & 3 deletions src/GameLibs/Snake/System/SnakeGrowSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ void Snake::System::SnakeGrowSystem::addNewBodyPartToSnake(Arcade::ECS::IEntityM
body.path = SNAKEBODYPATH;
body.rect = {0, 0, PARCELL_SIZE, PARCELL_SIZE};
body.currentRectIndex = 0;
body.ttyData.defaultChar = "#";
body.ttyData.background = {0, 255, 255, 0};
body.ttyData.foreground = {0, 255, 0, 0};
body.ttyData.defaultChar = "#####\n#####\n#####";
body.ttyData.background = {255, 255, 255, 0};
body.ttyData.foreground = {255, 255, 255, 0};
placeNewBody(entityManager, forward, body, idNbr);
entity.addComponent(forward);
growCompGrow.lastIdBodyComp = id;
Expand Down
3 changes: 3 additions & 0 deletions src/MainMenus/Basic/MainMenuScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ bool BasicMenu::MainMenuScene::init()
text->fontPath = PATH_FONT;
text->text = "Game Libs availible:";
text->textColor = {255, 0, 0, 255};
text->backgroundColor = {255, 255, 255, 255};
text->pos = compPos;
gamesEntity.addComponent(text);
compPos.x = 1920.0 / 2.0;
Expand All @@ -38,6 +39,7 @@ bool BasicMenu::MainMenuScene::init()
text->fontPath = PATH_FONT;
text->text = "Graphic Libs availible:";
text->textColor = {255, 0, 0, 255};
text->backgroundColor = {255, 255, 255, 255};
text->pos = compPos;
graphicsEntity.addComponent(text);
compPos.x = 1920.0 / 3.0;
Expand All @@ -46,6 +48,7 @@ bool BasicMenu::MainMenuScene::init()
text->fontPath = PATH_FONT;
text->text = "Scores:";
text->textColor = {255, 0, 0, 255};
text->backgroundColor = {255, 255, 255, 255};
text->pos = compPos;
graphicsEntity.addComponent(text);
return (true);
Expand Down
3 changes: 3 additions & 0 deletions src/MainMenus/Basic/MainMenuSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ void BasicMenu::MainMenuSystem::run(double deltaTime, Arcade::ECS::IEventManager
text->fontPath = PATH_FONT;
text->text = textText;
text->textColor = {255, 0, 0, 255};
text->backgroundColor = {255, 255, 255, 255};
text->pos = compPos;
compPos.y += 24;
gamesEntity->addComponent(text);
Expand All @@ -42,6 +43,7 @@ void BasicMenu::MainMenuSystem::run(double deltaTime, Arcade::ECS::IEventManager
text->fontPath = PATH_FONT;
text->text = textText;
text->textColor = {255, 0, 0, 255};
text->backgroundColor = {255, 255, 255, 255};
text->pos = compPos;
compPos.y += 24;
graphicsEntity->addComponent(text);
Expand All @@ -59,6 +61,7 @@ void BasicMenu::MainMenuSystem::run(double deltaTime, Arcade::ECS::IEventManager
text->fontPath = PATH_FONT;
text->text = textText.first + " : " + textText.second;
text->textColor = {255, 0, 0, 255};
text->backgroundColor = {255, 255, 255, 255};
text->pos = compPos;
compPos.y += 24;
graphicsEntity->addComponent(text);
Expand Down

0 comments on commit 2a0af55

Please sign in to comment.