Quote:
|
Originally Posted by SSS
Having another problem, since Im not good with math.
[...]
showimg 201,@@@Me,this.x+playerx/420,this.y+playery/420;
changeimgvis 201,4;
|
Math lesson
We have three numbers, a b c and d
(makes more sense for b and c to be vectors and a be a position on b and we are looking for the corresponding position, d, on b, but I doubt you have that kind of math knowledge :/ ) where 0<=a<=b and 0<=d<=c and we want to find d so that a/b = d/c. We work out the expression;
a/b = d/c
(a/b)*c = d
d = (a/b)*c
assuming that this.x and this.y are the map x and y;
we know 420 is the width and height of map image, and 960 is the width and height of the actual map in tiles, therefore using the above expression, a is playerx or y, b = 960, c = 420 and d is the x or y of the position on the map image. You can do the rest, if you can't I will personally beat you with a stick
