Hello, I’d like to know if anyone can help me: I want to recreate the mechanic where Mario lands on a Goomba, stuns it, picks it up, and then throws it at others. I’ve managed to do it with one, but if I put several Goombas together and stun them, when I pick one up and throw it, the others move as one. I’m including my code for you to analyze, or if anyone has already implemented this mechanic in a different way, I would greatly appreciate it if you could show me how. Thank you.
I’d like to help, but I can’t read Spanish and have real trouble working out what each event is doing. Could you change language to English just for the screen shot?
Hi, I’d like to know if anyone can help me: I want to recreate the mechanic where Mario lands on a Goomba, stuns it, picks it up, and then throws it at others. I’ve managed to do it with one, but if I group several Goombas together and stun them, when I pick one up and throw it, the others move as one. I’ve included my code for you to analyze, or if anyone has already implemented this mechanic in another way, I would greatly appreciate it if you could show me how. Thanks.
I think the fix is quite simple. This event:
selects all the goombas you have collected. You just need to select one of them and the simplest way to do that is to add the condition 'Pick a random GOOMBA_PROYECTIL' to that event.
You’ll also need to change the '"q" key is pressed' to ‘“q” key was just pressed’` otherwise they still all get thrown, one after the other.
Greetings, thanks for the help: It works up to a point. I can grab one Goomba and throw it, but when I try to grab another, I can’t.
As in you can’t throw it, or you can’t grab it?
If you can’t grab it, it may be because in this event you set cambiar to 0 and tortugaEnMano to 1:

and those variable values meet the conditions for this event, which will run straight after in th next game frame:

A possible solution is to make each of those '"q" key is pressed conditions to ""q" key was just pressed'.
BTW, this is not good practice and has a mistake:

The game will continuously process the repeat when there are goomba_proyectil objects in the scene. You should have the At the beginning of the scene as a separate event, and have the Repeat for each goomba_proyectil as a sub-event of it.
The action should be Change the value of Contador_IDADD1. Otherwise all the initial goomba_proyectil objects have the same id.



