Getting at the remainder

BlitzPlus Forums/BlitzPlus Programming/Getting at the remainder

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Thanks for all the help guys ,really appreicated.. but still stuck ! :(

What happening is I've got this scrolly routine that uses offsets. Since a tile is 64 pixels, if can go off the screen to the coords -63. (before the map is updated by one tile and the offset put back to '0')

What was x = 0.. before scrolling can now be x = -5 (or whatever)

I can counter for the offset quite easy to get at the current tile under the mouse:

Function return_tile(xtemp,ytemp,ly)

x=layer(ly)\x_offset#
tilex = (xtemp-x)/64
tilex=(tilex+layer(ly)\x_map)+1
Text 100,340,"Tile X:"+tilex,True,True

; WORKS ! :)

offsetx=xtemp - tilex *64
Text 200,340,"Offset X:"+offsetx,True,True

; Nope.. offset still screwed :(

End Function


But as you can see, having that offset doesnt give back a proper remainder.

layer(ly)\x_map contains the map position
layer(ly)\x_offset# contains the offset of the whole map

It's easier to see whats going on when you see the program running - I'd be more than happy to email the whole source to someone if they could take the time to take a look.