C++ Maze Game - Allegro

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
2,630
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Dec 10, 2008

WIP game in development for a Uni class. Uses C++ and Allegro library. AI needs work and collision detection needs a bit of tweaking.

Sorry about the bad camera, Camtasia slows down the game process when I try to record.

Category:

Science & Technology

Tags:

License:

Standard YouTube License

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (limited06)

  • thanks for commenting.. nice mini game this one.. how did you go about with collision detection?? did you do that by comparing the pointers of each objects??? eg.. if wall pointer is == player pointer, then collide??

  • I store the maze in a vector of strings, Therefore is split into rows and columns, I then have a function that takes the players location and divides by the block size, that gets me the row and column location of where the player is within the maze, I can then just do simple if statements checking the surrounding spaces to see if they are walls.

  • @limited06

    One question:

    You get the tile position by didviding the Position of Player with the block size

    Example:

    Block Size: 32px

    PlayerX: 64

    64/32=2;

    So in this example the tilepos will be 2?

  • Yes thats right, you do it for both the X and Y so you can work out which grid space the player is on.

see all

All Comments (4)

Sign In or Sign Up now to post a comment!
  • hehe nice monster inteligence, monster.dir.x=Hero.pos.x-monst­er.pos.x;

    monster.dir.y=Hero.pos.y-monst­er.pos.y;

    ;)

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more