Last night I hurriedly made this very basic level editor:
enter - makes floor
w/a/s/d - makes walls
left/right/up/down - move sphere that 'deposits' the floor/walls
shift - Switches to buggy, ineffective camera view where you can use the mouse and up key to move. Pressing shift in this mode returns you to level building mode.
The problem is that in 'camera mode' the fps on my computer is low if you navigate the basic level you have just made. Is this something to do with the fact that there are lots of objects on the screen and that the floor and walls of the level you make are made up of several different objects? Or is it just the laptop I am using?
Basic editor code:
sync on
make object sphere 1,2
position object 1,5,0,5
obj=2
do
x#=object position x(1)
y#=object position y(1)
z#=object position z(1)
if rightkey()=1 then position object 1,x#+10,y#,z# : wait 200
if leftkey()=1 then position object 1,x#-10,y#,z# : wait 200
if upkey()=1 then position object 1,x#,y#,z#+10 : wait 200
if downkey()=1 then position object 1,x#,y#,z#-10 : wait 200
if returnkey()=1 then gosub makesegment_floor
if inkey$()="w" then gosub makesegment_upwall
if inkey$()="s" then gosub makesegment_downwall
if inkey$()="a" then gosub makesegment_leftwall
if inkey$()="d" then gosub makesegment_rightwall
if shiftkey()=1 then gosub camview
position camera x#,y#+100,z#
point camera x#,y#,z#
sync
loop
makesegment_floor:
make object box obj,10,1,10
position object obj,x#,y#,z#
color object obj,rgb(255,0,0)
inc obj
return
makesegment_leftwall:
make object box obj,10,1,10
zrotate object obj,90
position object obj,x#-5,y#+5,z#
inc obj
return
makesegment_rightwall:
make object box obj,10,1,10
zrotate object obj,90
position object obj,x#+5,y#+5,z#
inc obj
return
makesegment_downwall:
make object box obj,10,1,10
xrotate object obj,90
position object obj,x#,y#+5,z#-5
inc obj
return
makesegment_upwall:
make object box obj,10,1,10
xrotate object obj,90
position object obj,x#,y#+5,z#+5
inc obj
return
camview:
wait 200
do
text 10,10,str$(screen fps())
yrotate camera wrapvalue(mousex())
xrotate camera wrapvalue(mousey())
if upkey()=1 then move camera 0.4
if shiftkey()=1 then wait 200 : return
sync
loop