Thanks razerx!
k, so heres an update... got some player movement done and some
physics!
REM DARKSUVIVAL
REM BY DD a.k.a StanasDude =======================================
REM ========================================
Rem NESSICARY CRAP.....
Sync on
Sync Rate 60
Randomize Timer()
`autocam off
REM DIM, VARIABLES,ETC.
Dim Cubes(1000,6)
rem Cubes(1000,1) = cube exist
rem Cubes(1000,2) = posx
rem Cubes(1000,3) = posy
rem Cubes(1000,4) = velx
rem Cubes(1000,5) = vely
rem Cubes(1000,6) = ???
Dim Player#(1,7)
rem Player(1,1) = Velx
rem Player(1,2) = Vely
rem Player(1,3) = ???
rem Player(1,4) = ???
rem Player(1,5) = ???
rem Player(1,6) = ???
State = 0
menuselc = 0
Start#=0.001
Current#=0.0
Max#=0.02
REM -----------Main Loop--------
do
select state
case 0 : gosub _dataload : endcase
case 1 : gosub _intro : endcase
case 2 : gosub _Mainmenu : endcase
case 3 : gosub Setup_Game: gosub Play_Game : endcase
endselect
sync
loop
_dataload:
rem build texture....
for x=1 to 50000
rem the red part of the color
myred=rnd(115)+50
rem the green part of the color
mygreen=95
rem the blue part of the color
myblue=85
ink rgb(myred,mygreen,myblue),1
Dot Rnd(64),Rnd(64)
next x
rem grab texture....
get image 101,0,0,64,64
cls
rem build texture....
for x=1 to 60000
rem the red part of the color
myred=18+rnd(40)
rem the green part of the color
mygreen=200+rnd(50)
rem the blue part of the color
myblue=rnd(50)+200
ink rgb(myred,mygreen,myblue),1
Dot Rnd(64),Rnd(64)
next x
rem grab texture....
get image 102,0,0,64,64
rem state change
state = 1
return
_intro:
make object sphere 1000,2
texture object 1000,101
findarnd=0
sclx#=0
scly#=0
repeat
if findarnd=0 then sclx#=Rnd(120)+30 : scly#=Rnd(120)+30 : findarnd=1
actualx#=curvevalue(sclx#,actualx#,6)
actualy#=curvevalue(scly#,actualy#,6)
if actualx# = sclx# then findarnd=0
if actualy# = scly# then findarnd=0
inc timer
if timer > 20 then findarnd=0: timer=0
inc timer2
if timer2 > 620 then f=1
scale object 1000,actualx#,actualy#,100
Ink RGB(255,255,255),1
CenteR TexT 250,270,"Yeah.........This games is by Stanas, a.k.a DD!"
sync
until f=1
delete object 1000
state = 2
return
_Mainmenu:
autocam off
make object cube 1000,6
color object 1000,Rgb(145,125,200)
ghost object on 1000
make object cube 1001,5
texture object 1001,102
make object cube 1002,5
texture object 1002,102
make object cube 1003,5
texture object 1003,102
make object cube 1004,5
texture object 1004,102
position object 1001,-18,0,0
position object 1002,-9,0,0
position object 1003,0,0,0
position object 1004,9,0,0
position camera 0,5,-25
point camera 0,0,0
camx#=0
camy#=5
camz#=-25
h#=100000
Repeat
h#=curvevalue(0,h#,9)
if leftkey()=1
if lftflg=0
dec menuselc
endif
lftflg=1
else
lftflg=0
endif
if rightkey()=1
if rgtflg=0
inc menuselc
endif
rgtflg=1
else
rgtflg=0
endif
if menuselc < 0 then menuselc=0
if menuselc > 3 then menuselc=3
if object exist(menuselc+1001)=1
objx#=object position x(menuselc+1001)
objy#=object position y(menuselc+1001)
objz#=object position z(menuselc+1001)
endif
dstx#=curvevalue(objx#,dstx#,6)
dsty#=curvevalue(objy#,dsty#,6)
dstz#=curvevalue(objz#,dstz#,6)
position object 1000,dstx#,dsty#,dstz#
camx#=curvevalue(objx#,camx#,6)
position camera camx#,camy#,camz#
point camera object position x(1000),0+h#,object position z(1000)
coll=object collision(1000,0)
select coll
case 1001 : Header$="Play" : Describe$="Play the Game!" : endcase
case 1002 : Header$="Options" : Describe$="Edit the Game options." : endcase
case 1003 : Header$="View" : Describe$="View High Scores!" : endcase
case 1004 : Header$="Exit" : Describe$="Exit The Game...." : endcase
endselect
if returnkey()=1
select coll
case 1001
state = 3
des=1
endcase
case 1002
end
endcase
case 1003
end
endcase
case 1004
end
endcase
endselect
endif
Text 50,20,"Stanazi's........DARKSUVIVAL!"
Center Text 270,320,Header$
Center Text 269,350,Describe$
sync
until des=1
return
Setup_Game:
For w=1 to 5000
if object exist(w)=1
delete object w
endif
next w
autocam off
rem Create player........
Make object sphere 1,1
texture object 1,101
position object 1,-18,3,0
REM Create Walls.....
Make object cube 1000,5
scale object 1000,400,70,50
position object 1000,-18,-1,0
texture object 1000,102
Make object cube 1001,5
scale object 1001,400,70,50
position object 1001,-27,3,0
zrotate object 1001,93
texture object 1001,102
`fix object pivot 1001
Make object cube 1002,5
scale object 1002,400,70,50
position object 1002,-8,3,0
zrotate object 1002,87
texture object 1002,102
position camera -18,5,-12
point camera object position x(1),object position y(1),object position z(1)
return
Play_Game:
repeat
incr=0
incr=Control_Player(current#,1)
if incr=>1 then current#=curvevalue(Max#,current#,140)
if incr=0 then current#=curvevalue(Start#,current#,2)
set cursor 1,1
print incr
sync
until done=1
return
Function Control_Player(sensitivitiy#,gravity)
Rem First get all input========
rite=0
left=0
move=0
If Rightkey()=1 then rite=1 : move=1
If leftkey()=1 then left=1 : move=1
Player#(1,3)=object position x(1)
Player#(1,4)=object position y(1)
if rite=1
Player#(1,1)=Player#(1,1)+sensitivitiy#
Player#(1,5)=Player#(1,5)-2
Player#(1,5)=Wrapvalue(Player#(1,5))
endif
if left=1
Player#(1,1)=Player#(1,1)-sensitivitiy#
Player#(1,5)=Player#(1,5)+2
Player#(1,5)=Wrapvalue(Player#(1,5))
endif
stopx#=Player#(1,1)
stopx#=curvevalue(0,stopx#,6)
Player#(1,1)=stopx#
Player#(1,3)=Player#(1,3)+stopx#
Player#(1,4)=Player#(1,4)+Player#(1,2)
if Player#(1,1) <> 0 and rite+left=0
if Player#(1,1) > 0.009 then Player#(1,5)=Player#(1,5)-2
if Player#(1,1) < -0.009 then Player#(1,5)=Player#(1,5)+2
endif
Player#(1,5)=Wrapvalue(Player#(1,5))
fall=1
coll= object collision(1,0)
if coll = 1000 then fall=0 :Player#(1,2)=abs(Player#(1,2)/1.2)
if fall=1 then Player#(1,2)=Player#(1,2)-0.009
Position object 1,Player#(1,3),Player#(1,4),0
zrotate object 1,Player#(1,5)
endfunction move
EDIT:
New code!
CHECK IT OUT!
REM DARKSUVIVAL
REM BY DD a.k.a StanasDude =======================================
REM ========================================
Rem NESSICARY CRAP.....
Sync on
Sync Rate 60
Randomize Timer()
`autocam off
REM DIM, VARIABLES,ETC.
Dim Cubes(1000,6)
rem Cubes(1000,1) = cube exist
rem Cubes(1000,2) = posx
rem Cubes(1000,3) = posy
rem Cubes(1000,4) = velx
rem Cubes(1000,5) = vely
rem Cubes(1000,6) = ???
Dim Player#(1,15)
rem Player(1,1) = Velx
rem Player(1,2) = Vely
rem Player(1,3) = ???
rem Player(1,4) = ???
rem Player(1,5) = ???
rem Player(1,6) = ???
State = 0
menuselc = 0
Start#=0.001
Current#=0.0
Max#=0.02
REM -----------Main Loop--------
do
select state
case 0 : gosub _dataload : endcase
case 1 : gosub _intro : endcase
case 2 : gosub _Mainmenu : endcase
case 3 : gosub Setup_Game: gosub Play_Game : endcase
endselect
sync
loop
_dataload:
rem build texture....
for x=1 to 50000
rem the red part of the color
myred=rnd(115)+50
rem the green part of the color
mygreen=95
rem the blue part of the color
myblue=85
ink rgb(myred,mygreen,myblue),1
Dot Rnd(64),Rnd(64)
next x
rem grab texture....
get image 101,0,0,64,64
cls
rem build texture....
for x=1 to 60000
rem the red part of the color
myred=18+rnd(40)
rem the green part of the color
mygreen=200+rnd(50)
rem the blue part of the color
myblue=rnd(50)+200
ink rgb(myred,mygreen,myblue),1
Dot Rnd(64),Rnd(64)
next x
rem grab texture....
get image 102,0,0,64,64
rem state change
state = 2
return
_intro:
make object sphere 1000,2
texture object 1000,101
findarnd=0
sclx#=0
scly#=0
repeat
if findarnd=0 then sclx#=Rnd(120)+30 : scly#=Rnd(120)+30 : findarnd=1
actualx#=curvevalue(sclx#,actualx#,6)
actualy#=curvevalue(scly#,actualy#,6)
if actualx# = sclx# then findarnd=0
if actualy# = scly# then findarnd=0
inc timer
if timer > 20 then findarnd=0: timer=0
inc timer2
if timer2 > 620 then f=1
scale object 1000,actualx#,actualy#,100
Ink RGB(255,255,255),1
CenteR TexT 250,270,"Yeah.........This games is by Stanas, a.k.a DD!"
sync
until f=1
delete object 1000
state = 2
return
_Mainmenu:
autocam off
make object cube 1000,6
color object 1000,Rgb(145,125,200)
ghost object on 1000
make object cube 1001,5
texture object 1001,102
make object cube 1002,5
texture object 1002,102
make object cube 1003,5
texture object 1003,102
make object cube 1004,5
texture object 1004,102
position object 1001,-18,0,0
position object 1002,-9,0,0
position object 1003,0,0,0
position object 1004,9,0,0
position camera 0,5,-25
point camera 0,0,0
camx#=0
camy#=5
camz#=-25
h#=100000
Repeat
h#=curvevalue(0,h#,9)
if leftkey()=1
if lftflg=0
dec menuselc
endif
lftflg=1
else
lftflg=0
endif
if rightkey()=1
if rgtflg=0
inc menuselc
endif
rgtflg=1
else
rgtflg=0
endif
if menuselc < 0 then menuselc=0
if menuselc > 3 then menuselc=3
if object exist(menuselc+1001)=1
objx#=object position x(menuselc+1001)
objy#=object position y(menuselc+1001)
objz#=object position z(menuselc+1001)
endif
dstx#=curvevalue(objx#,dstx#,6)
dsty#=curvevalue(objy#,dsty#,6)
dstz#=curvevalue(objz#,dstz#,6)
position object 1000,dstx#,dsty#,dstz#
camx#=curvevalue(objx#,camx#,6)
position camera camx#,camy#,camz#
point camera object position x(1000),0+h#,object position z(1000)
coll=object collision(1000,0)
select coll
case 1001 : Header$="Play" : Describe$="Play the Game!" : endcase
case 1002 : Header$="Options" : Describe$="Edit the Game options." : endcase
case 1003 : Header$="View" : Describe$="View High Scores!" : endcase
case 1004 : Header$="Exit" : Describe$="Exit The Game...." : endcase
endselect
if returnkey()=1
select coll
case 1001
state = 3
des=1
endcase
case 1002
end
endcase
case 1003
end
endcase
case 1004
end
endcase
endselect
endif
Text 50,20,"Stanazi's........DARKSUVIVAL!"
Center Text 270,320,Header$
Center Text 269,350,Describe$
sync
until des=1
return
Setup_Game:
For w=1 to 5000
if object exist(w)=1
delete object w
endif
next w
autocam off
rem Create player........
Make object sphere 1,1
texture object 1,101
position object 1,-18,3,0
REM Create Walls.....
Make object cube 1000,5
scale object 1000,400,70,50
position object 1000,-18,-1,0
texture object 1000,102
Make object cube 1001,5
scale object 1001,400,70,50
position object 1001,-27,3,0
zrotate object 1001,93
texture object 1001,102
`fix object pivot 1001
Make object cube 1002,5
scale object 1002,400,70,50
position object 1002,-8,3,0
zrotate object 1002,87
texture object 1002,102
position camera -18,5,-12
point camera object position x(1),object position y(1),object position z(1)
return
Play_Game:
repeat
incr=0
incr=Control_Player(current#,1)
if incr=>1 then current#=curvevalue(Max#,current#,140)
if incr=0 then current#=curvevalue(Start#,current#,2)
set cursor 1,1
print incr
if rightkey()=1 then destz#=20
if leftkey()=1 then destz#=340
if rightkey()=0 and leftkey()=0 then destz#=0
rotz#=curveangle(destz#,rotz#,9)
zrotate camera rotz#
sync
until done=1
return
Function Control_Player(sensitivitiy#,gravity)
Rem First get all input========
rite=0
left=0
move=0
If Rightkey()=1 then rite=1 : move=1
If leftkey()=1 then left=1 : move=1
Player#(1,3)=object position x(1)
Player#(1,4)=object position y(1)
if rite=1
Player#(1,1)=Player#(1,1)+sensitivitiy#
Player#(1,5)=Player#(1,5)-2
Player#(1,5)=Wrapvalue(Player#(1,5))
endif
if left=1
Player#(1,1)=Player#(1,1)-sensitivitiy#
Player#(1,5)=Player#(1,5)+2
Player#(1,5)=Wrapvalue(Player#(1,5))
endif
stopx#=Player#(1,1)
stopx#=curvevalue(0,stopx#,6)
Player#(1,1)=stopx#
Player#(1,3)=Player#(1,3)+stopx#
Player#(1,4)=Player#(1,4)+Player#(1,2)
if Player#(1,1) <> 0 and rite+left=0
if Player#(1,1) > 0.009 then Player#(1,5)=Player#(1,5)-2
if Player#(1,1) < -0.009 then Player#(1,5)=Player#(1,5)+2
endif
Player#(1,5)=Wrapvalue(Player#(1,5))
fall=1
coll= object collision(1,0)
if coll = 1000 and player#(1,15) < 6 then fall=0 :Player#(1,2)=abs(Player#(1,2)/1.2) : player#(1,7)=40 :player#(1,15)=player#(1,15)+1
if coll = 1000 and player#(1,15) => 6 then fall=0 :Player#(1,2)=abs(Player#(1,2)/2) : player#(1,7)=100
if fall=1 then Player#(1,2)=Player#(1,2)-0.009
player#(1,7)=curvevalue(100,player#(1,7),8)
scale object 1,100,player#(1,7),100
Position object 1,Player#(1,3),Player#(1,4),0
zrotate object 1,Player#(1,5)
endfunction move
(\__/) HHAHAHAHAHAH!
(O.o ) / WORLD DOMINATION!!!!!!!!!!
(> < )