picking objects

This forum is currently in read-only mode.
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • 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.

    situation:

    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!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • having a little trouble understanding what your talking about.

    but..

    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.

  • 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 !

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)