Contest Code

  Home arrow Contest Code arrow Corridors map generator

Corridors map generator
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2

    Table of Contents:



    A map generatore for the current corridors contest.

    By : GiantPeach

    5 files...

    mapgen.php - simple form to submit 5 parms to map generator: min room width, max room width, min room length, max room lenght, and number of rooms. All should be integers 1 - 99 (very little error checking, will break if parms are bad).

    showmap.php - main code, creates room objects and steps through map to determine if blocks are within room boundaries. If a block falls in the boundaries of one of the rooms it is marked as a "1". Output from showmap.php is a graphical representation of the map, along with three textareas with the serialized array data, php statements to populate the array, and php statements to populate only the room blocks. In all cases, the first array index is the row (top to bottom) and the second index is the column (left to right). Both are 0 - 99.

    room.php - room class definition for use with above. Constructor picks random "center point" for room, then randomly sizes the room and determines top/bottom/left/right boundaries. The in_room method accepts row, column coordinates and returns true if that cell is within the room's boundaries.

    2 gifs - images for map output


    Click to Download File

    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

    More Contest Code Articles
    More By Codewalkers

    blog comments powered by Disqus


    - Visual Map Editor And Generator
    - Corridors map generator
    - PHP-JAVA Class Code Generator
    - Risk - print_map($game, $some_array_of_size_...
    - Risk: The Original ShowGame/Map
    - Showgame2
    - Risk map output
    - CTF-Judge, better "auto" controls
    - Capture The Flag -- The JUDGE

    Developer Shed Affiliates


    © 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap