PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Flash5 game map borders
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: game map borders

  1. #1
    Junior Member
    Join Date
    May 2010
    Posts
    26

    Unhappy game map borders

    Hey, im trying to make a very simple explore rpg game like this one

    http://www.kongregate.com/games/Atel.../micro-dungeon

    so far i only made my character movement
    i cant seem to make/find any efficient codes that will make my character unable to walk over walls

    i have tryed a couple of simple things but it does not work that efficient
    there is probably a very easy way to do it, but i cant find any online

    any tips? thx in advance

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Post the code you wrote for the movement
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  3. #3
    Senior Member guardiankitty's Avatar
    Join Date
    Dec 2006
    Location
    Here
    Posts
    215
    So you have your map in [x][y] 'cells'. If going from one cell to the next, check if the 'to' cell has .isWall property.

    Actionscript Code:
    function Move(x:int, y:int):boolean{
    if (cells[x][y].isWall) {
        //play thud
        //display message- derp you cant walk through that
        //etc.
        return true;
    }else{
        //set current location to the 'to' cell.
        return false;
    }
    }


    I dont think that gets any simpler and efficient than that. (generally speaking) call the above when the 'arrow is clicked' or when 'a key is pressed'. It all depends how you have your cells layed out (I recommend a multi-array like the above).

    Hope that helps, post code for more help.
    -GK>.-.<

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center