Collision between enemies!

v00d0v00d0 Member Posts: 143
edited November -1 in Working with GS (Mac)
Hi guys, ive a problem with my game, my game is pretty easy to understand we have the main actor in the center that don't need to be touched by the enemy that spawn all around, the problem is the i want the enemy that spawn to collide. I tried to put the collision inside each monster but the still go one up the other, any suggest? Thanks a lot and sorry for my crappy english.

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    I'm not sure exactly what you're after, but try this:

    In each enemy, have the rule:

    If collide with main actor
    destroy self.

    That should clear the actor from the screen, if that's what you're after.

    Hope that helps,

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • v00d0v00d0 Member Posts: 143
    no, the problem is that: the enemies spawn => the all huge in one point => all together at the same point.
    i want that they to collide. every 1 second some ads spawn so if they collide they should take position in the space by themself.
  • quantumsheepquantumsheep Member Posts: 8,188
    Right, so you want them to 'queue up'

    This is a little more complex. You could, off the top of my head, try this:

    Make a variable called 'spacing' - have it at 0 to start with.

    In your spawner:
    Every 1 second
    change attribute 'spacing' to 'spacing+10' (I'm using 10 here, but you can play with that figure to get what you want)

    Then, in your spawner, do this:

    Every 1 second
    Spawn enemy at
    Xposition + or - 'spacing'

    So let's say you want your spawn position to be 140

    if you use 'Spawn at 140-'spacing' then your first enemy will spawn at 140, the newt one at 130, the next one at 120 and so on.

    You could put an additional rule that says:

    If spacing is greater than 100, then change spacing to 0

    Which will reset the spacing variable when you get to a difference of 100 from the original x position.

    Hope that makes sense,

    QS :D

    EDIT - alternatively, instead of having 'spacing' increase on a timer, you could increase it when the enemy collides. That might work better for you.

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • v00d0v00d0 Member Posts: 143
    mm i will try this, i thought there was something, to just give to them some space when they reach the spot.
  • v00d0v00d0 Member Posts: 143
    the problem is still here! they still overlaps. i want they to collide...but the collision don't work here :S
Sign In or Register to comment.