hey, i'm trying to make it up to four players with menues and bosses!, its really hard but, hey i'm working on it. I'm making a function and then if you press 1 which is for two players then it uses the two player function. Heres the code right now. Don't bother playing it it doesnt work yet
remstart
beginning-finished 100% ammo- in progress- 10%
movementp1=finished- 100% movementp2=finished with glitches 90%
enemies=n/a-0% atmosphere=n/a-0%
pickups=n/a-5% units=10%
finished roughly 30%
remend
sync on
sync rate 100
autocam off
hide mouse
load image 1, "
`1st of all you need a camera, you can make a camera using the make camera command. The de-
`fault camera is 0 so you dont need to make a camera if you want to do 1p. If you want to
`resise or move the camera you can use the set camera view command. Here is an example
`set camera view 0,0,screen height(),screen width(),screen height() Now, if you wanted to m-
`ake that screen half the size then you simply add /2 after the (). Also, to move object you
`want, you dont always have to move the camera and object seperately like so
`if upkey=1 then move object 1, 5 and move camera 0, 5- you can simply use the following
`if upkey=1 then move camera 0, 5 : position object 1, camera position x, camera position y, camera position z
`You have to put the command in the do loop. The same can be used with angles and rotation
`using the camera angle x, y, and z instead of camera position. If you wanted a two player
`game then you would have to adjust the camera like so
`make camera 1:set camera view 0,0,screen height()/2,screen width(),screen height()
`set camera view 1,0,screen height(),screen width(),screen height()/2
ammoshotgun=10
ammopistol=50
ammomachinegun=40
ammobomb=3
health1p=1000
health2p=1000
healthzombie=1000
healthbug=100
healthboss=5000
function p3
make camera 1 : make camera 2
set camera view 1,0,screen height(),screen width(),screen height()/2
set camera view 2,screen width()/2,screen height()/2, screen width(), screen height()
set camera view 0, screen width(), screen height(), screen width(), screen height()/2
make object sphere 1, 50
make object sphere 2, 50
make object sphere 3, 50
x= camera angle x(0)
y= camera angle y(0)
z= camera angle z(0)
x#= camera position x(0)
y#= camera position y(0)
z#= camera position z(0)
x*= camera angle x(1)
y*= camera angle y(1)
z*= camera angle z(1)
x#*= camera position x(1)
y#*= camera position y(1)
z#*= camera position z(1)
x2=camera angle x(2)
y2=camera angle y(2)
z2=camera angle z(2)
Xpos=camera position x(2)
ypos=camera position y(2)
zpos=camera position z(2)
position object 1, x#, y#, z#:rotate object 1, x, y, z
position object 2, x#*, y#*, z#*:rotate object 2, x*, y*, z*
position object 3, xpos, ypos, zpos;rotate object 2, x2, y2, z2
endfunction
function p1
x= camera angle x(0)
y= camera angle y(0)
z= camera angle z(0)
x#= camera position x(0)
y#= camera position y(0)
z#= camera position z(0)
position object 1, x#, y#, z#
rotate object 1, x, y, z
control camera using arrowkeys 0,2,4
set camera view 0,0,screen height(),screen width(),screen height()
endfunction
function both players
`store positions
x= camera angle x(0)
y= camera angle y(0)
z= camera angle z(0)
x#= camera position x(0)
y#= camera position y(0)
z#= camera position z(0)
x*= camera angle x(1)
y*= camera angle y(1)
z*= camera angle z(1)
x#*= camera position x(1)
y#*= camera position y(1)
z#*= camera position z(1)
`movement and rotation
position object 1, x#, y#, z#
rotate object 1, x, y, z
rotate object 2, x*, y*, z*
position object 2, x#*, y#*, z#*
control camera using arrowkeys 0,2,2
` camera for two players
set camera view 1,0,0,screen width(),screen height()/2
set camera view 0,0,screen height()/2,screen width(),screen height()
center text screen width(), screen height()/2, "TWO PLAYER"
endfunction
if keystate(2)=1 then both players()=1
if keystate(3)=1 then p1()=1
if keystate(4)=1 then 3p()=1
if keystate(5)=1 then 4p()=1
if keystate(6)=1 then controls()=1
if keystate(7)=1 then enemy()=1
set cursor 0,0
print "Frames Per Second: ", screen fps()
center text 0, 50, "[1] Two Player"
center text 0, 100, "[2] One Player"
center text 0, 150, "[3] Three Player"
center text 0, 200, "[4] four player"
center text 0, 250, "[5] controls"
center text 0, 250, "[6] enemy info"
sync
loop
also dodic i could edit some of the code from db, just post it and i'll see what i can do. I may be kinda new to dbpro but im good.
There are only two types of people. The ones that agree with me and the ones that are wrong