Thanks again. Im still running into problems unfortunately. My source code is below...
Rem Project: tilegame
Rem Created: 18/08/2004 13:06:55
Rem ***** Main Source File *****
rem setup
flush video memory
set display mode 640,480,16
sync on : sync rate 60
hide mouse
rem colorkey
set image colorkey 255,0,255
rem load media
load image "player.bmp", 1000
load image "background.jpg", 1
load image "platform.jpg", 2
load image "title_bar.bmp",1001
rem create sprites
create animated sprite 1, "player.bmp", 4, 1, 1000
rem create map array
dim map(20,15)
rem read data into map array
for y = 1 to 15
for x = 1 to 20
read map(x,y)
next x
next y
do
rem draw map
for y = 1 to 15
for x = 1 to 20
paste image map(x,y), x * 32 - 32, y * 32 - 32
next x
next y
rem draw title_bar
paste image 1001, 192, 0
rem display fps
print "fps:";screen fps()
rem gravity effect
ypos = ypos + 3
rem check player position and adjust ypos if collision with tile 2
if map(int(xpos / 32),int(ypos / 32)+1) = 2
ypos = (int(ypos / 32) - 1) * 32 + 31
endif
rem move player using keys
x_move = rightkey() - leftkey()
xpos = xpos + x_move
rem check player position and adjust xpos if collision with tile 2
if map(int(xpos / 32),int(ypos / 32)) = 2
if x_move < 0
xpos = (int(xpos / 32) + 1)*32
else
xpos = (int(xpos / 32) - 1)*32 + 31
endif
endif
rem update sprite position
sprite 1, xpos, ypos, 1000
sync
cls
loop
rem map data
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
The collision isn't working correctly... its like offset by a tile I think. (down one and right one)
Im willing to find out what impossible means.