Skip to content

VSathvikReddy/Exploring_Mazes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MAZE TIME!!!!


1. Executing the files

  1. The following comand should help you setup SFML Library which was used for rendering. I had Version: 2.5.1 (latest allowed for ubuntu), but hopefully should work on any newer version.

    make setup
  2. To compile all the files and create the executable

     make

    or

    make compile
  3. To run the game

    ./a.out

    or you wanna look cool 😎

    make run
  4. This command was used by me to merge my png images together, to create the final textures.png, there is no immediate need to understand this.

    make images

2. Controling the window

After executing the program, you'll see the player, blue blob move around. You can,

  • Space Bar to pause
  • Right Arrow to speed up
  • Left Arrow to slowdown.
  • Click the Close (X) Button on the window → closes the window and exits the game, and displays your score.

If the game is completed, the game is automatially paused.


What even is the game.

Run the game for a while, and you can see the blob is in it's starting position and not moving.

  • The blob guys is supposed to explore the maze, encoded in Player.think()
  • There are 4 type of tiles, as in the blobs memory
Color Name Color Number in memory Meaning
Black 0 Uexplored tile
Dark Gray 1 Visited Path
Light Gray 2 Wall
Yellow 3 Goal
  • The blob has a 3X3 vision* around it. It moves according to the function Player.think(), at the start.
  • Once it steps onto the Goal Tile it finds the shortest route (according to it's memory) to the starting point and goes, as per Player.gotoTarget(0,0). (This is how shortest path is calculated of your run)

3. What should you do

script.cpp is the only file I would like you to modify. It has a child class of player, for you to implement and play with,

  • (Due to impatience), both Player.gotoTarget() and Player.Think() are very horriblly implemented
  • So they have been declared as virtual functions (you'll learn more about the later), for you to override in the child class.
  • Learn some nice maze solving algorithms, and implement them in the Think() member function.
  • You may have multiple paths to the goal
$Score = \sqrt{TimeSpent}*ShortestDistanceFound$
  • Even after you discover the goal, the gotoTarget(0,0), activates once you step on it, so you can still explore for other routes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published