In my app, I have a background that is the world map and also defines the world coordinate system.
In the example I have attached, there is a car object that has a fixed location (it shouldn't move) when I scroll around the world (vertically only) the car should stay locked relative to the background.
It's close, but there does seem to be some slippage, and by looking at all the variables, it does keep it's world coordinates.
For the life of me, I can't find the culprit. I thought it might have something to do with scaling, but I don't think that is the problem.
I've bastardized the code to make things less complicated, with fewer objects zipping around the screen, and it's forced into scrolling.
Just look at the car move on the grid below it, and you'll see the problem.
The problem is probably in the TICK sub routine in one of two classes, Leroy or Car.
You'll have to place the "streetmap.jpg" in the files folder. Sorry, I had to break it up because of size restrictions.
Any thoughts would be greatly appreciated.
In the example I have attached, there is a car object that has a fixed location (it shouldn't move) when I scroll around the world (vertically only) the car should stay locked relative to the background.
It's close, but there does seem to be some slippage, and by looking at all the variables, it does keep it's world coordinates.
For the life of me, I can't find the culprit. I thought it might have something to do with scaling, but I don't think that is the problem.
I've bastardized the code to make things less complicated, with fewer objects zipping around the screen, and it's forced into scrolling.
Just look at the car move on the grid below it, and you'll see the problem.
The problem is probably in the TICK sub routine in one of two classes, Leroy or Car.
You'll have to place the "streetmap.jpg" in the files folder. Sorry, I had to break it up because of size restrictions.
Any thoughts would be greatly appreciated.