This code runs although I don't know if its doing what you expected.
As far as the problem, you have a variable and a function named the same: camerachange()
I renamed the variable to VARcamerachange
Rem Project: RPG
Rem Created: 26/06/2004 15:48:37
Rem ***** Main Source File *****
player_x#=0
player_y#=0
player_z#=0
player_z_speed#=0.03
player_x_speed#=0.03
money=0
collected=0
camera_x#=0
camera_y#=17.5
camera_z#=-10
camera_x_speed#=0.03
camera_y_speed#=0.03
camera_z_speed#=0.03
VARcamerachange=0
`load media
make object sphere 1,5
make object box 2,2,2,2
`create money
make object sphere 3,2
`position objects
position object 1,player_x#,player_y#,player_z#
position object 2,10,0,10
position object 3,-10,0,5
`colour house and money
color object 2,rgb(255,0,0)
color object 3,rgb (50,0,0)
do
`move player
if upkey()=1
player_z#=player_z#+player_z_speed#
camera_z#=camera_z#+camera_z_speed#
endif
if downkey()=1
player_z#=player_z#-player_z_speed#
camera_z#=camera_z#-camera_z_speed#
endif
if leftkey()=1
player_x#=player_x#-player_x_speed#
camera_x#=camera_x#-camera_x_speed#
endif
if rightkey()=1
player_x#=player_x#+player_x_speed#
camera_x#=camera_x#+camera_x_speed#
endif
position object 1,player_x#,player_y#,player_z#
`collision with house
if object collision (1,2)
text 10,50,"The Door is Locked"
endif
`pick-up money
if object exist (3)
if object collision (1,3) and collected=0
money=money+10
collected=1
delete object 3
collected=0
endif
endif
`position camera
position camera camera_x#,camera_y#,camera_z#
rotate camera 40,0,0
`print info
text 10,10,"player_x#"+str$(player_x#)
text 10,60,"Gil "+str$(money)
loop
end
function camerachange()
if spacekey()=1 and VARcamerachange=0
position camera player_x#,player_y#+4,player_z#-10
rotate camera 0,0,0
endif
endfunction
* DBP_NETLIB_v1.4.3 - July, 2004 * Click Logo