Posted: 7th Dec 2003 19:54
this is a simple split screen demo thing i made coz i was bord.
it shows a mario cart style split screen showing 2 diffrent object views.

i hope this code is usefull to someone im not shure if it has any practical use but hay i was bord any hows hope you all like it
please comment on it coz this is my first code post thanx
Posted: 8th Dec 2003 2:42
Very nice. I tested and it worked fine in DBP also.

Posted: 8th Dec 2003 6:18
thanx "yellow" glad you liked it. it was the only way i could think of making some kind of split screen since theres only one camera available in dbc. i havent tested it in a game yet so if some one dose please post i would like to see how it compairs to a split screen in dbpro thanx i will be doing a better demo of the split screen thingy when i get 5 an post it as soon as i can
Posted: 13th Dec 2003 18:58
I am making a game now with your split screen code
kind of 1st person shooting game.
Posted: 13th Dec 2003 20:16
I've improved your code You can control one camera now.

+ Code Snippet
`                 *************************************
`                 * split screen demo by dancedreemer *
`                 *    improved by jopie dopie        *  
`                 *************************************

`split screen demo shows how to make the camera see in diffrent directions
`   for games like mario cart ect... or any multiplayer style games :)


`set up screen
sync on

`set sync rate to zero
sync rate 0

`hide the mouse
hide mouse

`make,color and position object 1
make object cube 1,10
color object 1,rgb(255,0,0)
position object 1,120,0,0

`same as above but for object 2
make object cone 2,10
color object 2,rgb(0,255,0)
position object 2,100,1,0


`make the cam object
make object cube 3,10
color object 3,rgb(123,0,255)

`get objects current y angle
a# = object angle y(1)
b# = object angle y(2)
cam2x#=70

`start the loop
do

`desplay title
set text font "arial black"
set text size 30
ink rgb(0,255,0),0
text 80,0,"SPLIT SCREEN DEMO BY DANCEDREEMER"
text 80,20,"     IMPROVED BY JOPIE DOPIE"
`set up pivot point
fix object pivot 1
fix object pivot 2

`spin the objects in opposite directions
yrotate object 1,wrapvalue(a#+1)
yrotate object 2,wrapvalue(b#-1)

`position and point the first view camera
position camera 100,80,80
point camera 100,0,0
set camera view 320,0,640,239

`control the second camera
if upkey()=1 then cam2x#=newxvalue(cam2x#,yr#,2):cam2z#=newzvalue(cam2z#,yr#,2) 
if downkey()=1 then cam2x#=newxvalue(cam2x#,yr#,-2):cam2z#=newzvalue(cam2z#,yr#,-2) 
if leftkey()=1 then yr#=wrapvalue(yr#-3)
if rightkey()=1 then yr#=wrapvalue(yr#+3)

`position and point the second view camera
xrotate camera 0
position camera cam2x#,0,cam2z#
position object 3,cam2x#,0,cam2z#
yrotate object 3,yr#
yrotate camera yr#
set camera view 320,240,640,480



`syncronize
sync

`loop it
loop
Posted: 13th Dec 2003 22:35
Really cool, I did post a multiple camera post for DBC a while ago, but I was using 2 syncs, I didn't know you could do it with only the one. Well done. The only problem is that it lacks the ability to change the camera aspect ratio, so you cant have 2 cameras taking up the whole screen like most games, unless you want it to look stretched.
Posted: 13th Dec 2003 23:19
yer i tryed to sort that out but i could never get it right its probley why thay improved it in dbpro so it would be possable to get the aspect ratio right

*Jopie dopie* cool i like the improvements on the code i was gonna do somethin simler in a better demo of it but it seems i dont need to now he he he

p.s could you send me a demo or somthin of ur game please i would love to see the code in action if possable thanx ))
Posted: 14th Dec 2003 0:09
yes i can, but there are two problems. problem 1: Each player hase a gun(the gun is just an image that i paste in the loop), by player 2 is the gun flickering. problem 2: sometimes the game crashes, my pc: asus 2.4 ghz 512 mb ram geforce 4 Ti, so that's a little weird. i'll hope you understand me what i mean, i not good in english so. here is a screenie from my game:



dont see?
http://www.geocities.com/darkbasicgast/snapshot72.JPG
right click, save as

cheers
Posted: 14th Dec 2003 3:57
Ziet er goed uit Jopie! Ik ben ook bezig met een fps, maar ik kom nie echt ver. Als je kogels gebruikt (objects) dan heb je redelijk veel problemen. (ik in ieder geval) Weet jij hoe je al van tevoren kan uitrekenen waar de kogel zou komen?
Posted: 14th Dec 2003 14:55
nee ik ben daar ook niet goed in, in kogels maken. maar ik heb er een ander truukje voor:
zet ergens in de loop:

if spacekey()=1 (spacekey is in dit geval de schietknop)
if object screen x(typ hier de enemy) > 300 and object screen x(typ hier de enemy) < 340
if object screen y(typ hier de enemy) > 220 and object screen y(typ hier de enemy) < 260
hier kan je dan typen dat die enemy gikilled word etc.
endif
endif
endif

je moet wel een screen res van 640 * 480 gebruiken anders moet je die getallen ff veranderen. veel suc6. zeg maar als je het niet begrijpt, k leg het je dan wel beter uit
Posted: 14th Dec 2003 15:48
yes i can, but there are two problems. problem 1: Each player hase a gun(the gun is just an image that i paste in the loop), by player 2 is the gun flickering.


check that ther is no second sync command in between the two set camera commands because it will cause the second camera view to flicker "see source" not shure if this is ur prob but i hope it helps

not shure on your second prob i have a 2.66gh with 256 maybe its a bug with dbc not shure

btw the game looks wicked thanx for the screen shot look forward to seeing the finished game