Help needed

Hi I could really do with some help! I'm making a game which is a bit like space invaders. I have 3 lines of 12 enemies but am having serious problems with spawning the way I want it too! Say 5 enemies in my line of 12 get destroyed, how can I spawn those 5 enemies back into the position they were in from outside the screen? (Hope that makes sense) Also I know how to make things shoot but how can I make one of my enemies shoot after the enemy in front of it has been destroyed? It wouldn't look right if the enemy was shooting through another enemy. I'm fairly new to all of this and would really appreciate some help. Thanks

Comments

  • KevinCrossKevinCross London, UKMember Posts: 1,894
    From my experience of GameSalad it's hard for one actor to know where another actor is and I've not found a way for one actor to check with a rule if there's a similar actor 50 pixels down from it etc. For that you would have to store the positions of each enemy in a table and do your checks from the table.

    I needed to do a similar thing recently, i.e. check if an actor was in front of another and someone sent me an example where health bars follow an actor (attached). I modified it to attach a collision detecting actor to each enemy (attached).

    If I were to tackle your problem I'd probably do the same again, I'd attach an invisible collision detection actor in front of your enemies. If a collision is detected it won't shoot because it means that there's an alien in front of it, otherwise it would shoot. You could probably do the same thing with the movement, although it might be easier to move your enemies down to fill the empty space, i.e. if no collision is detected and they're in the top or middle row then that would mean there's an empty space in the row below so move them down one.

    You may have to devise a way to fill in the top empty slots.

    Unfortunately I'm not near a copy of GameSalad and won't be until later tonight so that's the best I can do to help. In the collision detection example the detection actors are placed in the centre of the enemies so if you find it useful you'll need to change the positioning to sit at the front/below your enemies.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    you could also use tables, if each enemy was a cell in the table, you could identify if the table cell below the current one was true or false. if true, don't shoot.
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    you could also use tables, if each enemy was a cell in the table, you could identify if the table cell below the current one was true or false. if true, don't shoot.
    Yeah or that! :)

    I do like going around the houses sometimes.
  • MacBruvMacBruv Member Posts: 6
    Really appreciate you've both taken the time to help. Will see what I can achieve. Thankyou :)
  • MacBruvMacBruv Member Posts: 6



    you could also use tables, if each enemy was a cell in the table, you could identify if the table cell below the current one was true or false. if true, don't shoot.
    I cant seem to get my head around tables, would it be possible for a demonstration on how I would achieve this?
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    There are videos on GSHelper check them out. I have one on tables as well.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited September 2013

    Hi @MacBruv

    Hope the other guys have solved your prob. for you...

    One small point: in the future, please make your thread titles more descriptive; "Help Needed" gives no indication at all of your GSC problem/question to those who would try to help you. (And most people posting new threads in the Forums want help anyway, so that goes without saying).

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.