A student has a game where there are:
They want to run a few things when one of these items is picked up, score system, animation frames, etc. I've got all that, but I can't figure out how to NOT pick up more than one item! I've tried instance variables, global variables, etc. Part of the complexity is that there are two types of objects, but I'm sure it's not that hard... The students have to use the free version, so I can't use families or any of the paid features.
I would be grateful for any help!!!
Develop games in your browser. Powerful, performant & highly capable.
What logic are you using to pick up the objects? If you're using drag/drop behaviour then this shouldn't be a problem as it will pick one at a time, but maybe you're not using that. Anyway since you're having a problem with it, look into Pick top/bottom condition on the object, you can pick the top object each time so one at a time.
Edit: I just realised that your problem is you want to pick up one 'type' of object at a time. You can still pick types by giving red/blue instance variables type=red and type=blue to distinguish between them. Then you would pick up all with type=red or whatever fits the game.
Sorry, I realised when I read your reply that I described the game badly! The capx is here - I'm hoping you can get to it:
The coloured objects (t-shirts) are being picked up by the player, and I've tried both "on collision with" and "is overlapping". When you collide with the t-shirt the player goes to frame 2 of its animation (which looks like it's holding the t-shirt) and the t-shirt is destroyed. I only want that to happen once, though!
I really appreciate your help, thanks so much!!!
I finally got it worked out!!! Celebrating my lame victory here :)