[TIP] A Way To Create A Grid Based Game

netdzynrnetdzynr Member Posts: 296
edited November -1 in Working with GS (Mac)
Ever think about creating a Battleship or Score Four type game with GameSalad? The template posted here might help: http://gamesalad.com/game/play/79432

The project dynamically tracks occupied slots of a grid, with no need to "hard code" the slot numbers or available positions. You provide some of the basic positioning attributes, and the template takes care of the rest. You can then test an attribute attribute to see if a grid slot is occupied or available. Neat feature: pieces can be removed at will, and the template will track which ones (can't say if this feature will perform well on a grid with hundreds of pieces though...).

Hope this is useful.

Comments

  • JackBQuickJackBQuick Member Posts: 524
    This works like a charm -- thanks, netdzynr!
  • netdzynrnetdzynr Member Posts: 296
    You're welcome -- hope it's useful.

    Just updated the project to fix a small bug that misreported the Y grid coordinate. Should be working correctly now.
  • VoidedSkyVoidedSky Member Posts: 1,095
    Cool Demo!
  • netdzynrnetdzynr Member Posts: 296
    It turns out the grid technique used in previously posted projects worked well on a computer, but not a mobile device (required 2 clicks to work). So this update simplifies piece management and seems to make it more reliable. Sorry for the repeated posts -- hopefully the 3rd time's a charm.
    (Again, using this technique you can use a single actor for your grid, and track all occupied slots in one attribute, instead of using separate grid tiles and multiple attributes.)

    http://gamesalad.com/game/play/79432
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Awesome!
  • keekee312keekee312 Member Posts: 91
    Il would be nice to allow to move pieces
  • ORBZORBZ Member Posts: 1,304
    nice :)
  • netdzynrnetdzynr Member Posts: 296
    @keekee -- Maybe you want something like FMG's Dragging/Snapping demo:

    http://gamesalad.com/game/play/30842
  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    @netdzynr, Did you take this down or was it lost in the latest site refresh?
  • magic101himagic101hi Member Posts: 713
  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    Thanks magic101hi.

    Hmm. Not what I thought it was.
  • SnowAppleMintSnowAppleMint Member Posts: 23
    hmm....let me know if anyone else notices the same possible issue. When you click the center of the square the red dot appears and so do the coordinates on the 'Used Slots' side bar. When you click on the edge of the square the coordinate gets added to the list for each click.
    So for example I clicked on the edge of 4,1 5 times, so 4,1 appeared on the 'Used Slots' 5 times.

    strange, no?
Sign In or Register to comment.