Problem with picking objects...

For questions about using Classic.

Post » Sun Mar 20, 2011 10:01 pm

Alrighty, so you might be familiar with ? blocks in Mario games -- you jump up and hit them from the bottom and either an item or a coin comes out. I had to use the Pick closest condition to make sure only the block you hit is activated, and that worked fine.

But then I realized, it still has to work if you're standing between two blocks that are right next to each other and you hit both at the same time. The Pick closest can't work, since that'll only activate one of them by definition, but I don't know what else to do. I reworked it to not use the Pick closest, since I apparently only needed that since I set up the collision condition wrong, but it still won't work for two. They both do the little bounce from being hit, but only one coin comes out of one block.

Here's a screenshot of the two events involved in this:
http://oi53.tinypic.com/54ucd3.jpg

(It occurred to me that it might be creating two coins like it should, but at the same position so that it only LOOKS like there's one, but I confirmed that that's not the case in debug. Only one coin is being created.)

Suggestions?
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Sun Mar 20, 2011 10:08 pm

Add a "for each itembox" condition to event 104.
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Sun Mar 20, 2011 10:11 pm

Wow... that didn't even occur to me. Never used that condition before. :P

Thanks a bunch, works perfectly now.
B
20
S
9
G
6
Posts: 607
Reputation: 6,112


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests