Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2011

    Unanswered: Help me implement this please

    Hi guys, im trying to implement something in my database but i cant figure it out.

    Let me explain the scenario. Im building a game, and the map of the game is composed of a lot of different squares, forming a grid. So each node can either link to:

    Another map
    A location
    Nothing (ie. just an image)

    Here is an image of the diagram:

    Now the hard part. Im trying to make it so if the linktype is a map, it links it to the map table. If its a location, it links it to the locations table.

    I want to this so in the GUI, if the user selected linkType as location from the dropbox, another drop box shows all the locations available to select from.


  2. #2
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    First of all, most gamers that I know are accustomed to using hexes rather than squares for map cells. You probably want to rethink how you are representing your map surface in the database if your gamers think the way that mine do.

    If a map cell can link to another map, you probably need to consider just how your gaming system will deal with the transition. It is possible to have the app track a player's locations on multiple maps, but this isn't for new app designers.

    Getting the different types of cells to point to different kinds of filler (location, picture, or another map) is pretty easy... Just derive all of the container types from a common supertype (using the primary key from the supertype as part or all of the primary key of the subtype), then store only a foreign key to the supertype in your map.

    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Jun 2011
    Im not making a conventional game, thats why im using boxes

    I ended up doing it in a similar way as you mentioned, thanks!

Posting Permissions

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