laser creation problem

hi guys i want to be as direct as possible i apologize for spam but it is to let you know. … 226640556/
how can i create a new laser at the passage over the object ?? what kind of code do I have to include? can you create it? thanks for any answers.

it is useless I have been losing as my usual several hours but I could not create anything on my own so i write here.

I think you find everything you need from Gdevelop example/tutorial folder :slight_smile:

Edit. Or follow the turret tutorial:

then maybe I explained wrong with the topic of the post the lasers I’ve been able to create the code that is needed for me is that when the ship passes over an object the main laser is erased and a new one is created.

thank you in advance for your answer.

For one thing, you didn’t explained anything the second, it sounds to me you are asking how to shoot bullets and make them destroyed on collision don’t you?
In that case everything is on the wiki along with tons of examples including such system. Do your home work my friend.
I hope I explained it right :smiling_imp:

If it not what you asking please explain what do you mean by creating a new laser when the ship passes an object :confused:

What’s being asked isn’t very clear, but are you talking about getting a new more powerful laser for your ship when you pass over an “upgrade” object?

You could do that with a variable called something like “laser_type” which is 0 to start and increases by 1 when you collide with an upgrade object. Then your event that checks if the fire button has been pressed should be altered to also check what the value of laser_type is and create the matching laser object.

thanks for your reply @ddabrahim it’s definitely my fault for my english (use the translator) anyway I think we did not understand well.
@MattLB is the one who came closer to my question.

what I intend to create is not a basic laser.

it is not a confusion between a laser but to create a new laser at the passage over a ‘object-boosting’ that eliminates the old laser and creates a more powerful new one or changes the statistics.

how can I do this to create this code?

Now I try to do what you say @MattLB let’s see if I can fix it

no matter if you write all the code to me just a small example as a base and after trying to arrange myself.

thanks for your patience

good evening.

This should give you the idea:

  1. Start a new Native project and choose “shoot-em up”
  2. Go to event 12 and create three sub-events
  3. Move/Copy the actions from event 12 into the three sub-events and alter them as shown below:
  4. Create a new event underneath (which will become a new event 13) as shown in the image.
  5. Preview the game and press the L key to change the laser type.

For your game you will need to change the condition from “L key is pressed” to a collision check between the ship and a power-up object.

thank you very much for your availability