[Solved] -Collision- I can't get it to work!
Posted: Sat Nov 16, 2013 1:23 pm
Hello,
First of all, sorry for another collision question. I searched the forum for help but I could not figure it out. I know how collision detection should work and I wrote my own (messy?) code for (very basic) collision.
I made a huge if-statement for this to work so I could detect the collision, I worked in four steps:
Why doesn't this work? Did I do something wrong?
And if it works, what must the response be? (to not let the player go trough blocks)
The collision code is in the collision.lua and the player code in the player.lua (obvious)
Also note that I am a beginner and the code is somewhat messy, sorry about that.
If you are going to say 'use a library', say one that works with the code I have written because I don't want to start all over again...
Thank you very much, I appreciate your help.
--Ximici
First of all, sorry for another collision question. I searched the forum for help but I could not figure it out. I know how collision detection should work and I wrote my own (messy?) code for (very basic) collision.
I made a huge if-statement for this to work so I could detect the collision, I worked in four steps:
Why doesn't this work? Did I do something wrong?
And if it works, what must the response be? (to not let the player go trough blocks)
The collision code is in the collision.lua and the player code in the player.lua (obvious)
Also note that I am a beginner and the code is somewhat messy, sorry about that.
If you are going to say 'use a library', say one that works with the code I have written because I don't want to start all over again...
Thank you very much, I appreciate your help.
--Ximici