Im making a top view 3d arcade style kinda game...
I want colorfull effects in the game. fe the mousepointer and the player are followed by a light.
But the lights have almost no effect. I tried playing around with the ambient settings but that didnt change much.
I want it to be dark where there is no light. But even with ambient=0 everything is still litt.
So, how can i make the 3d space completely dark where there are no lights ?
the lightning code are at lines 37-53 and 647-663
sync on
hide mouse
sync rate 60
set display mode 1024,768,32
rem -------- make rnd texture for testing
for a=1 to 4
for b=1 to 4
ink rgb(rnd(255),rnd(255),rnd(255)),1
box -64+a*64,-64+b*64,a*64,b*64
next a
next b
get image 1,0,0,256,256
rem ------ make matrix
make matrix 1,2000,2000,25,25
' randomize matrix 1,20
prepare matrix texture 1,1,2,2
rem set these vars as globals
rem they or called in loop function and come from a copied funtion
rem to determine mouse position in 3d
global mouse3d_x#
global mouse3d_y#
global mouse3d_z#
backdrop on
color backdrop RGB(0,0,0)
rem light settings
COLOR AMBIENT LIGHT RGB(255,255,255)
SET AMBIENT LIGHT 10
rem player headlights
MAKE LIGHT 1
show LIGHT 1
set light range 1,500
COLOR LIGHT 1, rgb(0,0,255)
rem make test cube on light position
make object cube 2001, 10
color object 2001, rgb(0,0,255)
rem mouse light
MAKE LIGHT 2
show LIGHT 2
set light range 2,1000
COLOR LIGHT 2, rgb(255,0,0)
rem make test cube on light position
make object cube 2002, 10
color object 2002, rgb(255,0,0)
rem --- setup some vars
rem cam focal
FOV#=60
rem cam range
camr#=10000
rem original speed, user for turbo/shift key
rem should be identical to speed#, since bad coding
original_speed#=5
rem actual speed
speed#=5
rem player start pos
posx#=500.0
posz#=500.0
nr_kills# = 0
rem hud font
SET TEXT SIZE 20
set text to bold
ink rgb(255,0,0),rgb(255,0,0)
rem ------- cam setup
set camera fov FOV#
rem pov cam
MAKE CAMERA 2
SET CAMERA VIEW 2, 40, screen height()-100, 165, screen height()-5
color backdrop 2, RGB(0,0,0)
rem turret cam
MAKE CAMERA 3
SET CAMERA VIEW 3, 190, screen height()-100, 315, screen height()-5
color backdrop 3, RGB(0,0,0)
rem mouse cam
MAKE CAMERA 4
SET CAMERA VIEW 4, 340, screen height()-100, 465, screen height()-5
color backdrop 4, RGB(0,0,0)
rem overview cam
MAKE CAMERA 5
SET CAMERA VIEW 5, 490, screen height()-100, 615, screen height()-5
color backdrop 5, RGB(0,0,0)
rem Make walls
make object box 10, 2000, 100, 5
SET OBJECT LIGHT 10, 1
position object 10, 1000, 0, 0
make object box 11, 2000, 100, 5
SET OBJECT LIGHT 11, 1
position object 11, 1000, 0, 2000
make object box 12, 5, 100, 2000
SET OBJECT LIGHT 12, 1
position object 12, 2000, 0, 1000
make object box 13, 5, 100, 2000
SET OBJECT LIGHT 13, 1
position object 13, 0, 0, 1000
REM ------ bullets setup
rem starting from 0 !!
max_bullets_on_screen# = 99
bullets_on_screen# = 0
bullets_until_reload# = 9999
bullets_until_reload_count# = 0
time_between_bullets# = 250
bullet_life# = 3000
time_since_last_bullet# = timer()
bullet_id# = 0
bullet_speed# = 20
dim bullet$(100,6)
rem make bullets and put them in objects 100 to 199
for i=0 to max_bullets_on_screen#
objid# = 100+bullet_id#
make object box objid#,1,1,50
color object objid#, rgb(255,0,0)
rem ghost object on objid#,0
bullet_id# = bullet_id# + 1
bullet$(i,0) = str$(0)
bullet$(i,1) = "setup"
bullet$(i,2) = "niks"
bullet$(i,3) = "x"
bullet$(i,4) = "y"
bullet$(i,5) = "z"
set object collision on objid#
set object collision to boxes objid#
make particles objid#,1,10,30.0
set particle life objid#,5
set particle velocity objid#, 10
SET PARTICLE EMISSIONS objid#, 1
SET PARTICLE GRAVITY objid#, 0
SET PARTICLE SPEED objid#, 0.01
SET PARTICLE CHAOS objid#, 0
hide particles objid#
next i
rem bullet_id setting to zero again just to be safe
bullet_id# = 0
rem ------- end bullets setup
rem Make enemies
enemies_on_screen# = 0
rem starting from 0 !!
max_enemies_on_screen# = 50
dim enemy$(100,3)
dim health_enemy(100)
for i=0 to max_enemies_on_screen#
objid# = 900+i
make object cube objid#,50
SET OBJECT LIGHT objid#, 1
color object objid#,rgb(255,0,0)
position object objid#, rnd(2000),25,rnd(2000)
enemy$(i,1) = "alive"
enemy$(i,2) = str$(timer())
enemy$(i,3) = "onscreen"
enemy$(i,4) = str$(100)
health_enemy(i) = 100
set object collision on objid#
set object collision to boxes objid#
enemies_on_screen# = enemies_on_screen# + 1
next i
rem Make powerups
dim powerup$(100,3)
for i=0 to 10
rem health powerups
objid# = 500+i
make object cube objid#,20
color object objid#,rgb(0,255,0)
position object objid#, rnd(2000),10,rnd(2000)
rem health powerup
powerup$(i,1) = str$(75)
powerup$(i,2) = "health"
powerup$(i,4) = "waiting"
set object collision on objid#
set object collision to boxes objid#
next i
for i=11 to 20
rem speed powerups
objid# = 500+i
make object cube objid#,20
color object objid#,rgb(0,0,255)
position object objid#, rnd(2000),10,rnd(2000)
rem health powerup
powerup$(i,1) = str$(50)
powerup$(i,2) = "weapon_rate"
powerup$(i,3) = "waiting"
set object collision on objid#
set object collision to boxes objid#
next i
for i=21 to 30
rem speed powerups
objid# = 500+i
make object cube objid#,20
color object objid#,rgb(0,255,255)
position object objid#, rnd(2000),10,rnd(2000)
rem health powerup
powerup$(i,1) = str$(20)
powerup$(i,2) = "bullet_speed"
powerup$(i,3) = "waiting"
set object collision on objid#
set object collision to boxes objid#
next i
rem Make player
dim player(4)
rem health
player(4) = 100
make object box 1,30,10,100
color object 1,rgb(0,0,255)
rem front
make object box 50,15,5,15
MAKE MESH FROM OBJECT 20, 50
delete object 50
ADD LIMB 1, 1, 20
delete mesh 20
show limb 1, 1
COLOR LIMB 1, 1, RGB(0,255,0)
SCALE LIMB 1, 1, 100, 100, 100
OFFSET LIMB 1, 1, 0,0,50
rem back
make object box 50,25,4,4
MAKE MESH FROM OBJECT 20, 50
delete object 50
ADD LIMB 1, 2, 20
delete mesh 20
show limb 1, 2
COLOR LIMB 1, 2, RGB(255,0,0)
SCALE LIMB 1, 2, 100, 100, 100
OFFSET LIMB 1, 2, 0,5,-50
rem wheel left front
make object sphere 50,20
MAKE MESH FROM OBJECT 20, 50
delete object 50
ADD LIMB 1, 3, 20
delete mesh 20
show limb 1, 3
COLOR LIMB 1, 3, RGB(255,0,0)
SCALE LIMB 1, 3, 100, 100, 100
OFFSET LIMB 1, 3, -10,-6,30
rem wheel right front
make object sphere 50,20
MAKE MESH FROM OBJECT 20, 50
delete object 50
ADD LIMB 1, 4, 20
delete mesh 20
show limb 1, 4
COLOR LIMB 1, 4, RGB(255,0,0)
SCALE LIMB 1, 4, 100, 100, 100
OFFSET LIMB 1, 4, 10,-6,30
rem wheel left back
make object sphere 50,20
MAKE MESH FROM OBJECT 20, 50
delete object 50
ADD LIMB 1, 5, 20
delete mesh 20
show limb 1, 5
COLOR LIMB 1, 5, RGB(255,0,0)
SCALE LIMB 1, 5, 100, 100, 100
OFFSET LIMB 1, 5, -10,-6,-30
rem wheel right back
make object sphere 50,20
MAKE MESH FROM OBJECT 20, 50
delete object 50
ADD LIMB 1, 6, 20
delete mesh 20
show limb 1, 6
COLOR LIMB 1, 6, RGB(255,0,0)
SCALE LIMB 1, 6, 100, 100, 100
OFFSET LIMB 1, 6, 10,-6,-30
rem end make player
rem Make turret
make object box 2,10,10,15
color object 2,rgb(255,0,0)
make object box 50,5,5,40
MAKE MESH FROM OBJECT 20, 50
delete object 50
ADD LIMB 2, 1, 20
delete mesh 20
show limb 2, 1
COLOR LIMB 2, 1, RGB(255,0,0)
SCALE LIMB 2, 1, 100, 100, 100
OFFSET LIMB 2, 1, 0,0,25
rem make mouse
make object sphere 3,20
make object box 50,5,150,5
rem stickpointer
MAKE MESH FROM OBJECT 20, 50
delete object 50
ADD LIMB 3, 1, 20
delete mesh 20
show limb 3, 1
SCALE LIMB 3, 1, 100, 100, 100
OFFSET LIMB 3, 1, 0,25,0
ghost object on 3,3
rem make pointer outside of matrix, extending turret
make object sphere 4,1
hide object 4
rem Begin main loop
rem -------------------------------------------
do
rem call 3dmouse positioning function, copied from codebase
mmcoord(mousex(),mousey(),1,camr#,FOV#)
rem ------- Controls
rem forwards (z) (azerty layout)
if keystate(17)=1 or upkey()=1
posx#=newxvalue(posx#, angle#, speed#)
posz#=newzvalue(posz#, angle#, speed#)
endif
rem backwards (s) (azerty layout)
if keystate(31)=1 or downkey()=1
posx#=newxvalue(posx#, angle#, 0-(speed#/3))
posz#=newzvalue(posz#, angle#, 0-(speed#/3))
endif
rem left (q) (azerty layout)
if keystate(30)=1 or leftkey()=1
angle#=wrapvalue(angle#-(speed#/2))
rem also move forward for carlike controls
posx#=newxvalue(posx#, angle#, speed#/5)
posz#=newzvalue(posz#, angle#, speed#/5)
endif
rem right (d) (azerty layout)
if keystate(32)=1 or rightkey()=1
angle#=wrapvalue(angle#+(speed#/2))
rem also move forward for carlike controls
posx#=newxvalue(posx#, angle#, speed#/5)
posz#=newzvalue(posz#, angle#, speed#/5)
endif
rem strafe links (a) (azerty layout)
if keystate(16)=1
posx#=newxvalue(posx#, angle#-90, speed#/3)
posz#=newzvalue(posz#, angle#-90, speed#/3)
endif
rem strafe rechts (e) (azerty layout)
if keystate(18)=1
posx#=newxvalue(posx#, angle#+90, speed#/3)
posz#=newzvalue(posz#, angle#+90, speed#/3)
endif
REM start shift/turbo check
if shiftkey()=1
if turbo# = 0
speed# = speed#*2
turbo# = 1
endif
endif
if shiftkey()=0
turbo# = 0
speed# = original_speed#
endif
REM end shift/turbo check
rem end controls
rem a temp solution for rightmouse+space bug
if bullets_on_screen# > max_bullets_on_screen#
bullets_on_screen# = max_bullets_on_screen#
endif
if bullets_on_screen# < 0
bullets_on_screen# = 0
endif
rem start bullet check
for i=0 to max_bullets_on_screen#
objid# = 100+i
if object exist(objid#) = 1
if bullet$(i,1) = "fired"
if val(bullet$(i,0)) < timer() - bullet_life#
rem if old bullet kill it
hide object objid#
hide particles objid#
bullets_on_screen# = bullets_on_screen# - 1
bullet$(i,1) = "hidden"
else
rem if active bullet do the following
move object objid#, bullet_speed#
position particles objid#, object position x(objid#),object position y(objid#),object position z(objid#)
if object collision (objid#,0)
obj_hit# = object collision (objid#,0)
if obj_hit# > 899 AND 1000 > obj_hit#
rem if enemy
obj_hit_id = obj_hit# - 900
enemy$(obj_hit_id,1) = "hit"
hide object objid#
hide particles objid#
set object collision off objid#
bullets_on_screen# = bullets_on_screen# - 1
bullet$(i,1) = "hidden"
endif
if 14 > obj_hit# AND obj_hit# > 9
rem if wall
hide object objid#
hide particles objid#
set object collision off objid#
bullets_on_screen# = bullets_on_screen# - 1
bullet$(i,1) = "hidden"
endif
endif
if object position x(objid#) > 2000
hide object objid#
hide particles objid#
set object collision off objid#
endif
if object position z(objid#) > 2000
hide object objid#
hide particles objid#
set object collision off objid#
endif
if object position x(objid#) < 0
hide object objid#
hide particles objid#
set object collision off objid#
endif
if object position z(objid#) < 0
hide object objid#
hide particles objid#
set object collision off objid#
endif
endif
endif
if bullet$(i,1) = "setup"
hide object objid#
hide particles objid#
bullet$(i,1) = "hidden"
endif
endif
next i
rem end bullet check
rem start enemy check
for i=0 to max_enemies_on_screen#
objid# = 900+i
if object exist(objid#) = 1
if enemy$(i,1) = "hit"
health_enemy(i) = health_enemy(i) - 50
enemy$(i,1) = "alive"
rem endif enemy i,1 = hit
endif
if health_enemy(i) = 50
color object objid#, RGB(255,128,128)
rem endif enemy i,1 = hit
endif
if health_enemy(i) <= 0
enemy$(i,1) = "dead"
rem endif enemy i,1 = hit
endif
if enemy$(i,1) = "dead"
hide object objid#
set object collision off objid#
if enemy$(i,3) = "onscreen"
enemy$(i,3) = "hidden"
enemy$(i,2) = str$(timer())
health_enemy(i) = 100
color object objid#, RGB(255,0,0)
enemies_on_screen# = enemies_on_screen# - 1
nr_kills# = nr_kills# + 1
endif
if val(enemy$(i,2)) < timer() - 30000
show object objid#
set object collision on objid#
position object objid#, rnd(2000),25,rnd(2000)
enemy$(i,1) = "alive"
enemy$(i,3) = "onscreen"
enemies_on_screen# = enemies_on_screen# + 1
endif
rem endif enemy i,1 = dead
endif
if enemy$(i,1) = "alive"
point object objid#, object position x(2),object position y(2),object position z(2)
move object objid#, speed#/10
enemy_height# = 25+get ground height(1,object position x(objid#),object position z(objid#))
position object objid#,object position x(objid#),enemy_height#,object position z(objid#)
rem endif enemy i,1 = alive
endif
rem endif obj exist
endif
next i
rem end enemy check
rem start player check
if object collision (1,0)
obj_hit# = object collision (1,0)
if obj_hit# > 899
rem if enemy
player(4) = player(4) - 1
endif
if obj_hit# > 499 AND obj_hit# < 599
rem if enemy
obj_hit_id = obj_hit# - 500
if powerup$(obj_hit_id,2) = "health"
player(4) = player(4) + val(powerup$(obj_hit_id,1))
endif
if powerup$(obj_hit_id,2) = "weapon_rate"
time_between_bullets# = time_between_bullets# - val(powerup$(obj_hit_id,1))
if time_between_bullets# < 75
time_between_bullets# = 75
endif
endif
if powerup$(obj_hit_id,2) = "bullet_speed"
bullet_speed# = bullet_speed# + val(powerup$(obj_hit_id,1))
if bullet_speed# > 100
bullet_speed# = 100
endif
endif
hide object obj_hit#
set object collision off obj_hit#
endif
endif
rem end player check
if player(4) <= 0
player(4) = 0
text 250, 100, "health = 0 !!"
endif
if enemies_on_screen# = 0
text 250, 75, "u killed em all !!!! but theyll respawn"
endif
rem mouseclick for bullets
if mouseclick()=1 or spacekey()=1
text 400,0, "left mouse button"
if bullets_until_reload_count# < bullets_until_reload#
if time_since_last_bullet_fired# < timer() - time_between_bullets#
bullet_id# = bullet_id# + 1
bullets_on_screen# = bullets_on_screen# + 1
if bullet_id# > max_bullets_on_screen#
bullet_id# = 0
endif
objid# = 100+bullet_id#
crap = bullet_id#
if bullet$(crap,1) = "fired"
rem search for next non-fired bullet
endif
bullet$(crap,0) = str$(timer())
bullet$(crap,1) = "fired"
bullet$(crap,3) = str$(object position x(4))
bullet$(crap,4) = str$(object position y(4))
bullet$(crap,5) = str$(object position z(4))
show object objid#
set object collision on objid#
position object objid#, limb position x(2,1), limb position y(2,1), limb position z(2,1)
point object objid#, mouse3d_x#,object position y(2),mouse3d_z#
show particles objid#
position particles objid#, object position x(2),object position y(2),object position z(2)
rotate particles objid#, -90,object angle y(2),object angle z(2)
remstart check between turret and mousepointer
for i=900 to 999
if intersect object (i, object position x(2),object position y(2),object position z(2), mouse3d_x#,mouse3d_y#,mouse3d_z#) > 0
text 10, 240, "HIT : "+str$(i)+" at : "+str$(intersect object (i, object position x(2),object position y(2),object position z(2), mouse3d_x#,mouse3d_y#,mouse3d_z#))
hide object i
endif
next i
remend
remstart check between turret and obj4 being extended turret outside of matrix
for i=900 to 999
if enemy$(i-900,1) = "alive"
if intersect object (i, object position x(2),object position y(2),object position z(2), object position x(4),object position y(4),object position z(4)) > 0
text 10, 240, "HIT : "+str$(i)+" at : "+str$(intersect object (i, object position x(2),object position y(2),object position z(2), object position x(4),object position y(4),object position z(4)))
hide object i
enemy$(i-900,1) = "dead"
enemy$(i-900,2) = str$(timer())
endif
endif
next i
remend
time_since_last_bullet_fired# = timer()
bullets_until_reload_count# = bullets_until_reload_count# + 1
endif
endif
endif
if mouseclick()=2
text 400,0, "right mouse button"
rem rightmouse button reload
bullets_until_reload_count# = 0
endif
if mouseclick()=4
text 400,0, "middle mouse button"
endif
rem groundheight under player
ground#=get ground height(1,posx#,posz#)+5
rem update player
if posx# >= 2000 then posx# = 2000
if posx# <= 0 then posx# = 0
if posz# >= 2000 then posz# = 2000
if posz# <= 0 then posz# = 0
position object 1,posx#,ground#+5,posz#
yrotate object 1,angle#
rem update turret
position object 2,object position x(1),ground#+15,object position z(1)
point object 2, mouse3d_x#,ground#+15,mouse3d_z#
rem update lights
rem player headlights
ROTATE LIGHT 1, object angle x(1),object angle y(1),object angle z(1)
position LIGHT 1, object position x(2),object position y(2)+10,object position z(2)
rem position test cube on light position
ROTATE object 2001, object angle x(1),object angle y(1),object angle z(1)
position object 2001, object position x(2),object position y(2)+10,object position z(2)
rem mouse light
ROTATE LIGHT 2, 90,0,0
position LIGHT 2, object position x(3),object position y(3)+25,object position z(3)
rem position test cube on light position
ROTATE object 2002, 90,0,0
position object 2002, object position x(3),object position y(3)+25,object position z(3)
rem end lights ---------
rem update mousebox
border_mouse3d_x# = mouse3d_x#
border_mouse3d_y# = mouse3d_y#
border_mouse3d_z# = mouse3d_z#
if border_mouse3d_x# >= 2000 then border_mouse3d_x# = 2000
if border_mouse3d_x# <= 0 then border_mouse3d_x# = 0
if border_mouse3d_z# >= 2000 then border_mouse3d_z# = 2000
if border_mouse3d_z# <= 0 then border_mouse3d_z# = 0
position object 3, border_mouse3d_x#,border_mouse3d_y#,border_mouse3d_z#
circle mousex(),mousey(),2
rem pointer_border_mouse3d_x# = mouse3d_x#
rem pointer_border_mouse3d_y# = mouse3d_y#
rem pointer_border_mouse3d_z# = mouse3d_z#
rem if pointer_border_mouse3d_x# >= 2000 then pointer_border_mouse3d_x# = 2000
rem if pointer_border_mouse3d_x# <= 0 then pointer_border_mouse3d_x# = 0
rem if pointer_border_mouse3d_z# >= 2000 then pointer_border_mouse3d_z# = 2000
rem if pointer_border_mouse3d_z# <= 0 then pointer_border_mouse3d_z# = 0
rem position object 4, pointer_border_mouse3d_x#,pointer_border_mouse3d_y#,pointer_border_mouse3d_z#
position object 4,object position x(1),ground#+15,object position z(1)
point object 4, mouse3d_x#,ground#+15,mouse3d_z#
move object 4, 2000+50
rem cam1
camposition# = mousez()
if camposition# < -240 then camposition# = -240
if camposition# = -240
new_cam1x# = 200
new_cam1y# = 100
new_cam1z# = 200
endif
if camposition# = -120
new_cam1x# = 200
new_cam1y# = 200
new_cam1z# = 200
endif
if camposition# = 0
new_cam1x# = 200
new_cam1y# = 400
new_cam1z# = 200
endif
if camposition# = 120
new_cam1x# = 200
new_cam1y# = 600
new_cam1z# = 200
endif
if camposition# = 240
new_cam1x# = 200
new_cam1y# = 800
new_cam1z# = 200
endif
if camposition# = 360
new_cam1x# = 200
new_cam1y# = 1000
new_cam1z# = 200
endif
if camposition# = 480
new_cam1x# = 200
new_cam1y# = 1200
new_cam1z# = 200
endif
if camposition# = 600
new_cam1x# = 200
new_cam1y# = 1400
new_cam1z# = 200
endif
if camposition# = 720
new_cam1x# = 1000
new_cam1y# = 100
new_cam1z# = 1000
endif
if camposition# = 840
new_cam1x# = 1000
new_cam1y# = 200
new_cam1z# = 1000
endif
if camposition# = 960
new_cam1x# = 1000
new_cam1y# = 400
new_cam1z# = 1000
endif
if camposition# = 1080
new_cam1x# = 1000
new_cam1y# = 600
new_cam1z# = 1000
endif
if camposition# = 1200
new_cam1x# = 1000
new_cam1y# = 800
new_cam1z# = 1000
endif
if camposition# = 1320
new_cam1x# = 1000
new_cam1y# = 1000
new_cam1z# = 1000
endif
if camposition# = 1480
new_cam1x# = 1000
new_cam1y# = 1200
new_cam1z# = 1000
endif
if camposition# > 1320
new_cam1x# = 1000
new_cam1y# = camposition#
new_cam1z# = 1000
endif
if camposition# > 2640
new_cam1x# = 1000
new_cam1y# = 2640
new_cam1z# = 1000
endif
position camera new_cam1x#,new_cam1y#,new_cam1z#
POINT CAMERA posx#,posy#,posz#
rem cam2
text 50, screen height()-100, "pov cam"
set camera to follow 2, object position x(1), object position y(1), object position z(1), object angle y(1), 1, 40, 2, 1
rem cam3
position camera 3,posx#,posy#+ground#+40,posz#
point camera 3, mouse3d_x#,mouse3d_y#+10,mouse3d_z#
text 200, screen height()-100, "turret cam"
rem cam4
position camera 4, mouse3d_x#,250,mouse3d_z#
POINT CAMERA 4, mouse3d_x#,mouse3d_y#+10,mouse3d_z#
text 500, screen height()-100, "overview cam"
rem cam5
position camera 5, 1000,500,1000
POINT CAMERA 5, posx#,posy#,posz#
text 350, screen height()-100, "mouse cam"
text 10, 0, "fps : "+STR$(SCREEN FPS())
text 10, 15, "max_bullets_on_screen: "+str$(bullets_on_screen#)+"/"+str$(max_bullets_on_screen#)
text 10, 30, "reload: "+str$(bullets_until_reload_count#)+"/"+str$(bullets_until_reload#)
text 10, 45, "bullet_id#: "+str$(bullet_id#)
text 10, 60, "enemies :"+str$(enemies_on_screen#)+"/"+str$(max_enemies_on_screen#)
text 10, 75, "nr_kills: "+str$(nr_kills#)
text 10, 90, "mousex: "+str$(mousex())
text 10, 105, "mousey: "+str$(mousey())
text 10, 120, "mousez: "+str$(mousez())
text 10, 135, "mouse3d_x: "+str$(mouse3d_x#)
text 10, 150, "mouse3d_y: "+str$(mouse3d_y#)
text 10, 165, "mouse3d_z: "+str$(mouse3d_z#)
text 10, 180, "posx: "+str$(posx#)
text 10, 195, "posy: "+str$(posy#)
text 10, 210, "posz: "+str$(posz#)
text 10, 225, "timer: "+str$(timer())
text 10, 240, " "
text 10, 255, "time_between_bullets#"+str$(time_between_bullets#)
text 10, 270, "bullet_speed#"+str$(bullet_speed#)
text 10, 285, " "
text 10, 300, " "
text 10, 315, "health: "+str$(player(4))
rem Update Screen
sync
loop
function mmcoord(scrx#,scry#,matnum,r#,FOV#)
ax#=camera angle x()
ay#=camera angle y()
scrw#=screen width()
scrh#=screen height()
hmax# = r#*tan(FOV#/2)
mh# = (((scrh#/2-scry#)*2)/scrh#)*hmax#
wmax# = r#*scrw#/scrh#*tan(FOV#/2)
mw# = (((scrx#-scrw#/2)*2)/scrw#)*wmax#
cl# = r#*cos(ax#)
ch# = -r#*sin(ax#)
sl# = mh#*cos(90-ax#)
sh# = mh#*sin(90-ax#)
ox# = camera position x() + (cl#+sl#)*sin(ay#) + mw#*cos(ay#)
oy# = camera position y() + (ch#+sh#)
oz# = camera position z() + (cl#+sl#)*cos(ay#) - mw#*sin(ay#)
for i#=0 to 1 step (1.0/r#)
x# = camera position x() + (ox#-camera position x())*i#
y# = camera position y() + (oy#-camera position y())*i#
z# = camera position z() + (oz#-camera position z())*i#
if y#-get ground height(matnum,x#,z#)<=0
mouse3d_x#=x#
mouse3d_y#=y#
mouse3d_z#=z#
exitfunction
endif
next i#
endfunction
for realy viewable colorrays Ill have to use ghost objects, but thats not realy what I want (yet). I just want colors like 'discospots'. Colored planes on the floor arent good enough cause then the enemies top and sides wont be coloured
the code requires no media
other comments on code are welcome too...
ps : hiding objects which arent whithin a defined radius is not an option, cause the lighting settings need to be easily dynamicly changable.
(and im not english...)