Skip to content

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

Notifications You must be signed in to change notification settings

rapythereaper/capture_the_falg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published