Jump to content
  • 0

Calculate Diagonal Area


Moriarty

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  135
  • Reputation:   13
  • Joined:  06/20/12
  • Last Seen:  

I have a big retangular npc sprite, and I wish to calculate the area it occupies.

Horizontal and Vertical calculation is easy.

Is know it's X area, Y area, position and direction.

I need now to calculate diagonal area, to get all the cells the npc occupies, not sure about the math behind it.
Remembering that npc position 1 and 5 != 3 and 7

 

Thanks

Edited by Moriarty
Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  350
  • Reputation:   43
  • Joined:  09/07/12
  • Last Seen:  

i think big npc's still occupy a single cell.

 

someone please confirm this. thanks /ene

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   337
  • Joined:  10/17/12
  • Last Seen:  

i think big npc's still occupy a single cell.

someone please confirm this. thanks /ene

Yes that's correct its still 1 cell

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  135
  • Reputation:   13
  • Joined:  06/20/12
  • Last Seen:  

I mean the space the sprite occupies... derp

anyway, Tokei helped me already thru Discord :P
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...