write programs. running the compiler. bang. and departure without messages
REM Project: simple fps game
REM Created: 26.09.2018 15:03:48
REM
REM ***** Main Source File *****
REM
`#INCLUDE "compass.dba"
`#INCLUDE "menugame.dba"
sync on
sync rate 60
rem Choose better display mode
if check display mode(1024,768,32)=1
set display mode 1024,768,32
else
if check display mode(1024,768,16)=1
set display mode 1024,768,16
endif
endif
`` loadcloud---------------------------------------------------------------
dc set cloudy 0.5
rem clouds at 3 km
dc set cloud height 3
rem set sky brightness to 1
brightness#=1.0
dc set brightness brightness#
rem adjust brightness based on time of day
dc set auto brightness 1
rem set wind to 30 mph at 270 degrees (heading west)
dc set wind 30,270
rem init with texture number 1, and number of keyframes per day
dc init 1,10
rem put clouds at 3km altitude
dc set cloud height 3.0
rem starting at 7am
time#=7.0
rem the update command creates the cloud texture
dc update time#
rem show texture 1 as the backdrop
texture backdrop 1
``---------------------------------------------------------------------------
global flor
global image_flor
flor=free_object()
image_flor=free_image()
global compass
global compass_image
compass=free_object()
compass_image=free_image()
global arrow
global arrow_image
arrow=free_object()
arrow_image=free_image()
`----------------------------------------------------------------------------
global new_game_image
global new_game_sprite
global options_image
global options_sprite
global exit_image
global exit_sprite
global mouse_image
global mouse_sprite
new_game_image=free_image()
new_game_sprite=free_sprite()
options_image=free_image()
options_sprite=free_sprite()
exit_image=free_image()
exit_sprite=free_sprite()
mouse_image=free_image()
mouse_sprite=free_sprite()
global click
click=2
`---------------------------------------------------------------------------
`AUTOCAM OFF
position camera 0,30,0
point camera 0,30,11
SET CAMERA RANGE 1, 10000
make object box flor,100000,1,100000
position object flor,0,-10,0
set object specular flor,0
load image "files/flor/grass.dds",image_flor
texture object flor,image_flor
SCALE OBJECT TEXTURE flor, 1000, 1000
FOG OFF
position light 0,0,10000,0
SET LIGHT RANGE 0, 2000000
dim tree(1000)
`load_compass()
load_tactical_radar()
load_test_objects()
load_tree()
load_menu_game()
`loop music 1
do
move_test_objects()
paste_tactical_radar()
control camera using arrowkeys 0,1,1
`paste_compass()
menu()
rem step through the day
time#=time#+100.0/(60.0*60.0*60.0)
rem update clouds
dc update time#
inc t
if t>20
paste_tree()
t=0
endif
set cursor 700,500
print SCREEN FPS()
sync
loop
function load_menu_game()
`load music "files/menu/title.mp3",1
load sound "files/menu/ClickLight.wav",click
load image "files/menu/NEW_GAME.png",new_game_image
load image "files/menu/options.png",options_image
load image "files/menu/exit.png",exit_image
sprite new_game_sprite,100,100,new_game_image
sprite options_sprite,100,300,options_image
sprite exit_sprite,100,500,exit_image
load image "files/menu/mouse.png",mouse_image
sprite mouse_sprite,-10,-10,mouse_image
endfunction
function menu()
PASTE SPRITE new_game_sprite, 100, 100
PASTE SPRITE options_sprite, 100, 300
PASTE SPRITE exit_sprite, 100, 500
PASTE SPRITE mouse_sprite, mousex(), mousey()
if SPRITE COLLISION(new_game_sprite, mouse_sprite)=1 and MOUSECLICK()=1
play sound click
endif
if SPRITE COLLISION(options_sprite, mouse_sprite)=1 and MOUSECLICK()=1
play sound click
endif
if SPRITE COLLISION(exit_sprite, mouse_sprite)=1 and MOUSECLICK()=1
play sound click
endif
endfunction
function load_tree()
tree(1)=free_object()
load object "files\tree\tree1.x",tree(1)
`load object "media\fauna\tree\tree4.x",tree(1)
`SET OBJECT TRANSPARENCY tree(1),4
set object specular tree(1),0
SET ALPHA MAPPING ON tree(1), 99
`SET SHADOW SHADING ON tree(1)
position object tree(1),0,0,0
SET OBJECT LIGHT tree(1),0
for trees=2 to 100
tree(trees)=free_object()
load object "files\tree\tree1.x",tree(trees)
`load object "media\fauna\tree\TREE1.x",tree(trees)
`SET OBJECT TRANSPARENCY tree(trees),4
set object specular tree(trees),0
SET ALPHA MAPPING ON tree(trees),99
`SET SHADOW SHADING ON tree(trees)
position object tree(trees),5000-rnd(10000),0,5000-rnd(10000)
SET OBJECT LIGHT tree(trees),0
next trees
endfunction
function paste_tree()
for trees=2 to 100
SET SHADOW SHADING off tree(trees)
if abs(OBJECT POSITION X(tree(trees))-camera position x())<1000 and abs(OBJECT POSITION Z(tree(trees))-camera position Z())<1000
if OBJECT IN SCREEN(tree(trees))=1
if OBJECT SCREEN X(tree(trees))>100 and OBJECT SCREEN X(tree(trees))<924
SET SHADOW SHADING on tree(trees)
endif
endif
endif
next trees
endfunction
`--------------------------------------------------------------------------------------
function load_compass()
load image "files\compass\compass.png",compass_image
load image "files\compass\pointer.png",arrow_image
make object box compass,2,2,0.01
make object box arrow,0.14,0.7,0.01
position camera 0,0,0
point camera 0,0,-100
position object compass,-0.01,-0.02,-10
position object arrow ,0,0,-5
texture object compass,compass_image
texture object arrow,arrow_image
SET OBJECT TRANSPARENCY compass,1
SET OBJECT TRANSPARENCY arrow,1
SET OBJECT LIGHT arrow,0
SET OBJECT LIGHT compass,0
ENABLE OBJECT ZBIAS compass,1,0
ENABLE OBJECT ZBIAS arrow,1,0
endfunction
function paste_compass()
position object compass,camera position x(),camera position y(),camera position z()
position object arrow ,camera position x(),camera position y(),camera position z()
move camera 10
POINT OBJECT compass, camera position x(),camera position y(),camera position z()
POINT OBJECT arrow, camera position x(),camera position y(),camera position z()
move camera -10
move object compass,10
move object arrow,9
pitch object up compass,90
move object compass,5
pitch object up compass,-90
pitch object up arrow,90
move object arrow,4.52
pitch object up arrow,-90
turn object left compass,90
turn object left arrow,90
move object compass,7
move object arrow,6.3
turn object left compass,90
turn object left arrow,90
ROLL OBJECT LEFT 200,-CAMERA ANGLE Y()-180
endfunction
function load_tactical_radar()
rem make target reder
make object box 60,10,10,10
hide object 60
endfunction
function paste_tactical_radar()
move camera 0,10
position object 60,camera position x(),camera position y(),camera position z()
move camera 0,-10
point camera 0,object position x(41),object position y(41),object position z(41)
y1#=camera angle y()
point camera 0,object position x(40),object position y(40),object position z(40)
y2#=camera angle y()
point camera 0,object position x(60),object position y(60),object position z(60)
y0#=camera angle y()
y01#=y1#-y0#
y02#=y2#-y0#
if y02#<-180 then y02#=y02#+360
if y02#>180 then y02#=y02#-360
if y01#<-180 then y01#=y01#+360
if y01#>180 then y01#=y01#-360
set cursor 100,100
print y01#
print y02#
INK RGB(255,0,0),RGB(0,0,0)
LINE 1024/2+y01#,700,1024/2+y01#,750
LINE 1024/2+y02#,700,1024/2+y02#,750
INK RGB(255,255,0),RGB(0,0,0)
LINE 1024/2+1,700,1024/2+1,750
LINE 1024/2-1,700,1024/2-1,750
endfunction
function load_test_objects()
make object box 40,10,10,10
position object 40,100,0,100
make object box 41,10,10,10
position object 41,200,0,200
endfunction
function move_test_objects()
move object 41,10
turn object left 41,1
endfunction
`--------------------------------------------------------------------------------------
function free_object()
t=100
_label1:
if object exist(t)=1
t=t+1
goto _label1
endif
endfunction t
function free_image()
t=100
_label2:
if image exist(t)=1
t=t+1
goto _label2
endif
endfunction t
function free_sprite()
t=100
_label3:
if sprite exist(t)=1
t=t+1
goto _label3
endif
endfunction t
can someone help you find a bug? I copied everything from scratch. nothing helps.