two overlap questions

For questions about using Classic.

Post » Mon Jan 12, 2009 8:40 pm

Hi, I have two questions about the overlapping sprite condition:

1: How do I make it so that it registers as overlapping when the player is only overlapping the box of the sprite, but not the actual sprite? Is this possible without making a detector?

2: Is there a way to make the game only register one sprite being overlapped by the player? For example, if there are two sprites next to eachother, and the player's box is stretched over both of them, then the one with the most pixels over it will be the one that is overlapped?
B
3
S
1
G
3
Posts: 105
Reputation: 1,312

Post » Mon Jan 12, 2009 8:48 pm

1: You can try setting the sprite's collisions mode to 'Bounding box' instead of 'Per pixel'.

2: No, there's no built in way to do this. What are you trying to achieve?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Jan 13, 2009 12:16 am

[quote="Ashley":3vto3xs3]2: No, there's no built in way to do this. What are you trying to achieve?[/quote:3vto3xs3]

I'm making a game where you can pick up items off the ground, but I don't want the player to be able to pick up two items at once.
B
3
S
1
G
3
Posts: 105
Reputation: 1,312

Post » Tue Jan 13, 2009 12:32 am

If that's all you need maybe just throw in a 'pick a random' condition.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Wed Jan 14, 2009 2:43 pm

Maybe you can add a timer that ticks down after the player picks up an object. If he's overlapping another object he picks it up as soon as the timer ticks down.

I would think that whichever object he collides with first will be the object that he picks up first. I mean I think that however you coded it this is probably what will happen and that's probably how you want it. So I'm not sure if a pick random is necessary.
B
3
S
2
G
4
Posts: 271
Reputation: 2,017


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest