Giter VIP home page Giter VIP logo

pong's Introduction

Pong

Old Atari game named "Pong" as test-task

Development

Project was developed using MSVC 2019 and set of SDL libraries: SDL2, SDL_image, SDL_TTF.

Structure

The structure of the project is very simple.

In our main.cpp we initialize GameManager object and running game event loop.

GameManager Object - controls all our entities such as players and ball, also handles game status and tell SDLScene to render that scene that is needed by game state.

TextureLoader loads all textures from "asset" folder and provides easy access for SDLScene to get thom for rendering.

SDLScene just gets all data from objects and render their positions.

Our entities (players and balls) controls their moves by them own. It's needed for simplifying controls and calculation logic as well as improve code readability.

Building

Build from console:

Recommended tools: MSVC and Ninja

  1. git clone https://github.com/Lerksy/Pong.
  2. Run x64 (or x86) Native Tools from MSVC Package
  3. Navigate to source folder
  4. mkdir build && cd build
  5. cmake -G Ninja ..
  6. cmake --build . --config release

Alternative way to build

Run any IDE that supports CMake projects (CLion, QtCreator, MS Visual Studio, etc...) And simply build project in IDE

WARNING This project uses C++20 standard. Be careful if you are using old compiler!

Controls

Use arrow up and arrow down for moving right platform and w, s for control left platform.

pong's People

Contributors

lerksy avatar

Watchers

 avatar

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.