Help in spawning another character at the position of the character already on the scene

aimer_s19aimer_s19 Member, PRO Posts: 10
edited February 2016 in Help Wanted

Hey guys I need some help.Cant think of the logic.
I have like 300 same actors placed on the screen and i Want to spawn a new character in place in of one of those actors randomly.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    In the rules for the 300 actors, have each actor store its x and y position in two table cells/columns (increment an integer attribute and use it as the row number).

    Then when you want to spawn another actor, choose a random row (self.randomRow) from the table and spawn at x=tableCell(tableName,self.randomRow,1) and y=col tableCell(tableName,self.randomRow,2) .

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2016

    Here's a demo made in Mac Creator. Click anywhere to spawn a new actor.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • aimer_s19aimer_s19 Member, PRO Posts: 10

    @tatiang Thanks for your help man :)

Sign In or Register to comment.