Advice for movement of an actor on a boardgame style map

jasdipjasdip Member, PRO Posts: 7
edited August 2012 in Working with GS (Mac)
Hi,

I have a project which I am looking at undertaking with GS, however, before I get to heavily invested in it I want to try and address a function that I would like to appear in the game but I am unsure as to the best way to execute it or whether it can be achieved efficiently.

I am looking at creating a board game style ipad game which hasa a map that is split into areas, all up there are about 60 or so areas. 
An actor will move around a map, the actor will be restricted to 2 movement points per turn, which basically means that the actor can only move up to 2 areas per turn, the areas the actor will be able to move to will need to be adjacent to the area that actor is in at the time.

What I would like to achieve is to highlight the map areas the actor can move to firstly if he has two movement points available and then secondly if he has 1 movement point available.

My initial thoughts were to have each map area as an individual actor, then allocate each actor a self attribute giving a unique id.
I was then going to store each id in a table along with the ids that are also adjacent to it, therefore, for each area you may have between 5-8 records in a table, approximately 250-300 records all up.  This would at least enable me to identify related adjacent map areas.

Then I wanted to look at how I best use the stored data in the table, this is where I have come a little unstuck, any advice on what I am trying to achieve and how I should achieve it would be appreciated.
 
regards
 
Jason

Comments

  • simo103simo103 Member, PRO Posts: 1,331
    @jasdip .... you could use magnitude I would think. This measures the actors distance from other things. (Not sure if your 'areas' are equal in size though or if there is sufficient difference in the distance to say 3 areas than all of the 2 areas).
  • MotherHooseMotherHoose Member Posts: 2,456
    edited August 2012
    @jasdip

    believe you may be making this type of play more difficult than need be

    Example:
    what values does game have to store for activating the actors behaviors?
    … where the player is:  gameAttributes: playerX and playerY
    … where the player has selected to move: gameAttributes: moveX and moveY
    … is the selectedMove within the range: gameAttribute: moveRange
    … when to do a move: gameAttribute: move?

    ===
    on playerPieceActor:
    -constrainAttributes: game for playerX/Y to self.Position.X/Y

    Rule: when
    Attribute: game.Move?
    -changeAttributes: self.Position.X/Y To: moveX/Y
    -changeAttribute: game.Move? To: false

    ===
    on tile actors that are blank … i.e. can accept playerMove
    Rules: when
    Event: touch is pressed
    Attribute: game.moveRange ≥ magnitude(game.moveX-self.Position.X,gameY stuff )
    -changeAttributes: game.moveX/Y To: self.Positions.X/Y
    -changeAttribute: game.move? To: true

    ===
    think of: when action should occur … and what those actions should be

    image MH
  • jasdipjasdip Member, PRO Posts: 7
    Thanks to both simo103 and MotherHoose, much appreciated for your feedback. As you both mentioned I think with the use of magnitude and maybe a little bit of map manipulation I should be able to get things to work. Thanks again.

Sign In or Register to comment.