dop2000's Forum Posts

  • Vonca

    Create an instance variable shotCounter.

    After each shot add 1 to shotCounter.

    If shotCounter<3, start short timer to fire another shot.

    If shotCounter=3, start a longer ("cooldown") timer.

    On "cooldown" timer reset shotCounter to 0 and you can shoot again.

    Note that it doesn't take into account LoS.

    You might want to add another instance variable - EnemyUID to the turret.

    When an enemy is in LoS, save enemy.UID to this variable.

    Then fire 3 bullets at that enemy (every time picking it by EnemyUID).

    After the "cooldown" timer check LoS again and repeat.

  • NetOne

    Yes, this is one of the main features of containers - when you pick one object, other objects from the container are picked automatically.

  • Thanks!

  • It's better to use Timer behavior. You can run different timers for each turret instance, pause/cancel timers if needed etc.

    Restart the timer after each shot. After 3 shots start a longer timer.

  • Probably not a bug.. I think what happens is the first "Is overlapping" condition picks instances of Team1 object. So the remaining System conditions in this event are comparing X for picked instances only. If "Is overlapping" picked 0 instances, then the rest of OR block has nothing to compare.

    If you change the event like this, it works:

    That being said, there are problems with OR-blocks in C2.

    See this comment from Ashley:

  • I didn't know how you wanted to arrange your soldiers.

    If you want a grid with 10 soldiers in each row, you can do this:

    variable posX

    variable posY

    System For Each Soldier (order by Soldier.attackDamage) descending

    ....Set posX to (loopindex%10)*70

    ....Set posY to int(loopindex/10)*70

    ....Soldier set position to (X= 50+posX, Y=50 +posY)

    Or you can put invisible "placeholder" sprites to where you want to place your soldiers. And then set position to (X=placeholderSprite(loopindex).x, Y=placeholderSprite(loopindex).y)

  • When you are comparing the angle of EnemyMovement, you are doing it for just one instance of this sprite, not for each instance "linked" to the Enemy. That's why all enemies are set to the same animation.

    You need to add Enemy and EnemyMovement objects to the same container, and remove "Spawn EnemyMovement" action.

    Also, you can pin them together, instead of setting position on every tick.

  • "System" object.

    In the event sheet click "Add event" -> click System -> select For each (ordered)

  • Create a parent event "Platform is on the floor" and move events 5-8 to it as sub-events.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No problem!

    Where did you see that I changed the default animation to dash? I didn't.

  • Try Bullet behavior + Sine behavior (with vertical movement)

  • You are simulating controls only when the speed is <200

    Change your events like this:

  • There is nothing wrong with the code.

    Could you share your capx?

  • Make sure that all frames in the running/dashing animations are the same size and the Origin image point is in the same position in all frames.

    There is a common trick that helps to avoid issues like that:

    Create an invisible rectangular sprite with Platform behavior. This will be your main "character" sprite, controlled by the player.

    Remove Platform behavior from your sonic sprite and pin it to the invisible character sprite, like a "skin".

    This way animations on the sonic sprite will not interfere with platform movements.

  • Baddies|On detroyed
       System|Compare two values (random(100)<30)     ->    Baddies|Spawn Goodies [/code:l8xdlyad]