- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
private function updPos (xpos: int, ypos: int): void
{
	var di: int
	var dj: int
	var tx: int = shadow.x;
	var ty: int = shadow.y;
	var max: int = 15;
	var cmax: int = 0;
	var my: int = ypos;
	if (obj.inf.skew == 0)
	{
		shadow.x = Math.ceil(xpos / 32) * 32;
		shadow.y = Math.ceil(my / 18) * 18
		di = (shadow.x - 30) / 32
		if (di % 2) shadow.y += 9;
		dj = (shadow.y + di * 9 - 251 ) / 18 * 2 + 1;
		cmax = (max + dj / 2 - 1);
		if (di > cmax)			 di = cmax;
		if (di < 0)			 di = 0;
		if (dj < 3) dj = 3;
		lastPoint = GridManager.instance.getPointer([dj, di]);
		shadow.x = lastPoint.x;
		shadow.y = lastPoint.y;
		pos = [];
		pos[0] = dj;
		pos[1] = di;
	}
	else
	{
		shadow.x = Math.ceil(xpos / 32) * 32 - 2;
		shadow.y = Math.ceil(my / 18) * 18 - 2;
		di = (shadow.x - 30) / 32
		if (di % 2) shadow.y += 9;
		dj = (shadow.y + di * 9 - 251 ) / 18 * 2 + 1
		if (dj < 2) dj = 2;
		if (di < 0) di = 0;
		cmax = (max + dj / 2 );
		if (di > cmax)	 di = cmax;
		pos = [];
		pos[0] = dj;
		pos[1] = di;
		lastPoint = GridManager.instance.getPointer([dj, di]);
		shadow.x = lastPoint.x;
		shadow.y = lastPoint.y;
	}
}
                                 
        
Комментарии (1) RSS
Добавить комментарий