Giter Club home page Giter Club logo

tanks's Introduction

Tanks

Implementation of Battle City / Tank 1990. Game was written in C++11 and SDL2 2D graphic library.

Start menu Stage one

Controls:

  • Player 1: arrows and right CTRL to fire
  • Player 2: WSAD and left CTRL to fire
  • Pause: ENTER
  • Jump to next stage: n
  • Jump to previous stage: b
  • Show targets of enemies: t

Enemies

Each enemy may fire only one bullet in the same time. If bullet hits target, brick or stage border and explodes then enemy may fire next one. Enemies may have one of four different armour levels. Each level have a different colour. After bullet hit armour level decrease. If the armour level falls to zero, then enemy is destroyed.

If enemy blinks, each hit create new bonus item on a map.

Enemy types

  • Enemy A A:
    • target: closest player or eagle;
    • speed: normal:
    • behaviour: 80% to move towards the target, 20% to move in random direction,
    • constantly fires in movement direction
  • Enemy B B:
    • target: eagle;
    • speed: 1.3 * normal;
    • behaviour: 50% to move towards the target, 50% to move in random direction,
    • constantly fires in movement direction
  • Enemy C C:
    • target: eagle;
    • speed: normal;
    • behaviour: 50% to move towards the target, 50% to move in random direction,
    • constantly fires in movement direction
  • Enemy D D:
    • target: closest player or eagle;
    • speed: normal;
    • behaviour: 50% to move towards the target, 50% to move in random direction,
    • fires if target is in front of

Bonus items

  • Bonus grenade Grenade: all enemies are destroyed
  • Bonus helmet Helmet: active player shield for 10 seconds
  • Bonus clock Clock: freeze all enemies for 8 seconds
  • Bonus shovel Shovel: create stone wall around eagle for 15 seconds
  • Bonus tank Tank: increase player lives count
  • Bonus star Star: increase player speed, each next one increase max bullets count
  • Bonus gun Gun: same as three starts
  • Bonus boat Boat: allows to move on the water

Levels

Levels are plain text files in that are located in levels directory. Each level is a two dimensional array with 26 rows and 26 columns. Each field in the array should be one of following elements:

  • . Empty field
  • # Brick wall Brick wall: it can be destroyed with two bullets or one if you collect three Stars or Gun
  • @ Stone wall Stone wall: it can be destroyed only if you collect three Stars or Gun bonus
  • % Bush Bush: it can be erased only if you collect three Stars or Gun bonus
  • ~ Water Water: it is natural obstacle unless you collect Boat bonus
  • - Ice Ice: tanks are slipping on it

Build

Linux

Requirements

  • make
  • libsdl2-dev
  • libsdl2-ttf-dev
  • libsdl2-image-dev
  • doxygen-gui - for docs generation (optional)
  • doxygen - for docs generation (optional)

On Debian based systems you can run (apt can by replaced with apt-get or aptitude):

sudo apt install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev

Mac

Requirements

  • make
  • sdl2
  • sdl2_ttf
  • sdl2_image

brew install sdl2 sdl2_ttf sdl2_image

Compilation

In the project directory run:

make clean all

As a result build directory should be created. In build/bin there will be Tanks binary file with all necessary resources files.

The Tanks has to be run from bin directory otherwise you got black screen. Have fun.

cd build/bin && ./Tanks

Documentation in Polish

In the project directory run:

make doc

Windows

Requirements

  • MinGW
  • mingw32-base-bin
  • mingw32-gcc-g++-bin
  • MINGW_HOME environment variable pointing to MinGW directory (eg. C:\MinGW)
  • MinGW bin directory added to Path environment variable (eg. C:\MinGW\bin)
  • GitBash or any similar package providing cp and rm commands

Compilation

In the project directory run GitBash and run:

mingw32-make.exe clean all

As a result build directory should be created. In build/bin there will be Tanks.exe binary file with all necessary resources files. Have fun.

cd build/bin && ./Tanks.exe

tanks's People

Contributors

krystiankaluzny avatar albertofwb avatar atakanhr 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.