Skip to content

Commit

Permalink
merge develop
Browse files Browse the repository at this point in the history
  • Loading branch information
GitBluub committed Jun 19, 2021
2 parents fc3b694 + 4e36829 commit 6e7e013
Show file tree
Hide file tree
Showing 54 changed files with 1,582 additions and 169 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ build/*
docs/*
emsdk/
build_web/*
wasm-python.py
wasm-python.py
lua54*
include/*
save/*
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,18 @@ set(SOURCES
sources/System/Sound/PlayerSoundManagerSystem.hpp
sources/System/Music/MusicSystem.hpp
sources/System/Music/MusicSystem.cpp
sources/Parser/ParserYaml.hpp
sources/Parser/ParserYaml.cpp
sources/Exception/Error.hpp
sources/Exception/Error.cpp
sources/System/Lobby/LobbySystem.cpp
sources/System/Lobby/LobbySystem.hpp
sources/Component/Lobby/LobbyComponent.cpp
sources/Component/Lobby/LobbyComponent.hpp
sources/System/Lobby/ResumeLobbySystem.cpp
sources/System/Lobby/ResumeLobbySystem.hpp
sources/Component/Lobby/ResumeLobbyComponent.cpp
sources/Component/Lobby/ResumeLobbyComponent.hpp
sources/Component/Gravity/GravityComponent.hpp
sources/Component/Gravity/GravityComponent.cpp
sources/System/Gravity/GravitySystem.hpp
Expand Down Expand Up @@ -156,6 +164,12 @@ set(SOURCES
sources/System/EndCondition/EndConditionSystem.hpp
sources/System/EndCondition/EndConditionSystem.cpp
sources/Runner/LobbyScene.cpp
sources/Runner/ResumeLobbyScene.cpp
sources/Runner/ScoreScene.cpp
sources/Parser/Node.cpp
sources/Parser/Node.hpp
sources/Utils/Utils.cpp
sources/Utils/Utils.hpp
sources/Runner/HowToPlayScene.cpp
sources/Runner/ScoreScene.cpp
sources/System/Shaders/ShaderSystem.cpp
Expand All @@ -180,6 +194,8 @@ set(SOURCES
sources/Map/LuaMap.hpp
sources/Component/Shaders/Items/AlphaCtxShaderComponent.cpp
sources/Component/Shaders/Items/AlphaCtxShaderComponent.hpp
sources/Component/Speed/SpeedComponent.cpp
sources/Component/Speed/SpeedComponent.hpp
)

add_executable(bomberman
Expand Down
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ A recreation of the classic Bomberman arcade game

Repository link: https://github.com/AnonymusRaccoon/Bomberman/

## Demo

Very soon :)
## Demo (Click to See on YouTube)

[![DEMO](http://img.youtube.com/vi/5tkaYtMpdKY/0.jpg)](http://www.youtube.com/watch?v=5tkaYtMpdKY "Indie Studio - Bomberman")

## Screenshots

Very soon :)
<div>
<img align="left" src="./assets/images/titlescreen.png" width="45%">
<img align="right" src="./assets/images/lobby.png" width="45%">
<img src="./assets/images/game.png">
</div>


## Run (compile from the sources)
Expand Down Expand Up @@ -56,14 +59,7 @@ Enjoy !

## Tech Stack

**Bomberman:** C++20, raylib, Catch2, CMake, Doxygen
## Contributing

Contributions are always welcome!

See `contributing.md` for ways to get started.

Please adhere to this project's `code of conduct`.
**Bomberman:** C++20, raylib, Catch2, CMake, Doxygen, Lua


## Authors
Expand Down
2 changes: 1 addition & 1 deletion assets/ai_scripts/john.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mapinfo.dist { }
------------

------ Debug variables
local debug = true
local debug = false

if not debug then
log = function() end
Expand Down
Binary file added assets/buttons/button_resume_game.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/buttons/button_resume_game_hovered.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/buttons/button_save.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/buttons/button_save_hovered.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/game.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/lobby.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/titlescreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/game.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/lobby.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/titlescreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/Ray/sources/Vector/Vector3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ RAY::Vector3::operator ::Vector3() const
v.y = this->y;
v.z = this->z;
return v;
}
}
5 changes: 5 additions & 0 deletions lib/wal/sources/Entity/Entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ namespace WAL
return this->_name;
}

void Entity::setName(std::string &name)
{
this->_name = name;
}

bool Entity::isDisable() const
{
return this->_disabled;
Expand Down
4 changes: 3 additions & 1 deletion lib/wal/sources/Entity/Entity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ namespace WAL
Scene &_scene;
//! @brief Get the ID of the entity.
unsigned getUid() const;
//! @brief Get the name fo the entity
//! @brief Get the name of the entity
std::string getName() const;
//!@brief Set the name of the entity
void setName(std::string &name);

//! @brief Used if the entity is disabled
bool isDisable() const;
Expand Down
5 changes: 3 additions & 2 deletions sources/Component/BombHolder/BombHolderComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ namespace BBM
: WAL::Component(entity)
{}

BombHolderComponent::BombHolderComponent(WAL::Entity &entity, unsigned int maxCount)
BombHolderComponent::BombHolderComponent(WAL::Entity &entity, unsigned int maxCount, unsigned int bombExplosionRadius)
: WAL::Component(entity),
maxBombCount(maxCount)
maxBombCount(maxCount),
explosionRadius(bombExplosionRadius)
{}

WAL::Component *BombHolderComponent::clone(WAL::Entity &entity) const
Expand Down
4 changes: 2 additions & 2 deletions sources/Component/BombHolder/BombHolderComponent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace BBM
//! @brief The number of nanosecond before the next bomb refill.
std::chrono::nanoseconds nextBombRefill = refillRate;
//! @brief The radius of the explosion.
float explosionRadius = 3;
unsigned int explosionRadius = 3;
//! @brief The damage made by the explosion on an entity
int damage = 1;

Expand All @@ -37,7 +37,7 @@ namespace BBM
explicit BombHolderComponent(WAL::Entity &entity);

//! @brief Constructor
BombHolderComponent(WAL::Entity &entity, unsigned int maxBombCount);
BombHolderComponent(WAL::Entity &entity, unsigned int maxBombCount, unsigned int bombExplosionRadius = 3);

//! @brief A component can't be instantiated, it should be derived.
BombHolderComponent(const BombHolderComponent &) = default;
Expand Down
2 changes: 0 additions & 2 deletions sources/Component/Controllable/ControllableComponent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ namespace BBM
bool bomb = false;
//! @brief input value for pause
bool pause = false;
//! @brief The speed applied to every controllable entities.
float speed = .15f;
//! @brief The layout used for this controllable.
Layout layout = NONE;
//! @brief True if buttons should be triggered every frame where the key is down, false if the button should only be triggered once the key is released.
Expand Down
21 changes: 21 additions & 0 deletions sources/Component/Lobby/ResumeLobbyComponent.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// Created by hbenjamin on 6/18/21.
//

#include "ResumeLobbyComponent.hpp"

namespace BBM
{
ResumeLobbyComponent::ResumeLobbyComponent(WAL::Entity &entity, int playerNumber, WAL::Entity &button, WAL::Entity &tile, int pColor)
: WAL::Component(entity),
playerID(playerNumber),
playerColor(pColor),
readyButton(button),
coloredTile(tile)
{}

WAL::Component *ResumeLobbyComponent::clone(WAL::Entity &entity) const
{
return new ResumeLobbyComponent(entity, this->playerID, this->readyButton, this->coloredTile, this->playerColor);
}
}
44 changes: 44 additions & 0 deletions sources/Component/Lobby/ResumeLobbyComponent.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// Created by hbenjamin on 6/18/21.
//

#pragma once

#include <Component/Component.hpp>
#include <Entity/Entity.hpp>
#include <Color.hpp>
#include <Component/Controllable/ControllableComponent.hpp>
#include <chrono>

namespace BBM
{
class ResumeLobbyComponent : public WAL::Component
{
public:
//! @brief The layout used for this player.
ControllableComponent::Layout layout = ControllableComponent::NONE;
//! @brief The ID of the lobby player (from 0 to 3)
int playerID;
//! @brief The color of the player (as an index)
int playerColor;
//! @brief Is this player ready
bool ready = false;
//! @brief The entity containing the ready display.
WAL::Entity &readyButton;
//! @brief The colored rectangle behind the player.
WAL::Entity &coloredTile;
//! @brief The time of last input that this lobby player has made.
std::chrono::time_point<std::chrono::steady_clock> lastInput;

Component *clone(WAL::Entity &entity) const override;

//! @brief Create a new lobby component.
explicit ResumeLobbyComponent(WAL::Entity &entity, int playerNumber, WAL::Entity &button, WAL::Entity &tile, int pColor);
//! @brief A lobby component is copyable.
ResumeLobbyComponent(const ResumeLobbyComponent &) = default;
//! @brief A default destructor
~ResumeLobbyComponent() override = default;
//! @brief A lobby component is not assignable.
ResumeLobbyComponent &operator=(const ResumeLobbyComponent &) = delete;
};
}
24 changes: 24 additions & 0 deletions sources/Component/Speed/SpeedComponent.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// Created by cbihan on 18/06/2021.
//

#include "SpeedComponent.hpp"

namespace BBM
{
SpeedComponent::SpeedComponent(WAL::Entity &entity) :
WAL::Component(entity)
{
}

WAL::Component *SpeedComponent::clone(WAL::Entity &entity) const
{
return new SpeedComponent(this->_entity, this->speed);
}

SpeedComponent::SpeedComponent(WAL::Entity &entity, float entitySpeed) :
WAL::Component(entity),
speed(entitySpeed)
{
}
}
34 changes: 34 additions & 0 deletions sources/Component/Speed/SpeedComponent.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// Created by cbihan on 18/06/2021.
//

#pragma once

#include <Component/Component.hpp>

namespace BBM
{
class SpeedComponent : public WAL::Component
{
public:
//! @brief entity speed
float speed = .15f;

//! @inherit
WAL::Component *clone(WAL::Entity &entity) const override;

//! @brief Initialize a new controllable component.
explicit SpeedComponent(WAL::Entity &entity);

//! @brief Initialize a new controllable component.
explicit SpeedComponent(WAL::Entity &entity, float entitySpeed);
//! @brief A Controllable component is copy constructable.
SpeedComponent(const SpeedComponent &) = default;
//! @brief default destructor
~SpeedComponent() override = default;
//! @brief A Controllable component can't be assigned
SpeedComponent &operator=(const SpeedComponent &) = delete;
};


}
1 change: 1 addition & 0 deletions sources/Component/Tag/TagComponent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ namespace BBM
constexpr const char Bumper[] = "Bumper";
// interact with bombs (getting damage etc) but doesn't stop explosion
constexpr const char BlowablePass[] = "BlowablePass";
constexpr const char Timer[] = "Timer";
}
16 changes: 16 additions & 0 deletions sources/Exception/Error.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// Created by hbenjamin on 11/06/2021.
//

#include "Error.hpp"

namespace BBM
{
Error::Error(const std::string &what)
: std::runtime_error(what)
{}

ParserError::ParserError(const std::string &what)
: Error(what)
{}
} // namespace BBM
37 changes: 37 additions & 0 deletions sources/Exception/Error.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// Created by hbenjamin on 11/06/2021.
//

#pragma once

#include <exception>
#include <stdexcept>
#include <string>

namespace BBM {
class Error : public std::runtime_error
{
public:
//! @brief Create a new exception
explicit Error(const std::string &what);
//! @brief An exception is copy constructable
Error(const Error &) = default;
//! @brief A default destructor
~Error() override = default;
//! @brief A default assignment operator
Error &operator=(const Error &) = default;
};

class ParserError : public Error
{
public:
//! @brief Create a new parser exception
explicit ParserError(const std::string &what);
//! @brief A parser exception is copy constructable
ParserError(const ParserError &) = default;
//! @brief A default destructor
~ParserError() override = default;
//! @brief A default assignment operator
ParserError &operator=(const ParserError &) = default;
};
}
9 changes: 5 additions & 4 deletions sources/Items/Bonus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <Component/Collision/CollisionComponent.hpp>
#include <Component/Collision/CollisionComponent.hpp>
#include <Component/Controllable/ControllableComponent.hpp>
#include "Component/Speed/SpeedComponent.hpp"
#include <Component/Bonus/PlayerBonusComponent.hpp>
#include "Component/Movable/MovableComponent.hpp"
#include "Bonus.hpp"
Expand Down Expand Up @@ -40,13 +41,13 @@ namespace BBM {
{
if (bonus.shouldDelete() || axis != CollisionComponent::CollidedAxis::ALL)
return;
auto *controllable = player.tryGetComponent<ControllableComponent>();
auto *speed = player.tryGetComponent<SpeedComponent>();
auto *playerBonus = player.tryGetComponent<PlayerBonusComponent>();
if (!controllable || !playerBonus)
if (!speed || !playerBonus)
return;
if (controllable->speed >= 0.4)
if (speed->speed >= 0.4)
return;
controllable->speed += 0.025f;
speed->speed += 0.025f;
const_cast<WAL::Entity &>(bonus).scheduleDeletion();
}

Expand Down
Loading

0 comments on commit 6e7e013

Please sign in to comment.