How do I get the logics to work for this game?

0 favourites
  • 5 posts
From the Asset Store
five golem elements Sprites Sheet.Best for enemy or villain game characters.
  • Hey everyone,

    I am currently trying to design a game where units get spawned on both sides of the map. The AI spawns units from the right and the player spawns units from the left. Units will walk over the battlefield, once they collide they fight.

    The problem I am having is I can't get them to fight correctly. When I get the units to collide they start the "attack" animation and every collision they -1 from the respective HP. When the units stack up they keep a constant collision resulting in the damage not registering and neither unit losing HP.

    I have tried:

    • Every Collision -1 HP
    • Every X Seconds on overlap -1 HP but when they stack they don't drop HP fast enough.

    Is this game type not possible with construct ?

    http://www.sendspace.com/file/84whm0 this is the .capx file.

  • your capx is broken.

    Beside collison, add another condition that only - hp when the attack animation reach certain frame.

    Like frame 4 is the sword going down so can minus hp at that moment.

  • solado

    I'd check not on the "On collision" event, because it "fires" just once.

    I'd use the overlapping event or every x second I'd check if the distance between the two sprites is less than x

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It wouldn't work as the sprites seem to sync up over time.

    I have switched to unity as actually hard coding seems alot easier to work with for games of this nature.

  • i would have done something like,

    on collision set variable to collided uid,

    collided uid exists - play attack animation

    on attack animation finished subtract dmg from enemy with collided uid

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