zereflalata's Forum Posts

  • 7 posts
  • You can have random 'reload' and firing times by doing this:

    Add the Timer behavior to your villains (enemies)

    On start of Layout:

    ---> Enemy: Start Timer "fire" for random(1,3) (regular)

    On Timer "fire":

    ---> System: Create object "bullet" on layer 0 at (enemy.X, enemy.Y)

    This will make them shoot a bullet every 1 to 3 seconds.

    I hope this helps!

    I re read your comment! iunderstand now its working! thanks

  • You can also make a condition like this:

    - Every [random(0.5,2)] seconds
    - For each Villain
              --> Shoot bullet[/code:2xo7drz1]
    
    This will fire each Villain's gun at random times.
    The "for each" causes a random time to be created for every instance of a villain again.
    
    If you want every villain to shoot exactly every 2 second, but at different times,
    choose this:
    [code:2xo7drz1]- Every 2 seconds
    - For each Villain
            --> Wait [random(0.5,2)] seconds
            --> Shoot bullet[/code:2xo7drz1]
    

    is

    Every [random(0.5,2)] seconds[/code:2xo7drz1] an event with blank action and [code:2xo7drz1]For each Villain[/code:2xo7drz1] an event with [code:2xo7drz1] Shoot bullet [/code:2xo7drz1]  action
  • You can have random 'reload' and firing times by doing this:

    Add the Timer behavior to your villains (enemies)

    On start of Layout:

    ---> Enemy: Start Timer "fire" for random(1,3) (regular)

    On Timer "fire":

    ---> System: Create object "bullet" on layer 0 at (enemy.X, enemy.Y)

    This will make them shoot a bullet every 1 to 3 seconds.

    I hope this helps!

    -> set object time scale?

    • How to set timer?
  • i have a bullet(just a single sprite) used by many villains shoooting my player. now, in my condition they fire up in every 2 seconds(so all the villains shoot bullet same time). now, how do i make the bullet of each villain fire in random? im thinking about using different bullet sprite for every viillain so i can control how much time they should fire per x second in random

  • You can use the distance() system expression. Just compare the distance from the player to the bullets with your range and if the distance is greater than the range destroy it.

    For example:

    Compare 2 values: distance(player.X, player.Y, bullet.X, bullet.Y) > 200 <--- Your range in pixels

    ----> bullet: Destroy

    You could also use the fade behavior to destroy the bullet after a certain amount of time.

    I hope this helps!

    <h1>Gonna Try. Thankie! </h1>

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • willi just put an invisible object (in the "specific range") and make a condition where it disappears when the bullet collides with it? any suggestion guys

  • is it possible for the monster/enemy to shoot the player every 1 second? how? help me pls

  • 7 posts