Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4596068
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:03:46+00:00 2026-05-21T23:03:46+00:00

Examples of what i’m going to need: I’m using cocos2d to draw a CCTMXTiledMap,

  • 0

Examples of what i’m going to need:
enter image description here
enter image description here

I’m using cocos2d to draw a CCTMXTiledMap, on those tiles i’ll have to draw the LOS triangle.

How would i test if the player is within that triangle, taking obstacles into account?
How would i draw the line of sight area like in the examples above?

BTW, i wasn’t sure if this should have been posted here or on gamedev, don’t be mad.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T23:03:47+00:00Added an answer on May 21, 2026 at 11:03 pm

    You may wish to look at point-in-polygon algorithms such as the ray casting algorithm described here.

    You can break up the triangle to account for obstacles, or just make a more complex polygon. You should be able to find an implementation to suit your needs online.

    You may also want to take a look at this article for some inspiration. You can maintain a tree like structure, a root triangle (or fulcrum) that can be used to determine whether a point is in general line of sight, with the children (triangles) taking obstacles into account. That way you can quickly eliminate more complex checks.

    In the image below the dark blue dots are quickly eliminated from further checking as they do not fall within the root viewing triangle.

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The examples I have seen are geared towards C#. Any tips would be appreciated.
(code examples are python) Lets assume we have a list of percentages that add
I have seen examples of printing from a windows application but I have not
Does anyone have examples of how to use DBMS_APPLICATION_INFO package with JBOSS? We have
Examples of the translations I need to do: $stringDate = November 2009; $output =
The examples I've seen about loading emails over IMAP using python do a search
I need few examples for Unicode SQL queries. Also, i need to understand fully
All the examples of Silverlight using MVVM use interface named IPropertyChanged. What is the
http://examples.oreilly.com/9780735615366/ I actually want to be able to have all these files in my
for examples i have this text: cat car dog... . Impossible that trim function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.