applying xoffset to player causing funky results

BlitzMax Forums/BlitzMax Programming/applying xoffset to player causing funky results

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.

player.max_x = 584-player.xoffset
player.min_x = 16-player.xoffset

If MouseX()+player.xoffset < player.min_x Then MoveMouse(player.min_x,MouseY())

If MouseX()+player.xoffset > player.max_x Then MoveMouse(player.max_x,MouseY())


As you can see, I'm using mouse control... The control works fine itself. But when I have 2 playerships you're controlling, I need to add an xoffset to one of the ships so they dont overlap each other. The problem is, one of the ships will go off screen. To fix this I figured I'd apply the xoffset on the mouseX if check. But it's not working.

Symptoms:
Ship with offset applied to it still goes too far right.