Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Scaling issue

Author
Message
Poof Master
14
Years of Service
User Offline
Joined: 14th Jan 2010
Location:
Posted: 10th Aug 2010 07:13
It's a little hard to explain so I will just post code and explain what is going on.

Here is my character class's constructor:



Now here is the update:



Okay so I call the constructor to make my character and I scale it to the size that I want when I make the constructor like so:



Now I also have a 2d camera which allows me to scale all of my game objects at run time and have there collisions boxes change as well. So here is the problem. If I preset my scale amount before I run the game like this:



so when I do this before the game is running my characters collision box is way off. Now the weird thing is when I preset the scale at 1 before I run the game the collision is fine and then if I scale it while the game is running my characters collision scales just fine. Now everything else in my game scales fine when I initially call scale except my character. Now I have stepped through my constructor and the value for the Checkx and checky are exactly what they need to be and I have even hard coded the numbers in for the collision box. I have no idea how in between my constructor and my update call my collision gets completely screwed up. I would post the actual project but it is big with the libraries that I am using so does anyone know how I can get it up if I need to.

Sorry for the lengthy post and I would appreciate any suggestions cause I am all out.

Login to post a reply

Server time is: 2024-11-19 20:37:13
Your offset time is: 2024-11-19 20:37:13