Hi i made an awesome 2d game in dbc.
I think this will work in dbpro also thou but im not sure.
ok i did not make in dbc either.. i made it in notepad.
i dont have dbc or dbpro here so i couldnt compile it.
but by using my 'ultra sensitive darkbasic classic source code reader and understander to convert it to computer source and compile it and play the game in my head' engine i thought of this moment i am pretty sure it will work in some kind of darkbasic version.
the game is called
'move the square with your mouse and watch out for the red squares but you can have the green ones' and i must say i find it really funny to play inside my head when I win all the time
anyway here is the source and here is a attached picture.
hope you enjoi playing it as much as i enjoyed making it in nothing but notepad.. err yeah, i told you that already didnt i?
hmm anyway:
rem
rem
rem This game is called
rem 'move the square with your mouse and watch out for the red squares but you can have the green ones'
rem I hope you like it
rem
rem
rem
set window on : sync on : sync rate 0 : hide mouse
cls rgb(255,255,255)
get image 100,0,0,10,10
dim image(50,2)
dim imagedie(50)
dim imagetype(50)
dim imageway(50)
dim imagepos(50)
game_over=0
cls rgb(255,0,0)
for x = 1 to 25
get image x,0,0,8,8
image(x,1) = rnd(screen width())
image(x,2) = rnd(screen height())
imagedie(x)=0
imageway(x)=1+rnd(3)
imagetype(x)=1
next x
cls rgb(0,255,0)
for x = 26 to 30
get image x,0,0,8,8
imagepos(x)=rnd(3)
if imagepos(x)=0 then image(x,1) = 0 : image(x,2) = rnd(screen height())
if imagepos(x)=1 then image(x,1) = screen width() : image(x,2) = rnd(screen height())
if imagepos(x)=2 then image(x,1) = rnd(screen width()) : image(x,2) = 0
if imagepos(x)=3 then image(x,1) = rnd(screen width()) : image(x,2) = screen height()
imagedie(x)=0
imageway(x)=1+rnd(3)
imagetype(x)=2
next x
do
cls 0
print score
print
print mx
print my
mx = mousex()
my = mousey()
score_timer = score_timer+ 1
if score_timer > 50 then score = score + 1 : score_timer=0
for x = 1 to 30
if (mx >= image(x,1)) and ((mx+10) <= image(x,1)+4)
if (my >= image(x,2)) and ((my+10) <= image(x,2)+4)
imagedie(x)=1
if imagetype(x)=2
score = score + 10
else
game_over=1
endif
endif
endif
if image(x,1) >= screen width() or image(x,2) >= screen height() or image(x,1) <= 0 or image(x,2) <= 0
imagedie(x)=1
endif
if imagedie(x)=1
imagepos(x)=rnd(3)
if imagepos(x)=0 then image(x,1) = 0 : image(x,2) = rnd(screen height())
if imagepos(x)=1 then image(x,1) = screen width() : image(x,2) = rnd(screen height())
if imagepos(x)=2 then image(x,1) = rnd(screen width()) : image(x,2) = 0
if imagepos(x)=3 then image(x,1) = rnd(screen width()) : image(x,2) = screen height()
imagedie(x)=0
imageway(x)=1+rnd(3)
endif
if imagedie(x)=0
if imageway(x)=1 then image(x,1)=image(x,1)-1+rnd(5)
if imageway(x)=2 then image(x,1)=image(x,1)+1+rnd(5)
if imageway(x)=3 then image(x,2)=image(x,2)-1+rnd(5)
if imageway(x)=4 then image(x,2)=image(x,2)+1+rnd(5)
endif
paste image x, image(x,1), image(x,2)
next x
paste image 100, mx, my
if game_over=1 then exit
sync:loop
cls 0
print "your score: "+str$(score)
wait key
end
i also took some time drawing explanations in case you did not understand what this game is all about.