Tables linked to position

GrapeSodaGamesGrapeSodaGames Member Posts: 93
edited February 2012 in Working with GS (Mac)
Is there a way to link a table to a actors position? I want to make a table telling multiples of the same actor their position on the screen.

Comments

  • MotherHooseMotherHoose Member Posts: 2,456
    tables can't tell any thing … tables store data that you have defined for your game
    game, scene, actors read and change their attributes/actions according to a cellValue the table is storing

    Design/Create your table so that either a row or a col is for only one actor
    I like to use Columns for Actors
    and label the Rows for attributes … (more uniform/easier to enlarge the label area … grey)

    on your Prototype actor:
    add actorAttribute myCol make it text-type
    behavior:
    changeAttribute: self.Position.X To: tableCellValue( game.Table 1 ,"X", self.myCol)

    and in each actorInstance type in the myCol attribute a numberValue: 1, 2, 3, 4, 5 etc.

    if you are spawning these actors:
    add a game.spawnCount index

    and on the spawner:
    after a spawn … changeAttribute: game.spawnCount To: game.spawnCount+1

    on the actor spawned:
    Rule: when
    Attribute: self.Time ≥ 0.001
    changeAttribute: self.myCol To: game.spawnCount

    @};- MH
Sign In or Register to comment.