Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / LumberJack Game :)

Author
Message
Chiwawa
21
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Canada
Posted: 13th Feb 2003 03:43
ahah
try this...its a LumberJack game without any external media... you can cut three with your right arm..and the three is cutted at the RIGHT place....and it fall...by right place i mean...if you touch the three in the middle...it is cutted in the middle...

¸
rem =========================================
rem Bucheron.DBA =
rem LumberJack Game =
rem Coded By Chiwawa =
rem Coded From 8 February 2003... =
rem =========================================

autocam off
sync on
sync rate 0
draw to front
cls
randomize timer()
set camera range 1,50000
backdrop off
set display mode 640,480,32
Dim ArbCoupe(351,3)


make object sphere 1,10000
set object 1,1,1,0

fog on
fog color rgb(0,61,236)
fog distance 5000

create bitmap 1,257,257
ink rgb(0,62,242),0
box 0,0,256,256
ink rgb(0,0,50),0
for i=1 to 20000
dot rnd(255),rnd(255)
next i
get image 98,0,0,256,256
texture object 1,98
delete bitmap 1

create bitmap 1,257,257
set current bitmap 1

for i=1 to 50
ang=rnd(359)
dist1=rnd(37)
x=60+dist1*cos(ang)
y=60+dist1*sin(ang)
ink rgb(0,255,0),0
for j=1 to 20
circle x,y,j
next j

ink rgb(30,150,20),0
for l=1 to 200
ang=rnd(359)
dist1=rnd(40)
x=60+dist1*cos(ang)
y=60+dist1*sin(ang)
dot x,y
next l

ink rgb(125,77,15),0
x2=rnd(15)+53
y2=rnd(100)+95
for k=1 to 12
circle x2,y2,k
next k
next i

get image 1,0,0,118,200
delete bitmap 1

create bitmap 1,257,257
set current bitmap 1

ink rgb(255,255,0),0
box 0,0,50,35
ink rgb(200,180,180),0
box 30,10,100,25
for i= 1 to 7
circle 100,17,i
next i

get image 2,0,0,256,256
delete bitmap 1

create bitmap 1,256,256
ink rgb(255,25,117),0
box 50,0,90,50
box 65,50,75,60
box 40,60,100,150
box 40,100,60,200
box 80,100,100,200
box 0,70,140,90
get image 3,0,0,140,200
ink 0,0
box 80,175,100,200
get image 4,0,0,140,200
cls
paste image 3,0,0
box 40,175,60,200
get image 5,0,0,140,200
delete bitmap 1

create bitmap 1,257,257
set current bitmap 1
ink rgb(0,90,20),0
box 0,0,256,256
ink rgb(0,60,5),0
for i=1 to 20000
dot rnd(255),rnd(255)
next i
get image 99,0,0,256,256
delete bitmap 1

make matrix 1,50000,50000,70,70
prepare matrix texture 1,99,1,1
fill matrix 1,0.0,1
randomize matrix 1,9999999
update matrix 1

dim ArbCoord(351,4)
for i=50 to 400 step 2
grosx=300
make object plain i,grosx,grosx*1.6
make object plain i+1,grosx,grosx*1.6
texture object i,1
texture object i+1,1
set object i,1,0,0
set object i+1,1,0,0
ArbCoord(i-49,1)=rnd(50000)
ArbCoord(i-49,3)=rnd(50000)
ArbCoord(i-49,2)=(grosx*1.6/2)+get ground height(1,ArbCoord(i-49,1),ArbCoord(i-49,3))
position object i,ArbCoord(i-49,1),ArbCoord(i-49,2),ArbCoord(i-49,3)
position object i+1,ArbCoord(i-49,1),ArbCoord(i-49,2),ArbCoord(i-49,3)
yrotate object i+1,90
ArbCoord(i-49,4)=0
next i




make object plain 402,200,286
scale object 402,60,60,60
position object 402,camera position x(),83+get ground height(1,camera position x(),camera position z() ),camera position z()
texture object 402,3
set object 402,1,0,0

x#=object position x(402)
y#=object position y(402)
z#=object position z(402)
ay#=0

frame=4
time#=timer()



do
touch=0


