Skip to content

It is a simple 2d game demo written in C++ using Unity3d-like gameobject/component system. I've tried to make it easy to extend and to upgrade.

License

Notifications You must be signed in to change notification settings

Cheburum/bubbly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sinopsis

It is a simple 2d game demo with physics written in C++ using Unity3d-like gameobject/component system. I've tried to make it easy to extend and to upgrade

Code example

  1. Add new empty GameObject to game world.
  auto& newGameObject = scene.createGameObject();
  1. Add Physics component to this object. All components require GameObject reference. And physComponent needs some physics info: mass, static or dynamic, is affected by gravity or not.
  newGameObject.addComponent("Physics", new PhysComponent(newGameObject, 0.0f, false, false));
  1. We can get component from GO by name.
  const auto currentPhysComponent = newGameObject.getComponent<PhysComponent>("Physics")
  1. Set the collider of physComponent.
  currentPhysComponent -> setCollider(Collider::rectangleCollider(sf::Vector2f(1.0f,3.0f));
  1. Set GameObject's position.
  newGameObject.getTransform().position = sf::Vector2f(3.0f,4.0f);

Installation

You will need SFML library to compile it.

Ubuntu

sudo apt install libsfml-dev
git clone https://github.com/Cheburum/bubbly.git
cd ./bubbly/src
cmake .
make

License

GPLv3 (look LICENSE file in repository).

Screenshot

screenshot

About

It is a simple 2d game demo written in C++ using Unity3d-like gameobject/component system. I've tried to make it easy to extend and to upgrade.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published