summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-04-24 23:51:27 +0200
committerAki <please@ignore.pl>2022-04-24 23:51:27 +0200
commit88d53cab4e10aed6cdae443aa66136add99562bb (patch)
tree7a75635ba679c0c1f8fc371079429d3ec5142673
parent38df088b80cb6c159eb9941cf6d3c0a8492e65ee (diff)
downloadbullethell2022-88d53cab4e10aed6cdae443aa66136add99562bb.zip
bullethell2022-88d53cab4e10aed6cdae443aa66136add99562bb.tar.gz
bullethell2022-88d53cab4e10aed6cdae443aa66136add99562bb.tar.bz2
Added some colorful stuff and interface
-rw-r--r--Game.cpp1
-rw-r--r--GameScreen.cpp5
-rw-r--r--OverScreen.cpp1
-rw-r--r--TestStage.cpp6
-rw-r--r--TitleScreen.cpp1
5 files changed, 13 insertions, 1 deletions
diff --git a/Game.cpp b/Game.cpp
index 13790d5..a1b54ae 100644
--- a/Game.cpp
+++ b/Game.cpp
@@ -26,7 +26,6 @@ Game::update(const float dt)
void
Game::draw()
{
- ClearBackground(BLACK);
if (m_screen)
m_screen->draw();
}
diff --git a/GameScreen.cpp b/GameScreen.cpp
index 1a8795f..a5b4c6c 100644
--- a/GameScreen.cpp
+++ b/GameScreen.cpp
@@ -10,6 +10,9 @@
#include "Stage.h"
+static constexpr Color INTERFACE {0, 0, 0, 230};
+
+
GameScreen::GameScreen(std::unique_ptr<Stage> stage) :
m_stage {std::move(stage)},
m_stats {std::make_shared<Stats>()}
@@ -31,6 +34,8 @@ void
GameScreen::draw()
{
m_stage->draw();
+ DrawRectangle(0, 0, 160, 600, INTERFACE);
+ DrawRectangle(800 - 160, 0, 160, 600, INTERFACE);
DrawText(TextFormat("%d", m_stats->total_bullets), 5, 25, 20, DARKGRAY);
DrawText(TextFormat("%d", m_stats->lifes), 5, 45, 20, DARKGREEN);
DrawText(TextFormat("%d", m_stats->points), 5, 65, 20, GOLD);
diff --git a/OverScreen.cpp b/OverScreen.cpp
index 348e5a9..844a9dd 100644
--- a/OverScreen.cpp
+++ b/OverScreen.cpp
@@ -32,5 +32,6 @@ OverScreen::update(const float)
void
OverScreen::draw()
{
+ ClearBackground(BLACK);
DrawText(DIED, m_died_x, 160, 20, RED);
}
diff --git a/TestStage.cpp b/TestStage.cpp
index e6ff74a..7dd5779 100644
--- a/TestStage.cpp
+++ b/TestStage.cpp
@@ -1,8 +1,13 @@
#include "TestStage.h"
+#include <raylib.h>
+
#include "EnemyFactory.h"
+static constexpr Color DEEPSPACE {3, 5, 22, 255};
+
+
TestStage::TestStage() :
m_player {},
m_const {}
@@ -34,6 +39,7 @@ TestStage::update(const float dt)
void
TestStage::draw()
{
+ ClearBackground(DEEPSPACE);
m_const.draw();
for (auto& enemy : m_enemies)
enemy.draw();
diff --git a/TitleScreen.cpp b/TitleScreen.cpp
index 0bf52f8..ec590b1 100644
--- a/TitleScreen.cpp
+++ b/TitleScreen.cpp
@@ -39,6 +39,7 @@ TitleScreen::update(const float dt)
void
TitleScreen::draw()
{
+ ClearBackground(BLACK);
DrawText(TITLE, m_title_x, 160, FONT_SIZE, LIGHTGRAY);
if (m_blink < INTERVAL)
DrawText(PRESS, m_press_x, 180, FONT_SIZE, GRAY);