if leftkey()=1 then ay#=wrapvalue(ay#-2):touch=1
if rightkey()=1 then ay#=wrapvalue(ay#+2):touch=1
if upkey()=1 then x#=x#+Xvalue(x#,z#,ay#,10.0):y#=y#+Yvalue(x#,z#,ay#,10.0):z#=z#+Zvalue(x#,z#,ay#,10.0):touch=1
if downkey()=1 then x#=x#+Xvalue(x#,z#,wrapvalue(ay#+180),10.0):y#=y#+Yvalue(x#,z#,wrapvalue(ay#+180),10.0):z#=z#+Zvalue(x#,z#,wrapvalue(ay#+180),10.0):touch=1

position object 1,camera position x(),0,camera position z()
position object 402,x#,y#,z#
yrotate object 402,ay#

position camera x#,y#,z#:rotate camera 25,ay#,0:move camera -400


set cursor 0,0
print screen fps()



if touch=0 then texture object 402,3
if timer()-time#>250 and touch=1 then time#=timer():texture object 402,frame:frame=frame+1
if frame>5 then frame=4

gosub Coupe
if tombe=1 then gosub Tombe


sync
loop

rem ***********************************************************************************
function Xvalue(x#,z#,ay#,L#)
zf#=(L#/2)*cos(ay#)
xf#=(L#/2)*sin(ay#)
lxzf#=sqrt(xf#^2+zf#^2)
yf#=get ground height(1,x#+xf#,z#+zf#)-get ground height(1,x#,z#)
ax#=(atan(yf#/lxzf#))
y2#=l#*sin(ax#)
lxz#=l#*cos(ax#)
x2#=lxz#*sin(ay#)
z2#=lxz#*cos(ay#)
endfunction x2#

function Yvalue(x#,z#,ay#,L#)
zf#=l#*cos(ay#)
xf#=l#*sin(ay#)
yf#=get ground height(1,x#+xf#,z#+zf#)-get ground height(1,x#,z#)
lxzf#=sqrt(xf#^2+zf#^2)
ax#=(atan(yf#/lxzf#))
y2#=l#*sin(ax#)
lxz#=l#*cos(ax#)
x2#=lxz#*sin(ay#)
z2#=lxz#*cos(ay#)
endfunction y2#

function Zvalue(x#,z#,ay#,L#)
zf#=l#*cos(ay#)
xf#=l#*sin(ay#)
yf#=get ground height(1,x#+xf#,z#+zf#)-get ground height(1,x#,z#)
lxzf#=sqrt(xf#^2+zf#^2)
ax#=(atan(yf#/lxzf#))
y2#=l#*sin(ax#)
lxz#=l#*cos(ax#)
x2#=lxz#*sin(ay#)
z2#=lxz#*cos(ay#)
endfunction z2#
rem ***********************************************************************************
coupe:
for i=1 to 351 step 2
if ((x#+(100*sin(wrapvalue(ay#+90))))>(ArbCoord(i,1)-50)) and ((x#+(100*sin(wrapvalue(ay#+90))))(ArbCoord(i,3)-50)) and ((z#+(100*cos(wrapvalue(ay#+90))))
Chiwawa
21
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Canada
Posted: 13th Feb 2003 04:28
wtf...my post is cut..

another try:

hexGEAR
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 13th Feb 2003 04:56
man, that's just plain hardcore! no objects/bitmaps nuthin and you could still make that! i applaud you!

your birth was a blessing, sent to live and die on earth as a lesson, we each have a star all you have to do is find it, once you do, everyone who sees it will be blinded - DMX
Chiwawa
21
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Canada
Posted: 13th Feb 2003 04:59
thx
its just the begening...i can optimise it ..and ill add many feature...
Chiwawa
21
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Canada
Posted: 13th Feb 2003 19:03
then...where is my crown of King of Coding???
hexGEAR
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 13th Feb 2003 19:35
u know something, there should be a compeition, not restricted to the 20 lines code as in the other one but to make a game with no media at all, i think they've done it b4 but it could yield some very interesting results

your birth was a blessing, sent to live and die on earth as a lesson, we each have a star all you have to do is find it, once you do, everyone who sees it will be blinded - DMX
Chiwawa
21
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Canada
Posted: 13th Feb 2003 20:45
yeah it could be fun =)
cause the 20 lines challenge ...its littlebit..an optimisation challenge... they should do one with no line limit...

Login to post a reply

Server time is: 2024-05-18 10:42:03
Your offset time is: 2024-05-18 10:42:03