Mar 29, 2011 at 7:12 PM
Join Date: May 22, 2008
Location:
Posts: 35
Regrettably, I am a liar, and who would of thought that square tile collision could be so painful...
However, I finally took the code to court and won out, so now all collisions are back to normal, in fact, they are better than normal. I fixed the tile hit then jump problem. It is once again held together through a small for loop that places quote as close as possible to the block as soon as he goes to collide. It sucks, but the math I have been trying to do was so borked that quote would go flying half across the screen in some cases.
Also, scaling. I have the scaling set up correctly now. The screen size was always supposed to be for a 2x2 scale of the graphics, but I had troubles with camera offsets in such cases. Since Pixels code was set up differently I had to experiment with the variables myself to figure things out. If you want... you can set the Game.scale variable to anything you want and the graphics will set up accordingly... although the window size remains constant.
Directions! I added the six possible directions of face for any actor. This means quote can look up and down. And with looking down comes a new collision block I named ledges for lack of knowing the original name. You can look down to fall through them. Also, looking down while on the ground draws differently than looking down in the air!
I didn't put in a sticky block, but if anyone wants to try making a new block class they are welcome! (the Arkiv1 contains the full netbeans distribution)
TL;DR
• Refactored and upgraded collisions
• Arbitrary scale (static window size)
• Player directionality
• Ledge blocks (look down to fall through)
[EDIT]
Almost forgot, it turns out that quote in my simulation is traveling quite farther than he should. I nailed it down to their being no friction in the air... but if I do add friction it over comes the air control.... What value is their for air resistance?
However, I finally took the code to court and won out, so now all collisions are back to normal, in fact, they are better than normal. I fixed the tile hit then jump problem. It is once again held together through a small for loop that places quote as close as possible to the block as soon as he goes to collide. It sucks, but the math I have been trying to do was so borked that quote would go flying half across the screen in some cases.
Also, scaling. I have the scaling set up correctly now. The screen size was always supposed to be for a 2x2 scale of the graphics, but I had troubles with camera offsets in such cases. Since Pixels code was set up differently I had to experiment with the variables myself to figure things out. If you want... you can set the Game.scale variable to anything you want and the graphics will set up accordingly... although the window size remains constant.
Directions! I added the six possible directions of face for any actor. This means quote can look up and down. And with looking down comes a new collision block I named ledges for lack of knowing the original name. You can look down to fall through them. Also, looking down while on the ground draws differently than looking down in the air!
I didn't put in a sticky block, but if anyone wants to try making a new block class they are welcome! (the Arkiv1 contains the full netbeans distribution)
TL;DR
• Refactored and upgraded collisions
• Arbitrary scale (static window size)
• Player directionality
• Ledge blocks (look down to fall through)
[EDIT]
Almost forgot, it turns out that quote in my simulation is traveling quite farther than he should. I nailed it down to their being no friction in the air... but if I do add friction it over comes the air control.... What value is their for air resistance?