@Ashingda 27
Sorry for not replying sooner, was house sitting and didn't get on their computer any but to create some tiles for a my non-existent game. I'll defiantly spend time messing with your method to get the best fps.
Here
was my current version(going to try to put your method in later)
-----
Everything is customizable, some in-game(speed, display width/height, tile placing variables), while others(such as tile width) can be done in code. Use the mouse to place and remover the different tiles.
note:
that if you lower the "display tile width/height" it will only correctly work on even numbers, I know why this happens(in concept), I just don't see a need in my games for there to be a odd number of tiles displayed. And didn't want it to be much more complicated due to bugs.
also character image and collision variables are separate.(to give a 3d effect)
-----
Rem Project: tile collision
Rem Created: 2am 9/02/11
Rem ***** Main Source File *****
` ~SETUP~
`set window off
set display mode 1024, 768, 32
maximize window
sync on:sync rate 0
set text font "Times New Roman", 1
set text size 20
randomize timer()
ink rgb(255, 255, 255), 0
` Varibles
global dim time(10)
global dim oldtime(10)
#constant true 1: #constant false 0
screen_width=screen width()
screen_height=screen height()
tile_width=32
tile_height=32
max_map_width=500
max_map_height=500
map_width=50
map_height=50
max_layer=3
max_map=1
cur_map=1
dim map(max_map_width, max_map_height, max_layer, max_map)
for x=1 to map_width
for y=1 to map_height
if x=1 or x=map_width or y=1 or y=map_height
map(x, y, 2, 1)=2
endif
next y
next x
for x=1 to map_width
for y=1 to map_height
map(x, y, 1, 1)=1
next y
next x
dim hit(12)
disp_x=0
disp_y=0
disp_tile_width=screen_width/tile_width
disp_tile_height=screen_height/tile_height
scroll_x=tile_width*(disp_tile_width/2)
scroll_y=tile_height*(disp_tile_height/2)
char_width=34
char_height=34
char_speed_x=2
char_speed_y=2
char_layer=2
char_col_L=0
char_col_T=(char_height/2)
char_col_R=char_width-1
char_col_B=char_height-1
tile_layer=2
tile_select=2
type Tiles name$, image, active, col_L, col_T, col_R, col_B endtype
max_tile=10
dim tile(max_tile) as Tiles
tile(1).name$="grass"
tile(1).image=2
tile(1).active=false
tile(2).name$="wood"
tile(2).image=3
tile(2).active=true
tile(2).col_L=0
tile(2).col_T=0
tile(2).col_R=31
tile(2).col_B=31
tile(3).name$="wood_corner up_left"
tile(3).image=4
tile(3).active=true
tile(3).col_L=0
tile(3).col_T=0
tile(3).col_R=15
tile(3).col_B=15
tile(4).name$="wood_corner up_right"
tile(4).image=5
tile(4).active=true
tile(4).col_L=16
tile(4).col_T=0
tile(4).col_R=31
tile(4).col_B=15
tile(5).name$="wood_corner down_right"
tile(5).image=6
tile(5).active=true
tile(5).col_L=16
tile(5).col_T=16
tile(5).col_R=31
tile(5).col_B=31
tile(6).name$="wood_corner down_left"
tile(6).image=7
tile(6).active=true
tile(6).col_L=0
tile(6).col_T=16
tile(6).col_R=15
tile(6).col_B=31
tile(7).name$="wood_left"
tile(7).image=8
tile(7).active=true
tile(7).col_L=0
tile(7).col_T=0
tile(7).col_R=15
tile(7).col_B=31
tile(8).name$="wood_top"
tile(8).image=9
tile(8).active=true
tile(8).col_L=0
tile(8).col_T=0
tile(8).col_R=31
tile(8).col_B=15
tile(9).name$="wood_right"
tile(9).image=10
tile(9).active=true
tile(9).col_L=16
tile(9).col_T=0
tile(9).col_R=31
tile(9).col_B=31
tile(10).name$="wood_bottom"
tile(10).image=11
tile(10).active=true
tile(10).col_L=0
tile(10).col_T=16
tile(10).col_R=31
tile(10).col_B=31
` Images
make_grass(tile_width, tile_height, 2)
for n=2 to 10
make_wood(tile_width, tile_height, tile(n).col_L, tile(n).col_T, tile(n).col_R, tile(n).col_B, n+1)
next n
make_charactor(char_width, char_height, 100)
ink rgb(255, 255, 255), 0
`pre
` ~MAIN~
DO
if time_check(1,12)=1
gosub collision
gosub images
print screen fps()
print
print "mouse tile x ";mouse_tile_x
print "mouse tile y ";mouse_tile_y
print
print "tile x ";x_tile
print "tile y ";y_tile
print
print "disp_x ";disp_x
print "disp_y ";disp_y
print
print "disp_Xoffset ";disp_Xoffset
print "disp_Yoffset ";disp_Yoffset
print
print "start_x ";start_x
print "start_y ";start_y
print
print "end_x ";end_x
print "end_y ";end_y
print
print "char_x ";char_x
print "char_y ";char_y
print
print "tile width ";tile_width
print "tile height ";tile_height
print
print "display tile width(Q,A) ";disp_tile_width
print "display tile height(W,S) ";disp_tile_height
print
print "speed x(E,D) ";char_speed_x
print "speed y(R,F) ";char_speed_y
print
print "tile selected(T,G) "+tile(tile_select).name$
print "tile layer(Y,H) ";tile_layer
sync:cls
endif
LOOP
` ~SUB~
`<><><><> 1
collision:
if keystate(16)=0 then hit(1)=0: if keystate(17)=0 then hit(3)=0
if keystate(30)=0 then hit(2)=0: if keystate(31)=0 then hit(4)=0
if keystate(18)=0 then hit(5)=0: if keystate(19)=0 then hit(7)=0
if keystate(32)=0 then hit(6)=0: if keystate(33)=0 then hit(8)=0
if keystate(20)=0 then hit(9)=0: if keystate(21)=0 then hit(11)=0
if keystate(34)=0 then hit(10)=0: if keystate(35)=0 then hit(12)=0
`qa
if keystate(16)=1 and hit(1)=0
hit(1)=1
inc disp_tile_width, 1
endif
if keystate(30)=1 and hit(2)=0
hit(2)=1
dec disp_tile_width, 1
if disp_tile_width<1 then disp_tile_width=1
endif
`ws
if keystate(17)=1 and hit(3)=0
hit(3)=1
inc disp_tile_height, 1
endif
if keystate(31)=1 and hit(4)=0
hit(4)=1
dec disp_tile_height, 1
if disp_tile_height<1 then disp_tile_height=1
endif
`ed
if keystate(18)=1 and hit(5)=0
hit(5)=1
inc char_speed_x, 1
endif
if keystate(32)=1 and hit(6)=0
hit(6)=1
dec char_speed_x, 1
if char_speed_x<1 then char_speed_x=1
endif
`rf
if keystate(19)=1 and hit(7)=0
hit(7)=1
inc char_speed_y, 1
endif
if keystate(33)=1 and hit(8)=0
hit(8)=1
dec char_speed_y, 1
if char_speed_y<1 then char_speed_y=1
endif
`tg
if keystate(20)=1 and hit(9)=0
hit(9)=1
inc tile_select, 1
if tile_select>max_tile then tile_select=max_tile
endif
if keystate(34)=1 and hit(10)=0
hit(10)=1
dec tile_select, 1
if tile_select<1 then tile_select=1
endif
`yh
if keystate(21)=1 and hit(11)=0
hit(11)=1
inc tile_layer, 1
if tile_layer>max_layer then tile_layer=max_layer
endif
if keystate(35)=1 and hit(12)=0
hit(12)=1
dec tile_layer, 1
if tile_layer<1 then tile_layer=1
endif
mx=mousex(): my=mousey()
mouse_tile_x=((scroll_x-(disp_x+(((disp_tile_width*tile_width)/2))-mx))/tile_width)+1
mouse_tile_y=((scroll_y-(disp_y+(((disp_tile_height*tile_height)/2))-my))/tile_height)+1
if mouse_tile_x>=start_x and mouse_tile_x<=end_x
if mouse_tile_y>=start_y and mouse_tile_y<=end_y
if mouseclick()=1 then map(mouse_tile_x, mouse_tile_y, tile_layer, cur_map)=tile_select
if mouseclick()=2 then map(mouse_tile_x, mouse_tile_y, tile_layer, cur_map)=0
endif
endif
disp_x=(screen_width/2)-((disp_tile_width*tile_width)/2)
disp_y=(screen_height/2)-((disp_tile_height*tile_height)/2)
old_scroll_x=scroll_x
old_scroll_y=scroll_y
if leftkey()=1
dec scroll_x, char_speed_x
endif
if rightkey()=1
inc scroll_x, char_speed_x
endif
if upkey()=1
dec scroll_y, char_speed_y
endif
if downkey()=1
inc scroll_y, char_speed_y
endif
disp_x=(screen_width/2)-((disp_tile_width*tile_width)/2)
disp_y=(screen_height/2)-((disp_tile_height*tile_height)/2)
x_tile=(scroll_x/tile_width)+1
y_tile=(scroll_y/tile_height)+1
disp_Xoffset=(scroll_x-(x_tile*tile_width))*-1
disp_Yoffset=(scroll_y-(y_tile*tile_height))*-1
start_x=x_tile-(disp_tile_width/2)
start_y=y_tile-(disp_tile_height/2)
end_x=start_x+disp_tile_width
end_y=start_y+disp_tile_height
char_x=disp_x+((disp_tile_width*tile_width)/2)-(char_width/2)-1
char_y=disp_y+((disp_tile_height*tile_height)/2)-(char_height/2)-1
x1=char_x+char_col_L
y1=char_y+char_col_T
w1=char_col_R-char_col_L
h1=char_col_B-char_col_T
col_flag=0
for x=start_x to end_x
for y=start_y to end_y
for n=1 to max_layer
if x>0 and x<map_width+1
if y>0 and y<map_height+1
tile_num=map(x, y, n, cur_map)
if tile_num>0
if tile(tile_num).active=true
x2=(disp_x+((tile_width*(x-start_x)))+disp_Xoffset-tile_width)+tile(tile_num).col_L
y2=(disp_y+((tile_height*(y-start_y)))+disp_Yoffset-tile_height)+tile(tile_num).col_T
w2=tile(tile_num).col_R-tile(tile_num).col_L
h2=tile(tile_num).col_B-tile(tile_num).col_T
if box_col(x1, y1, w1, h1, x2, y2, w2, h2)=1
col_flag=1
endif
endif
endif
endif
endif
next n
next y
next x
if col_flag=1
max_check=abs(old_scroll_x-scroll_x)+abs(old_scroll_y-scroll_y)
num_start_x=old_scroll_x
num_start_y=old_scroll_y
num_finish_x=scroll_x
num_finish_y=scroll_y
scroll_x=old_scroll_x
scroll_y=old_scroll_y
step_x=1
step_y=1
if num_start_x>num_finish_x then step_x=-1
if num_start_y>num_finish_y then step_y=-1
col_num=0
for num=1 to max_check+col_num
if col_num=0
if scroll_x<>num_finish_x then scroll_x=scroll_x+step_x
if scroll_y<>num_finish_y then scroll_y=scroll_y+step_y
endif
if col_num=1
if scroll_x<>num_finish_x then scroll_x=scroll_x+step_x
endif
if col_num=2
if scroll_y<>num_finish_y then scroll_y=scroll_y+step_y
endif
disp_x=(screen_width/2)-((disp_tile_width*tile_width)/2)
disp_y=(screen_height/2)-((disp_tile_height*tile_height)/2)
x_tile=(scroll_x/tile_width)+1
y_tile=(scroll_y/tile_height)+1
disp_Xoffset=(scroll_x-(x_tile*tile_width))*-1
disp_Yoffset=(scroll_y-(y_tile*tile_height))*-1
start_x=x_tile-(disp_tile_width/2)
start_y=y_tile-(disp_tile_height/2)
end_x=start_x+disp_tile_width
end_y=start_y+disp_tile_height
char_x=disp_x+((disp_tile_width*tile_width)/2)-(char_width/2)-1
char_y=disp_y+((disp_tile_height*tile_height)/2)-(char_height/2)-1
for x=start_x to end_x
for y=start_y to end_y
for n=1 to max_layer
if x>0 and x<map_width+1
if y>0 and y<map_height+1
tile_num=map(x, y, n, cur_map)
if tile_num>0
if tile(tile_num).active=true
x2=(disp_x+((tile_width*(x-start_x)))+disp_Xoffset-tile_width)+tile(tile_num).col_L
y2=(disp_y+((tile_height*(y-start_y)))+disp_Yoffset-tile_height)+tile(tile_num).col_T
w2=tile(tile_num).col_R-tile(tile_num).col_L
h2=tile(tile_num).col_B-tile(tile_num).col_T
if box_col(x1, y1, w1, h1, x2, y2, w2, h2)=1
if col_num<4 then inc col_num, 1
if col_num=1
scroll_y=scroll_y-step_y
scroll_x=scroll_x-step_x
endif
if col_num=2
scroll_x=scroll_x-step_x
endif
if col_num=3
scroll_y=scroll_y-step_y
endif
n=max_layer
x=end_x
y=end_y
endif
endif
endif
endif
endif
next n
next y
next x
next num
endif
Return
`<><><><> 2
images:
disp_x=(screen_width/2)-((disp_tile_width*tile_width)/2)
disp_y=(screen_height/2)-((disp_tile_height*tile_height)/2)
x_tile=(scroll_x/tile_width)+1
y_tile=(scroll_y/tile_height)+1
disp_Xoffset=(scroll_x-(x_tile*tile_width))*-1
disp_Yoffset=(scroll_y-(y_tile*tile_height))*-1
start_x=x_tile-(disp_tile_width/2)
start_y=y_tile-(disp_tile_height/2)
end_x=start_x+disp_tile_width
end_y=start_y+disp_tile_height
char_x=disp_x+((disp_tile_width*tile_width)/2)-1
char_y=disp_y+((disp_tile_height*tile_height)/2)-1
for x=start_x to end_x
for y=start_y to end_y
for n=1 to max_layer
if x>0 and x<map_width+1
if y>0 and y<map_height+1
tile_num=map(x, y, n, cur_map)
if tile_num>0
paste image tile(tile_num).image, disp_x+((tile_width*(x-start_x)))+disp_Xoffset-tile_width, disp_y+((tile_height*(y-start_y)))+disp_Yoffset-tile_height, 1
endif
endif
endif
if n=char_layer then paste image 100, char_x-(char_width/2) ,char_y-(char_height/2), 1
next n
next y
next x
ink 0, 0
box disp_x-tile_width, disp_y-tile_height, disp_x, disp_y+tile_height+disp_tile_height*tile_height
box disp_x-tile_width, disp_y-tile_height, disp_x+tile_width+disp_tile_width*tile_width, disp_y
box disp_x+disp_tile_width*tile_width, disp_y-tile_height, disp_x+tile_width+disp_tile_width*tile_width, disp_y+tile_height+disp_tile_height*tile_height
box disp_x-tile_width, disp_y+disp_tile_height*tile_height, disp_x+tile_width+disp_tile_width*tile_width, disp_y+tile_height+disp_tile_height*tile_height
ink rgb(255, 255, 255), 0
Return
` Functions
Function time_check(num, timepass)
time(num)=timer()-oldtime(num)
if time(num)>=timepass
oldtime(num)=timer()
Exitfunction true
endif
Endfunction false
Function Make_grass(w, h, ima)
cls
for x=0 to w-1
for y=0 to h-1
dot x,y, rgb(rnd(5), rnd(19)+215, rnd(5))
next y
next x
get image ima, 0, 0, w, h
cls
Endfunction
Function Make_wood(w, h, L, T, R, B, ima)
cls
for x=L to R
rndnum=rnd(30)
for y=T to B
dot x,y, rgb((rnd(6)-3)+rndnum+180, (rnd(6)-3)+rndnum+140, rnd(6))
next y
next x
get image ima, 0, 0, w, h
cls
Endfunction
Function Make_charactor(w, h, ima)
ink rgb(255, 0, 0), 0
box 0,0,w,h
for n=1 to h
ink rgb(225-(n*5), 0, 0), 0
line 0, n, w, n
next n
get image ima, 0, 0, w, h
Endfunction
Function Box_col(x1, y1, w1, h1, x2, y2, w2, h2)
collision=0
if x1<=x2 and x1+w1>=x2
if y1<=y2 and y1+h1>=y2
collision=1
else
if y1>=y2 and y1<=y2+h2
collision=1
endif
endif
else
if x1>=x2 and x1<=x2+w2
if y1<=y2 and y1+h1>=y2
collision=1
else
if y1>=y2 and y1<=y2+h2
collision=1
endif
endif
endif
endif
if collision=1
Exitfunction true
endif
Endfunction false
And this was the naked engine:
Rem Project: scroller engine
Rem Created: 9/02/11
Rem ***** Main Source File *****
` ~SETUP~
`set window off
set display mode 1024, 768, 32
maximize window
sync on:sync rate 0
set text font "Times New Roman", 1
set text size 20
randomize timer()
text_color=rgb(255, 255, 255)
ink text_color, 0
` Varibles
global dim time(10)
global dim oldtime(10)
#constant true 1: #constant false 0
screen_width=screen width()
screen_height=screen height()
tile_width=32
tile_height=32
max_map_width=500
max_map_height=500
map_width=1
map_height=1
max_layer=10
max_map=1
cur_map=1
dim map(max_map_width, max_map_height, max_layer, max_map)
disp_x=0
disp_y=0
disp_tile_width=screen_width/tile_width
disp_tile_height=screen_height/tile_height
scroll_x=1
scroll_y=1
char_width=1
char_height=1
char_speed_x=1
char_speed_y=1
char_ima=1
char_layer=1
char_col_L=0
char_col_T=0
char_col_R=1
char_col_B=1
type Tiles name$, image, active, col_L, col_T, col_R, col_B endtype
max_tile=10
dim tile(max_tile) as Tiles
` Images
ink text_color, 0,
`pre
` ~MAIN~
DO
if time_check(1,12)=1
gosub collision
gosub images
print screen fps()
sync:cls
endif
LOOP
` ~SUB~
`<><><><> 1
collision:
`movement
if leftkey()=1
dec scroll_x, char_speed_x
endif
if rightkey()=1
inc scroll_x, char_speed_x
endif
if upkey()=1
dec scroll_y, char_speed_y
endif
if downkey()=1
inc scroll_y, char_speed_y
endif
`var
mx=mousex(): my=mousey()
mouse_tile_x=((scroll_x-(disp_x+(((disp_tile_width*tile_width)/2))-mx))/tile_width)+1
mouse_tile_y=((scroll_y-(disp_y+(((disp_tile_height*tile_height)/2))-my))/tile_height)+1
old_scroll_x=scroll_x
old_scroll_y=scroll_y
disp_x=(screen_width/2)-((disp_tile_width*tile_width)/2)
disp_y=(screen_height/2)-((disp_tile_height*tile_height)/2)
x_tile=(scroll_x/tile_width)+1
y_tile=(scroll_y/tile_height)+1
disp_Xoffset=(scroll_x-(x_tile*tile_width))*-1
disp_Yoffset=(scroll_y-(y_tile*tile_height))*-1
start_x=x_tile-(disp_tile_width/2)
start_y=y_tile-(disp_tile_height/2)
end_x=start_x+disp_tile_width
end_y=start_y+disp_tile_height
char_x=disp_x+((disp_tile_width*tile_width)/2)-(char_width/2)-1
char_y=disp_y+((disp_tile_height*tile_height)/2)-(char_height/2)-1
`collision check
x1=char_x+char_col_L
y1=char_y+char_col_T
w1=char_col_R-char_col_L
h1=char_col_B-char_col_T
col_flag=0
for x=start_x to end_x
for y=start_y to end_y
for n=1 to max_layer
if x>0 and x<map_width+1
if y>0 and y<map_height+1
tile_num=map(x, y, n, cur_map)
if tile_num>0
if tile(tile_num).active=true
x2=(disp_x+((tile_width*(x-start_x)))+disp_Xoffset-tile_width)+tile(tile_num).col_L
y2=(disp_y+((tile_height*(y-start_y)))+disp_Yoffset-tile_height)+tile(tile_num).col_T
w2=tile(tile_num).col_R-tile(tile_num).col_L
h2=tile(tile_num).col_B-tile(tile_num).col_T
if box_col(x1, y1, w1, h1, x2, y2, w2, h2)=1
col_flag=1
endif
endif
endif
endif
endif
next n
next y
next x
`collision
if col_flag=1
max_check=abs(old_scroll_x-scroll_x)+abs(old_scroll_y-scroll_y)
num_start_x=old_scroll_x
num_start_y=old_scroll_y
num_finish_x=scroll_x
num_finish_y=scroll_y
scroll_x=old_scroll_x
scroll_y=old_scroll_y
step_x=1
step_y=1
if num_start_x>num_finish_x then step_x=-1
if num_start_y>num_finish_y then step_y=-1
col_num=0
for num=1 to max_check+col_num
if col_num=0
if scroll_x<>num_finish_x then scroll_x=scroll_x+step_x
if scroll_y<>num_finish_y then scroll_y=scroll_y+step_y
endif
if col_num=1
if scroll_x<>num_finish_x then scroll_x=scroll_x+step_x
endif
if col_num=2
if scroll_y<>num_finish_y then scroll_y=scroll_y+step_y
endif
disp_x=(screen_width/2)-((disp_tile_width*tile_width)/2)
disp_y=(screen_height/2)-((disp_tile_height*tile_height)/2)
x_tile=(scroll_x/tile_width)+1
y_tile=(scroll_y/tile_height)+1
disp_Xoffset=(scroll_x-(x_tile*tile_width))*-1
disp_Yoffset=(scroll_y-(y_tile*tile_height))*-1
start_x=x_tile-(disp_tile_width/2)
start_y=y_tile-(disp_tile_height/2)
end_x=start_x+disp_tile_width
end_y=start_y+disp_tile_height
char_x=disp_x+((disp_tile_width*tile_width)/2)-(char_width/2)-1
char_y=disp_y+((disp_tile_height*tile_height)/2)-(char_height/2)-1
for x=start_x to end_x
for y=start_y to end_y
for n=1 to max_layer
if x>0 and x<map_width+1
if y>0 and y<map_height+1
tile_num=map(x, y, n, cur_map)
if tile_num>0
if tile(tile_num).active=true
x2=(disp_x+((tile_width*(x-start_x)))+disp_Xoffset-tile_width)+tile(tile_num).col_L
y2=(disp_y+((tile_height*(y-start_y)))+disp_Yoffset-tile_height)+tile(tile_num).col_T
w2=tile(tile_num).col_R-tile(tile_num).col_L
h2=tile(tile_num).col_B-tile(tile_num).col_T
if box_col(x1, y1, w1, h1, x2, y2, w2, h2)=1
if col_num<4 then inc col_num, 1
if col_num=1
scroll_y=scroll_y-step_y
scroll_x=scroll_x-step_x
endif
if col_num=2
scroll_x=scroll_x-step_x
endif
if col_num=3
scroll_y=scroll_y-step_y
endif
n=max_layer
x=end_x
y=end_y
endif
endif
endif
endif
endif
next n
next y
next x
next num
endif
Return
`<><><><> 2
images:
`var
disp_x=(screen_width/2)-((disp_tile_width*tile_width)/2)
disp_y=(screen_height/2)-((disp_tile_height*tile_height)/2)
x_tile=(scroll_x/tile_width)+1
y_tile=(scroll_y/tile_height)+1
disp_Xoffset=(scroll_x-(x_tile*tile_width))*-1
disp_Yoffset=(scroll_y-(y_tile*tile_height))*-1
start_x=x_tile-(disp_tile_width/2)
start_y=y_tile-(disp_tile_height/2)
end_x=start_x+disp_tile_width
end_y=start_y+disp_tile_height
char_x=disp_x+((disp_tile_width*tile_width)/2)-1
char_y=disp_y+((disp_tile_height*tile_height)/2)-1
`tiles
for x=start_x to end_x
for y=start_y to end_y
for n=1 to max_layer
if x>0 and x<map_width+1
if y>0 and y<map_height+1
tile_num=map(x, y, n, cur_map)
if tile_num>0
paste image tile(tile_num).image, disp_x+((tile_width*(x-start_x)))+disp_Xoffset-tile_width, disp_y+((tile_height*(y-start_y)))+disp_Yoffset-tile_height, 1
endif
endif
endif
`charactor
if n=char_layer then paste image char_ima, char_x-(char_width/2) ,char_y-(char_height/2), 1
next n
next y
next x
`hide updated tiles
ink 0, 0
box disp_x-tile_width, disp_y-tile_height, disp_x, disp_y+tile_height+disp_tile_height*tile_height
box disp_x-tile_width, disp_y-tile_height, disp_x+tile_width+disp_tile_width*tile_width, disp_y
box disp_x+disp_tile_width*tile_width, disp_y-tile_height, disp_x+tile_width+disp_tile_width*tile_width, disp_y+tile_height+disp_tile_height*tile_height
box disp_x-tile_width, disp_y+disp_tile_height*tile_height, disp_x+tile_width+disp_tile_width*tile_width, disp_y+tile_height+disp_tile_height*tile_height
ink text_color, 0
Return
` Functions
Function time_check(num, timepass)
time(num)=timer()-oldtime(num)
if time(num)>=timepass
oldtime(num)=timer()
Exitfunction true
endif
Endfunction false
Function Box_col(x1, y1, w1, h1, x2, y2, w2, h2)
collision=0
if x1<=x2 and x1+w1>=x2
if y1<=y2 and y1+h1>=y2
collision=1
else
if y1>=y2 and y1<=y2+h2
collision=1
endif
endif
else
if x1>=x2 and x1<=x2+w2
if y1<=y2 and y1+h1>=y2
collision=1
else
if y1>=y2 and y1<=y2+h2
collision=1
endif
endif
endif
endif
if collision=1
Exitfunction true
endif
Endfunction false
I'll update this with your version soon. If you could play around with collision and the scrolling and tell me what you think I would appreciate it. Thanks very much for taking the time to help me out. Going to sleep for now though, excited to update it tomorrow.
Edit:
What do you do about animated tiles using this method? It does give a much better fps, but the only way to animated tiles using a bitmap I can think of is to use memblocks to edit the individual tiles. Else you would need to update the whole display.

If I always made the right decision the first time, I wouldn't have changed my name from razerx.