I have reproduced the error in a much smaller code to read!
The eror is the same...a sort of mirror around the center of the world axis (0,0)...
If i understand this i can make the other program work...so as my game...
The eror is the same...a sort of mirror around the center of the world axis (0,0)...
Type oggetto Field posx Field posy End Type Graphics 640,480,32,1 SetBuffer BackBuffer() Global terreno=LoadImage("terreno.bmp") ;a simple texture of 256*256 Global enemy=LoadImage("enemy.bmp") MidHandle enemy Global screenx=0 Global screeny=0 Global posx=200 Global posy=200 Global offset=1 While Not KeyHit(1)=True Cls x=MouseX() y=MouseY() mouse1=MouseHit(1) Origin screenx,screeny MapTiles() ;Origin 0,0 If KeyDown(200)=True Then screeny=screeny+1 If KeyDown(208)=True Then screeny=screeny-1 If KeyDown(205)=True Then screenx=screenx+1 If KeyDown(203)=True Then screenx=screenx-1 If KeyHit(57)=True Then screenx=0:screeny=0 ;if i hit the spacebar Rect MouseX(),MouseY(),9,9 ;Origin screenx,screeny If mouse1=True create_enemy(screenx+MouseX(),screeny+MouseY()) EndIf draw_enemy() Origin 0,0 Color 255,255,255 Text 50,400,("Mouse X world coords:"+(screenx-MouseX())) Text 50,410,("Mouse Y world coords:"+(screeny-MouseY())) Color 255,0,0 Text 50,430,("X offset world coords:"+screenx) Text 50,440,("Y offset world coords:"+screeny) Color 0,0,255 Text 50,450,("X mouse world coords:"+(screenx+MouseX())) Text 50,460,("Y mouse world coords:"+(screeny+MouseY())) ;If MouseHit(1)=True Flip Wend Function MapTiles() tilex=0 tiley=0 For tiley=0 To 2560 Step 256 For tilex=0 To 640 Step 256 DrawBlock terreno,tilex,tiley Next Next End Function Function draw_enemy1() DrawImage enemy,posx,posy posx=posx posy=posy+offset If posy =< 0 Then offset=1 If posy => 100 Then offset=-1 End Function Function create_enemy(x,y) a.oggetto=New oggetto a\posx=x a\posy=y End Function Function draw_enemy() For a.oggetto = Each oggetto DrawImage enemy,a\posx,a\posy Next End Function
If i understand this i can make the other program work...so as my game...