I finally got it to work!

Thanks for helping me out everyone (especially 29 games

)
Here's a simple working example. I made it so there's no need for any plugins (at least I think so)
Edit: arrow keys to move. Space to jump.
set display mode 1024, 768, 32, 1
sync on
sync rate 60
hide mouse
tileSize = 64
mapSizeX = 15
mapSizeY = 11
playerHeight = 64
playerWidth = 32
xpos# = screen width()/2
ypos# = 64
yvel# = 0
initial_jump_speed# = -9.0
gravity# = 0.2
dim map(mapSizeX,mapSizeY)
for n = 0 to mapSizeX
map(n,mapSizeY)=1
next n
for n = 0 to mapSizeY
map(0,n)=1
map(mapSizeX,n)=1
next n
map(1,10)=1
map(14,10)=1
map(10,7)=1
map(11,7)=1
type line_type
x1 as integer
y1 as integer
x2 as integer
y2 as integer
endtype
maxLines = 3
dim lines(maxLines) as line_type
lines(0).x1 = 128
lines(0).y1 = 640
lines(0).x2 = 320
lines(0).y2 = 704
lines(1).x1 = 704
lines(1).y1 = 704
lines(1).x2 = 896
lines(1).y2 = 640
lines(2).x1 = 320
lines(2).y1 = 704
lines(2).x2 = 512
lines(2).y2 = 576
lines(3).x1 = 512
lines(3).y1 = 576
lines(3).x2 = 704
lines(3).y2 = 704
`make some images
cls rgb(0,0,196)
ink rgb(0,0,255)
box 2, 2, tileSize-2, tileSize-2
get image 1, 0, 0, tileSize, tileSize
cls rgb(0,196,0)
ink rgb(0,255,0)
box 2, 2, playerWidth-2, playerHeight-2
get image 2, 0, 0, playerWidth, playerHeight
ink rgb(255,255,255)
`main loop
do
cls
`move the player left and right and check for tile collision on the x axis
if leftkey() = 1
xpos# = xpos# - 3
tmpx1 = xpos# / tileSize
tmpy1 = ypos# / tileSize
tmpy2 = (ypos# + playerHeight-1) / tileSize
if map(tmpx1,tmpy1)=1 or map(tmpx1,tmpy2)=1
xpos# = (tmpx1+1)*tileSize
endif
endif
if rightkey() = 1
xpos# = xpos# + 3
tmpx2 = (xpos# + playerWidth) / tileSize
tmpy1 = ypos# / tileSize
tmpy2 = (ypos# + playerHeight-1) / tileSize
if map(tmpx2,tmpy1)=1 or map(tmpx2,tmpy2)=1
xpos# = tmpx2*tileSize-playerWidth
endif
endif
`jumping
if onGround = 1
if spacekey() = 1
yvel# = initial_jump_speed#
ypos# = ypos# + yvel#
yvel# = yvel# + gravity#
endif
endif
`calculate the y coordinate of the player
ypos# = ypos# + yvel#
`calculate the y velocity of the player
yvel# = yvel# + gravity#
`some variables for tile collision on the y axis
tmpx1 = xpos#/tileSize
tmpx2 = (xpos# + playerWidth-1) / tileSize
tmpy1 = ypos#/tileSize
tmpy2 = (ypos#+playerHeight)/tileSize
`check for tile collision above the player
if map(tmpx1,tmpy1)=1 or map(tmpx2,tmpy1)=1
ypos# = tmpy2*tileSize
yvel# = 0
endif
`check for tile collision below the player
if map(tmpx1,tmpy2)=1 or map(tmpx2,tmpy2)=1
ypos# = tmpy1*tileSize
onGround = 1
yvel# = 3
else
onGround = 0
endif
`check for collision against lines
for n = 0 to maxLines
col = getCollisionBox(xpos#,ypos#,playerWidth,playerHeight,lines(n).x1,lines(n).y1,lines(n).x2,lines(n).y2)
if col = 1
xpos2# = xpos# + playerWidth
tmpy1# = lines(n).y1 - playerHeight
tmpy2# = lines(n).y2 - playerHeight
if xpos# > lines(n).x1
top# = (xpos#-lines(n).x1)*(lines(n).y2-lines(n).y1)
btm# = lines(n).x2-lines(n).x1
tmpy1# = (top# / btm#) + lines(n).y1 - playerHeight
endif
if xpos2# < lines(n).x2
top# = (xpos2#-lines(n).x1)*(lines(n).y2-lines(n).y1)
btm# = lines(n).x2-lines(n).x1
tmpy2# = (top# / btm#) + lines(n).y1 - playerHeight
endif
`tmpy# = min(tmpy1#,tmpy2#)
if tmpy1# < tmpy2#
tmpy# = tmpy1#
else
tmpy# = tmpy2#
endif
if tmpy# < ypos#
ypos# = tmpy#
onGround = 1
yvel# = 3
endif
endif
next n
`draw the tile map
for x = 0 to mapSizeX
for y = 0 to mapSizeY
if map(x,y)>0 then paste image map(x,y), x*tileSize, y*tileSize
next y
next x
`draw collision lines
for n = 0 to maxLines
line lines(n).x1, lines(n).y1, lines(n).x2, lines(n).y2
next n
`draw the player
paste image 2, xpos#, ypos#
`print som debug text
print "FPS: " + str$(screen fps())
print "On Ground: " + str$(onGround)
sync
loop
`*******************************************************************************
`This function checks for collision between a box and the bounding box of a line
function getCollisionBox(bx#,by#,bw#,bh#,x1#,y1#,x2#,y2#)
`make sure y1# is less than y2#
if y1# > y2#
tmp# = y1#
y1# = y2#
y2# = tmp#
endif
if (by# + bh# < y1#) then exitfunction 0
if (by# > y2#) then exitfunction 0
if (bx# + bw# < x1#) then exitfunction 0
if (bx# > x2#) then exitfunction 0
endfunction 1