Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scrolling and Custom map sizes
#1
Well I got kind of a problem.

I took out several things (everything connected to the usage or ownership of items, spells and everything belonging to it, also some tile types) and got it up and running after some quite not logical errors. But that's not the problem. Now scrolling won't take my var for NOT do scrolling anymore so that's on all the time. Well, I thought, so I should make the best from it and take it into my game again, but oops! What do I see? It's working, yes, but my problem is another one. The maps are not blited correctly anymore, also with blurry borders. I think you know what I mean, otherwise say so then I'll post a screenshot.

Code:
NewX = 10
NewY = 7

NewPlayerY = Player(MyIndex).Y - NewY
NewPlayerX = Player(MyIndex).x - NewX

NewX = NewX * PIC_X
NewY = NewY * PIC_Y

NewXOffset = Player(MyIndex).XOffset
NewYOffset = Player(MyIndex).YOffset

If Player(MyIndex).Y - 7 < 1 Then
NewY = Player(MyIndex).Y * PIC_Y + Player(MyIndex).YOffset
NewYOffset = 0
NewPlayerY = 0
If Player(MyIndex).Y = 7 And Player(MyIndex).Dir = DIR_UP Then
NewPlayerY = Player(MyIndex).Y - 7
NewY = 7 * PIC_Y
NewYOffset = Player(MyIndex).YOffset
End If
ElseIf Player(MyIndex).Y + 9 > MAX_MAPY + 1 Then
NewY = (Player(MyIndex).Y - 16) * PIC_Y + Player(MyIndex).YOffset
NewYOffset = 0
NewPlayerY = MAX_MAPY - 14
If Player(MyIndex).Y = 23 And Player(MyIndex).Dir = DIR_DOWN Then
NewPlayerY = Player(MyIndex).Y - 7
NewY = 7 * PIC_Y
NewYOffset = Player(MyIndex).YOffset
End If
End If

If Player(MyIndex).x - 10 < 1 Then
NewX = Player(MyIndex).x * PIC_X + Player(MyIndex).XOffset
NewXOffset = 0
NewPlayerX = 0
If Player(MyIndex).x = 10 And Player(MyIndex).Dir = DIR_LEFT Then
NewPlayerX = Player(MyIndex).x - 10
NewX = 10 * PIC_X
NewXOffset = Player(MyIndex).XOffset
End If
ElseIf Player(MyIndex).x + 11 > MAX_MAPX + 1 Then
NewX = (Player(MyIndex).x - 11) * PIC_X + Player(MyIndex).XOffset
NewXOffset = 0
NewPlayerX = MAX_MAPX - 19
If Player(MyIndex).x = 21 And Player(MyIndex).Dir = DIR_RIGHT Then
NewPlayerX = Player(MyIndex).x - 10
NewX = 10 * PIC_X
NewXOffset = Player(MyIndex).XOffset
End If
End If

sx = 32
If MAX_MAPX = 40 Then
NewX = Player(MyIndex).x * PIC_X + Player(MyIndex).XOffset
NewXOffset = 0
NewPlayerX = 0
NewY = Player(MyIndex).Y * PIC_Y + Player(MyIndex).YOffset
NewYOffset = 0
NewPlayerY = 0
sx = 0
End If

What do I have to change to make that one work with my maps of max_mapx= 64 and max_mapy= 64?
Already tried to make both screensize and max_mapx/y evenly dividable through 32... didn't work.

Thanks in advance for any tip or hint or anything else bringing me closer to the solved problem.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)