Nac, there are SO many mistakes in that code that I do not know where to begin.
Oh wait, yes I do.
ELSE. USE THE f*** ELSE HANDLER!
Everywhere, you messed that up. Every single code.
Next is this little gem right here:
First off, you mean &&, not AND. Second, you need to test them to see if they are true. The correct code here, and in all other instances is:
Third, you're overcomplicating it by separating it out into variables. Just say this:
Next, that's not even close to how to handle a Z collision, unless your objects happen to be sheets of paper, conveniently facing the viewer. I don't have the time to rewrite your code so that it isn't retarded.
_________________Style [Stayl] (n) - One's unique and personal method of defacing a perfectly good piece of paper.
READ THIS:
http://ipgd.freehostia.com/copypasta.html