picking objects

For questions about using Classic.

Post » Sun Sep 30, 2012 1:05 am

hi and first of all, sorry for im about to ask a really noobish question, but i cant seem to find my way around this obstacle.

player sprite. ground sprite. effect sprite.

player sprite overlaps ground sprite.
--ground sprite spawns one effect sprite.

player sprite does not overlap ground sprite, the effect sprite that was spawned gets destroyed.

now, the object picking. how to make it so that it doesnt destroy ALL those spawned effect sprites, but only the one that was spawned on a ground sprite that just stopped overlapping the player sprite?
i tried for each condition (and trigger once), but somehow i managed to make an infinite loop where the effect sprite kept spawning, thus quickly jamming the whole game.

to say it simply, imagine the player running through piano keys.every key is that ground sprite and something happens only once when player overlaps it.

i know this is amateur stuff, but i just got so confused with object picking and now i cant think straight.
thanks for reading!
Posts: 12
Reputation: 399

Post » Sun Sep 30, 2012 6:17 am

having a little trouble understanding what your talking about.
a variable assigned to the ground of (0)
then a condition of if player over ground set to 1

if ground =1 and player not overlapping add 1

if ground = 2 (maybe have the effect sprite as a part of a container of the ground?) destroy effect.

Bartosh2012-09-30 06:17:45
Posts: 249
Reputation: 2,323

Post » Sun Sep 30, 2012 9:51 am

Hi !
I'm not sure to understand too, but you can add a subevent (after player sprite does not overlap ground sprite) like : effect sprite : pick closest from (ground.X; ground.Y) but I don't think it can be good in your case.

Else, you can try as a subevent (after player sprite does not overlap ground sprite) : effect sprite overlaps ground sprite. That'll pick that effect sprite.

Hope i'm right, and hope you'll find a solution !
Posts: 31
Reputation: 1,006

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests