Problem with code. Please help.

Blitz3D Forums/Blitz3D Beginners Area/Problem with code. Please help.

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.

how bout this?
;controls
	If leftkey() Then mybat\x=mybat\x-2	ElseIf rightkey() Then mybat\x=mybat\x+2	
	;Make sure bat is on screen
	If (Mybat\x > screenx-(Mybat\width)/2) Then mybat\x=screenx-(Mybat\width)/2 ElseIf (Mybat\x < Mybat\width/2) Then mybat\x=Mybat\width/2