Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualKhatharr

Posted 03 December 2012 - 07:46 PM

Hi, Phil. Posted Image

Edit: Okay, I can see you tried, so I'll help you out some.
  • Hit edit on your first post there.
  • Delete all the code.
  • Copy the code (with formatting) from the original file.
  • In the edit window, place the keyboard cursor where the code you deleted used to be.
  • At the top of the edit window there are two rows of buttons. Press the red button at the end of the second row:
    Posted Image
  • Select your language from the drop-down list.
  • Past your code into the open space.
  • Click 'OK'.
  • Click 'Save Changes'.

Typically I use something like the following for rect vs rect:
[source lang="cpp"]//using Microsoft RECT (left, top, right, bottom)bool rectCollideTest(RECT& thisRect, RECT& thatRect) { if(thisRect.left > thatRect.right) {return false;} if(thisRect.right < thatRect.left) {return false;} if(thisRect.top > thatRect.bottom) {return false;} if(thisRect.bottom < thatRect.top) {return false;} return true;}[/source]

This can also be accelerated slightly if you know which exclusion is most likely and move it to the top. That's not something to worry about unless you're doing more collisions than you should though.

#6Khatharr

Posted 03 December 2012 - 07:38 PM

Hi, Phil. Posted Image

Edit: Okay, I can see you tried, so I'll help you out some.
  • Hit edit on your first post there.
  • Delete all the code.
  • Copy the code (with formatting) from the original file.
  • In the edit window, place the keyboard cursor where the code you deleted used to be.
  • At the top of the edit window there are two rows of buttons. Press the red button at the end of the second row:
    Posted Image
  • Select your language from the drop-down list.
  • Past your code into the open space.
  • Click 'OK'.
  • Click 'Save Changes'.

Typically I use something like the following for rect vs rect:
[source lang="cpp"]//using Microsoft RECT (left, top, right, bottom)bool rectCollideTest(RECT& thisRect, RECT& thatRect) { if(thisRect.left > thatRect.right) {return false;} if(thisRect.right < thatRect.left) {return false;} if(thisRect.top > thatRect.bottom) {return false;} if(thisRect.bottom < thatRect.top) {return false;} return true;}[/source]

This can also be accelerated slightly if you know which exclusion is most likely and move it to the top.

#5Khatharr

Posted 03 December 2012 - 07:38 PM

Hi, Phil. Posted Image

Edit: Okay, I can see you tried, so I'll help you out some.
  • Hit edit on your first post there.
  • Delete all the code.
  • Copy the code (with formatting) from the original file.
  • In the edit window, place the keyboard cursor where the code you deleted used to be.
  • At the top of the edit window there are two rows of buttons. Press the red button at the end of the second row:
    Posted Image
  • Select your language from the drop-down list.
  • Past your code into the open space.
  • Click 'OK'.
  • Click 'Save Changes'.

Typically I use something like the following for rect vs rect:
[source lang="cpp"]//using Microsoft RECT (left, top, right, bottom)bool rectCollideTest(RECT& thisRect, RECT& thatRect) { if(thisRect.left > thatRect.right) {return false;} if(thisRect.right < thatRect.left) {return false;} if(thisRect.top > thatRect.bottom) {return false;} if(thisRect.bottom < thatRect.top) {return false;} return true;}[/source]

This can also be accelerated slightly if you know which exclusion is most likely and move it to the top.

#4Khatharr

Posted 03 December 2012 - 07:37 PM

Hi, Phil. Posted Image

Edit: Okay, I can see you tried, so I'll help you out some.
  • Hit edit on your first post there.
  • Delete all the code.
  • Copy the code (with formatting) from the original file.
  • In the edit window, place the keyboard cursor where the code you deleted used to be.
  • At the top of the edit window there are two rows of buttons. Press the red button at the end of the second row:
    Posted Image
  • Select your language from the drop-down list.
  • Past your code into the open space.
  • Click 'OK'.
  • Click 'Save Changes'.

Typically I use something like the following for rect vs rect:
[source lang="cpp"]//using Microsoft RECT (left, top, right, bottom)bool rectCollideTest(RECT& thisRect, RECT& thatRect) { if(thisRect.left > thatRect.right) {return false;} if(thisRect.right < thatRect.left) {return false;} if(thisRect.top > thatRect.bottom) {return false;} if(thisRect.bottom < thatRect.top) {return false;} return true;}[/source]

#3Khatharr

Posted 03 December 2012 - 07:36 PM

Hi, Phil. Posted Image

Edit: Okay, I can see you tried, so I'll help you out some.
  • Hit edit on your first post there.
  • Delete all the code.
  • Copy the code (with formatting) from the original file.
  • In the edit window, place the keyboard cursor where the code you deleted used to be.
  • At the top of the edit window there are two rows of buttons. Press the red button at the end of the second row:
    Posted Image
  • Select your language from the drop-down list.
  • Past your code into the open space.
  • Click 'OK'.
  • Click 'Save Changes'.

Typically I use something like the following for rect vs rect:
[source lang="cpp"]//using MicroSoft RECT (left, top, right, bottom)bool rectCollideTest(RECT& thisRect, RECT& thatRect) { if(thisRect.left > thatRect.right) {return false;} if(thisRect.right < thatRect.left) {return false;} if(thisRect.top > thatRect.bottom) {return false;} if(thisRect.bottom < thatRect.top) {return false;} return true;}[/source]

#2Khatharr

Posted 03 December 2012 - 07:28 PM

Hi, Phil. Posted Image

Edit: Okay, I can see you tried, so I'll help you out some.
  • Hit edit on your first post there.
  • Delete all the code.
  • Copy the code (with formatting) from the original file.
  • In the edit window, place the keyboard cursor where the code you deleted used to be.
  • At the top of the edit window there are two rows of buttons. Press the red button at the end of the second row:
    Posted Image
  • Select your language from the drop-down list.
  • Past your code into the open space.
  • Click 'OK'.
  • Click 'Save Changes'.

PARTNERS