Hey guys, Sledger721 again. I'm working on a small roguelike, and I was making the collision when I encountered a problem with the if statements.
I have pointed out where the problem is with comments, but when I run the game (so far) it keeps on blowing me back to the top left.
Thanks guys

.
- Sledger721
sync on
sync rate 30
rem Intro
set text size 4
x=250
y=250
mobX=260
mobY=260
rem Beginning of loop
do
rem This detects input
if KEYSTATE(17) = 1 then y=y-10
if KEYSTATE(30) = 1 then x=x-10
if KEYSTATE(31) = 1 then y=y+10
if KEYSTATE(32) = 1 then x=x+10
rem Clears the screen
cls
rem Here's the thing that actually settles the movement
center text x,y,"X"
center text mobX,mobY,"X"
rem Here's the mob
detector=rnd(20)
if detector = 1 then mobX = mobX + 1
if detector = 2 then mobX = mobX - 1
if detector = 3 then mobY = mobY + 1
if detector = 4 then mobY = mobY - 1
rem Collision
rem If you take this block of code out it works
rem HERES THE BLOCK
rem HERES THE BLOCK
rem HERES THE BLOCK
rem HERES THE BLOCK
rem HERES THE BLOCK
if x = mobX then xCol = true
if y = mobY then yCol = true
if xCol = true and yCol = true then bCol = 1
if bCol = 1 then x=x-1
if bCol = 1 then y=y-1
rem Syncs the screen
sync
loop
rem End of loop
rem Functions
If you fail to plan for the epic then you plan to epic fail.
- Infinitus developers. (me

).