- Tilemap problems (ICE)
- 04 Aug 2018 10:07:53 pm
- Last edited by beckadamtheinventor on 06 Aug 2018 04:02:17 pm; edited 1 time in total
I have been having a really frusterating problem with tilemaps recently, where the player/cursor position is incremented differently than where in the tilemap is being displayed.
What I need is a tilemap in which the player/cursor moves at the same speed as the displayed tiles.
I have attempted to correct the issue by using another variable which is incremented/decremented whenever the tilemap moves, but that does not seem to work.
Help would be much appreciated.
Screenshot
Code:
EDIT: made my own renderer for now.
What I need is a tilemap in which the player/cursor moves at the same speed as the displayed tiles.
I have attempted to correct the issue by using another variable which is incremented/decremented whenever the tilemap moves, but that does not seem to work.
Help would be much appreciated.
Screenshot
Code:
Lbl TILEMAP
ZeroScreen
0->ALLOWZERO
*{FILEPTR->SS
{FILEPTR+1->NS
{TILEMAP->MAPD
{TILEMAP+3->SPTRS
*{TILEMAP+12->TMYM
*{TILEMAP+13->TMXM
*{TILEMAP+9->CCMX/2->CCX
*{TILEMAP+8->CCMY/2->CCY
While 1
det(49,TILEMAP,SS*TMCX,SS*TMCY
SetColor(255
Rectangle(SS*TMCX,SS*TMCX,SS,SS
*{FILEPTR->A
Rectangle(0,209-A,A+2,A+2
Rectangle(A+1,209-A,A+2,A+2
Sprite({SPTRS+TILIX*3},1,210-A
*{MAPD+TMXM*TMCY+TMCX->V
Sprite({SPTRS+V*3},A+2,210-A
SetColor(0
FillRectangle(180,201,140,18
SetTextXY(180,201
PrintString("tile index:
PrintInt(TILIX,3
SetTextXY(180,210
PrintString("map value:
PrintInt(V,3
SetColor(255
HorizLine(0,220,320
PrintStringXY("get",1,221
PrintStringXY("tile-",210,221
PrintStringXY("tile+",270,221
Call K
If K=15 or K=55
Goto TILESET
End
min(TMXM,~1+max(1,1+TMCX+(K=3)-(K=2->TMCX
min(TMYM,~1+max(1,1+TMCY+(K=1)-(K=4->TMCY
If K=54 or K=9
TILIX->*{MAPD+TMXM*TMCY+TMCX
End
If K=48 or K=53
*{MAPD+TMXM*TMCY+TMCX->TILIX
End
TILIX+(K=49)-(K=50->TILIX
If TILIX=NS
0->TILIX
End
If TILIX=~1
NS-1->TILIX
End
If K=56
Goto EXPORTTM
End
End
EDIT: made my own renderer for now.