Multiple hit points with multiple spawning actors

reddotincreddotinc Member Posts: 653
edited November -1 in Working with GS (Mac)
I have just had a look at TSB's tutorial: http://gamesalad.com/wiki/how_tos:gsc_how_to_have_more_then_one_hit_points# , and whilst that is great, I'm trying to work out how I could use this when I have more than one enemy on the screen at any one time.

There are sometimes two of a specific type of enemy on the scene, and obviously I can't set this in the actor's rules as the two would conflict.

Any idea how I would be able to constrain the x,y of multiple actors to allow this to work for me?

Thanks

Comments

  • jmp909jmp909 Member Posts: 73
    this might help...i think it will work.. but only for 2 actors like you asked... (but you can see how you might modify it for more)

    scene:
    game.enemy_id=1;

    enemy actor:
    self.id = game.enemy_id
    game.enemy_id = game.enemy_id+1
    if(game.enemy_id > 2 ) game.enemy_id=1

    if(self.id=1)
    enemy1X=self.Position.X
    enemy1Y=self.Position.Y

    if(self.id=2)
    enemy2X=self.Position.X,
    enemy2Y=self.Position.Y
  • reddotincreddotinc Member Posts: 653
    Hmm ok I might look into that.. I might need a way to make it a little less limited though.

    Anyone else have any ideas?
  • jmp909jmp909 Member Posts: 73
    yes, wait till GS has arrays :)
Sign In or Register to comment.