I was developing a prototype of a top down car racing game and now I need to integrate objects collisions (without box2d because it is too complex). I was using TNT Collision engine and
oBoxToObox function to check collision between car and objects due to the fact the car rotates, but it does not work.
Do you have any lua code to check collision between rectangle rotated?
You can download the source code to check it from here:
https://github.com/jdbcdev/topdown_racing
Comments
Likes: jdbc
I had setAnchorPoint(0.5, 0.5), do you know how to change this code to work with this anchorpoint?
https://deluxepixel.com
It is based on http://appcodingeasy.com/Gideros-Mobile/Gideros-Camera-Move
Performance seems to be good on my BQ Android mobile.
I did that in No Brakes by applying the force based on the rotation of an invisible sprite that had a slight slowness to it. It worked well, and a good substitute for "real" physics in a 0 gravity environment.
Nic
Likes: jdbc, pie
Now I was trying that computer cars follow the right way.
http://natureofcode.com/book/chapter-6-autonomous-agents/
In my case path following algorithm seems to be my solution.
Likes: bali001
Likes: hgvyas123, SinisterSoft, MoKaLux
This is my entrypoint for Avoid Collision:
http://gamedevelopment.tutsplus.com/tutorials/understanding-steering-behaviors-collision-avoidance--gamedev-7777
I have tested with 4 cars and they are colliding at the beginning of the race.
Likes: hgvyas123, SinisterSoft, bali001