Creating a turret that shoot continuous beam at target

0 favourites
  • 7 posts
From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • Hello everyone,

    i hope you're all safe :)

    I'm trying to make a tower defence game,

    and i would like to know if you had any idea on how to make a turret shooting a continuous beam at its target.

    thank you !!!!

  • Turret has target:

    ->target pick by uid turret target.uid; beam set angle to turret angle, beam set width to distance(turret.x,turret.y, target.x,target.y)

    Else: beam set width to 0

    Using a tiled bg with the origin left center at the turrets xy.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello, thank you for your reply.

    I have to admit that i still struggle U_U could you explain ? i'm still new to construct :)

    anyway thank you for your feedback !!

  • that's what i got whit your tips :)

  • I would put the picking and actions on a sub event, but that should work fine.

  • Yeah, but the problem is that the "beam" doesnt reset an re target the enemy that the turret is targeting.

    Its continues to target the first enemy

    ANd also it does not create a laser, it take the one that is already created so if i want a 2nd turret i do nothing ;(

    do you have any help ?

    thanks again !

  • In that case you would destroy the laser in Else part from the first post.

    To create a laser use the "on target acquired" condition.

    There are settings on the turret behavior to pick first in view, or closest.

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