TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
FORUMS
CHAT
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
How to make good turret AI?
Pages:
1
How to make good turret AI?
lucario888
Posts: 38
November 16, 2016, 05:58:02 pm
So, in a top-down shooter, what can be the decent way to code a turret? I tried to make a radar-type thing with a line rotating over that turret .When that line collides with a player, the turret will shoot there, but then the turret will shoot the walls if the player is detected on the other side of the wall. Any way to prevent this?
Thanks,
Me
Hectate
Posts: 4643
November 17, 2016, 05:54:00 am
You could use the raycasting extension to test if there is an obstacle in the way of the turret > player line and disregard the player detection if so.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.
Pages:
1