Code Monkey home page Code Monkey logo

capture_the_falg's Introduction

Capture The Flag

A simple maze navigating game that is played by writing c code.

The project is build using olcPixelGameEngine. Make sure you have it install before proceding.

Map Editor

map editor

Build

./map_editor.sh #builds map editor form source code
./map_editor # run map editor

Map editor gives a gui interface for creating and saving map for the game. Menu are navigated with "w" "s" "ENTER" keys. "A" and " S" are used to switch between blocks in map editor. Use left click to place the block and right click to remove the block and "ctrl+s" is used for saving the map.

Game

Game is played by writing the play.cpp file, The boiler plate code looks something like :

#define Level 0
void play(){
 //code goes here
}

Level denotes the level you are playing the game for. Think of it like selecting a level . The movement of player is controlled with in the play function. User have 5 function to controll the Player movement.

void move_left(); //moves player along left
void move_rigt(); //moves player along lright
void move_up();   // move player upward
void move_down();   // move player along downward
void collect_flag(); //collect the flag 

The game is simple where wrriten code inside play() function governs the game play. The objectice of the game is to capture the flag by moving on the grass are. If the player moves outside the grass or executes collect_flag in wrong position, this would result in play loosing the game.

Running The Game:

Once the user writes the code use the folloing command to execte the gameplay.

./play.sh

Example

play.cpp

#define Level 0
int i=0;
void play(){
  move_left();
  i++;
  if(i==7){
   collect_flag();
  }
}

game_play

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

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.