Collision between enemies!
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
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
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
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.
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
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