Maybe you can achieve your logic with a big “OR” advanced condition:
Conditions: OR (if true any of)
Player collides with Meteor
Player collides with Enemy
Player collides with EnemyShot
Actions: Red screen
(sub-event) Check if variable life is > 0
Play sound "explosion.wav"
Personnaly, i use an external events to manage a “super class” for my canons (about … 6000 events/actions ?), everything is based on external xml files, values parsing (while loops), and something looking a relational database with unique ID and concatenations. It’s harsh, took me a lot of time, but it works like a group of multiple cascading procedures.
Thank you a lot! It worked like a charm on my prototype.
Well, I have now a little problem : I’m using the “OR” to group the collision between the Hero shoots and the enemies. It worked fast and well, but now I am having trouble (sorry guys, using GDevelop for a few days and still a real noob ) with a little special effect: the X and Y coordinates of every enemy explosion animation sprite.
I’m trying to do something like this:
Conditions: OR (if true any of)
Hero_Shoot collides with Asteroid
Hero_Shoot collides with Enemy01
Hero_Shoot collides with Enemy02
Actions:
Delete Asteroid
Delete Enemy01
Delete Enemy02
Create Enemy_Explosion on the dead enemy X/Y coordinates < Don't know how to do this
Play sound "enemy_boom.wav"
SCORE += 50;
In the future you’ll want to use “Object Groups”, if you create the group “PlayerHit” with the objects “Asteroid”, “Enemy” and “EnemyShot”, you can easily check the collision with this group:
Conditions: Player collides with PlayerHit
Actions: Create explosion, etc.
Delete PlayerHit
If the explosion is different for each object (actually, an asteroid doesn’t “explodes”), you could create an object variable inside each object storing the animation for their explosion, for example the asteroids have the variable “Explosion = 1”. Finally, change the explosion animation to “PlayerHit.Variable(Explosion)” before delete the PlayerHit object
The image used for this animation has a different format?
Do you change the Z-order of the explosion after creating it so it’s rendered over the background and other objects?