Giter Club home page Giter Club logo

goodbird's Introduction

GoodBird

alt tag

A clone of angry bird game written in C++. I develope it for practicing class design. It is intented to be cross-platform game but I haven't tested it on linux because my computer is broken. Maybe need some modify to cmake script.(I hate to write cmake script...) The game logic is seperated from rendering. Therefore, it is able to port to any rendering APIs without modifying.

Build

The first two steps is needed if you are not able to run Goodbird.exe

  1. Download SFML library, compile it and move include and lib into thirdparty/SFML. And move DLLs into bin

    If you aren't doing wrong here. you have thirdyparty/SFML/include/SFML/Config.hpp and thirdyparty/SFML/lib/libsfml-xxxxxx.a and bin/sfml-xxxxx-2.dll

  2. Download Box2D library, compile it and move include and lib into thirdparty/Box2D (NOTE: You might need to add -DCMAKE_CXX_FLAGS=c++0x).

    If you aren't doing wrong here. you have thirdyparty/Box2D/include/Box2D/Box2D.h and thirdyparty/Box2D/lib/libBox2D.a

  3. goto bin directory and make(Windows)

     cmake .. -G "MinGW Makefiles"
     mingw32-make
    

    goto bin directory and make (Linux)

     cmake ..
     make
    
  4. run GoodBird

A Note for Porting to Different Rendering APIs

I provide SFML render interface here. But you can use your own.

A Note for Adding New Entity

You can inherit from Entity, or PhysicsEntity if you need Box2D's help. There are something you need to take care

  1. It's necessary to implement draw() function. please take Bird.cpp as reference

  2. If you need to update your entity(inherited from PhysicsEntity) every frame. please implement update() function. And don't forget to call base class's update

     void update(double globalTime)
     {
     	PhysicsEntity::update(globalTime);
     	// do your things
     }
    
  3. startContact and endContact is called when collision happens. It's useful if you need to do something when the event take place. you can implement it

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.