How do I a game with multiple instances independently?

0 favourites
  • 2 posts
From the Asset Store
20 high quality click sounds, ready to improve your game's UI instantly
  • Im developing a game based of war with gangs, top view based.

    The instances are:

    * cops: controled by IA. Moves in randomic direction over a map of a caotic street.

    * gangster: moves in randomic direction. Shot controled by player.

    * Molotov: bomb fired by gangster.

    * Pathfire: instance (bullet) with a image of molotov moving.

    Engine:

    When the gangster animation with 60 frames reaches #50 frame pin a molotov in the hand of gangster and set a variable to molotv with the same id (variable id) of gangster. The engine controls to loop for last position to #51 position to avoid create multiples molotovs to same gangster.

    When clicked first time the gangster stop and turn to mouse position (target).

    When clicked the second time spawn a pathfire (bullet) from gangster to hit the cop + destroy the molotv in the hand of ganster

    .

    Here is the trouble: When i destroy the molotov instance from a gangster ... all the molotovs in the scene, from other gangsters are destroyd.

    I would like to destroy only the molotov in the hand of gangster that fired.

    action - gangster clicked > spawn a pathfire to (moouse.x,mouser.y)

    | > set animation frame to 1 ans start again

    |

    ------- molov.id = gangster.id > destroy molotv

    Its not working. (Sorry my bad english)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try using the pick event, not sure..Pick by evaluate, or pick by comparison, and check if it equals gangster.id, this way you only pick the correct molotov

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