Axis Aligned Sliding Box & Circle collision

Monkey Forums/Monkey Code/Axis Aligned Sliding Box & Circle collision

NoOdle(Posted 2011) [#1]
This was my first Monkey code to get used to the language. It requires arrow keys to move the ball around. You should see a white T and a O to collide with, and the player is represented by a red circle with a line indicating direction. Enjoy :)




slenkar(Posted 2011) [#2]
thanks this is cool


therevills(Posted 2011) [#3]
For some reason when I run your code in HTML5 I get "Null object access" and in Flash I get "Rendering operations can only be performed inside OnRender", but I cant see whats wrong with your code (I've only just got up ;)

I copied your classes and added the calls to my monkey_stub and it works:



Very nice BTW! :)


NoOdle(Posted 2011) [#4]
Thanks, at the moment the box collision acts as box to box, the answer would be to add the circle response to the corners, easy enough to do.

Hopefully this will be useful to everyone :)


Rus(Posted 2011) [#5]
Nice stuff NoOdle! BTW, for anyone else having trouble getting this to run, the line:

Import Mojo


should be:

Import mojo


No biggie!


NoOdle(Posted 2012) [#6]
oops my bad.