Jump to content

  • Log In with Google      Sign In   
  • Create Account


P0jahn

Member Since 21 Nov 2012
Offline Last Active May 07 2014 02:35 AM
-----

Posts I've Made

In Topic: Rotate at a point

13 April 2014 - 06:59 AM

Thank you very much. Works perfect smile.png

 

The lasers middle is also at the target coordinate, which is a desired effect :)


In Topic: Rotate at a point

11 April 2014 - 10:39 AM

Your laser is a single image? 

Its actually two images. The first part is at the beginning, the part that grows. I did not include that in the post because I dont want to show unnecessary code.

I am also going to remove it.

 

Does it spin from the center of one side or from the top-left corner?

Do you mean what point it rotates around? Since origin X and Y is 0, it should be the top-left corner.

Here is a youtube video I just made that should explain it better: 

(Note that the black dot is srcX srcY point.

http://youtu.be/wsZdjFs9iKc

 

If that's the case, I think that you're making the rotation right (there's nothing wrong with the code you posted), but you're drawing the laser wrong. You might want to translate the image so that the center of the origin side is at (originX,originY) position.

If I understand you correctly, I should set originY to the laser height / 2?

 

Also, I think you might want to point to the center of the meat boy instead of the corner, it makes things easier. Well, generally, it makes it easier to work with the center of things, and even more when rotations are involved.

Absolutely. I am only doing this for debugging.


In Topic: Get position of rotated rectangle

08 April 2014 - 04:11 AM

Thanks. I will try all this as soon as I get home.


In Topic: Getting a direction constant from normalized vector

18 March 2014 - 02:59 PM

Thanks all. C0lumbos code works fine and is most likely the fastest and have highest readability. 

 

My math skills are very limited so I do not understand many terms and such used here, but I trying :)


In Topic: Finding wall point

11 November 2013 - 04:38 AM

Using all integers works fine, no floats required. But it did not increase the speed of the function at all. Mather fact, the function is actually fast, taking about 10000-15000 ns to complete.

I thought it was lagging but the issue was not in that function. Thanks for all the help anyway!


PARTNERS