Giter VIP home page Giter VIP logo

2d_game's Introduction

2D_Game

This is a pretty small game created for my thesis: "Creation of a cross-platform 2D Game using a data oriented approach". Features: one-way platforms, coins, hazards, enemies and ladders.

Built With

  • SFML - The framework used for rendering
  • entt - Open source library used for the ECS
  • CMake - Build System
  • conan - Open source package manager/dependency manager
  • Tiled - Tilemap editor
  • tmxlite - Parse tilemaps exported from Tiled
  • box2d - A 2D Physics Engine for Games
  • spdlog - Logging library

Prerequisites

Tiled

[OPTIONAL] Download and install Tiled if you want to modify the tilemaps

$Windows

Python/pip

Download and install Python and pip from the official website.

CMake

Donwload and install CMake from the official website.

conan

After installing pip run the following command:

pip install conan

Installing

Clone the repo

git clone https://github.com/ggiap/2D_Game.git
cd 2D_Game

Initialize and update the submodules

git submodule update --init --recursive

Create a build folder

mkdir build
cd build

Build the executable

Using MinGW:

Debug build
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug ..
mingw32-make -j4
Release build
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ..
mingw32-make -j4
Run
cd bin
./2D_Game

Using MSVC:

Debug build
cmake -DCMAKE_BUILD_TYPE=Debug ..
cmake --build . --config Debug
Release build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release
Run
cd bin
./2D_Game

$Manjaro

pip

sudo pacman -Syu python-pip

conan

pip install conan

CMake

sudo pacman -Syu cmake

make

sudo pacman -Syu make

SFML

Download all the dependencies with your package manager for SFML before building the project:

  • freetype
  • x11
  • xrandr
  • udev
  • opengl
  • flac
  • ogg
  • vorbis
  • vorbisenc
  • vorbisfile
  • openal
  • pthread

Installing

Clone the repo

git clone https://github.com/ggiap/2D_Game.git && cd 2D_Game

Initialize and update the submodules

git submodule update --init --recursive

Create a build folder

mkdir build
cd build

Build the executable

Debug build
cmake -DCMAKE_BUILD_TYPE=Debug .. && make -j4
Release build
cmake -DCMAKE_BUILD_TYPE=Release .. && make -j4
Run
cd bin && ./2D_Game

Controls

  • W A S D: Control main character
  • - +: Zoom in/out
  • Arrows: Camera panning
  • Left mouse button: Grab and move bodies
  • Num1: SFML debug draw
  • Num2: Box2D debug draw
  • Esc: Pause
  • Backspace: (While in pause state) Return to menu
  • P: Spawn enemy
  • I: Reset camera target

License

This project is licensed under the MIT License - see the LICENSE.md file for details

2d_game's People

Contributors

ggiap avatar georgegiapotzis avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

sysfce2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.