Ok, here's the updated version.
I've fixed that bug and added an end (tells you your score).
I also fixed a few other things, made some changes here and there.
Here it is in 20 lines:
while mouseclick()=0:load bitmap "Splash.jpg":sync:endwhile:sync on:sync rate 60:color backdrop 0:cubenum=100:dim colors(500,3):dim selected(10):make object cube 1,1:set text font "arial"
load sound "good.wav",1:load sound "bad.wav",2:load sound "fall.wav",3:load sound "score.wav",4 : load music "zipadee.mid",1:loop music 1:wait 100
for t=1 to 15:inc yvalue:for f=1 to 15:inc cubenum:make object cube cubenum,20 : position object cubenum,-200+(f*25),250-(yvalue*25),0
colors(cubenum,1)=rnd(1)*255:colors(cubenum,2)=rnd(1)*255:colors(cubenum,3)=rnd(1)*255:color object cubenum,rgb(colors(cubenum,1),colors(cubenum,2),colors(cubenum,3)):point object cubenum,object position x(cubenum),object position y(cubenum)-100,object position z(cubenum):next f:next t
camxpos#=object position x(213):camypos#=object position y(213):do
inc x#,mousex()-object screen x(1):dec y#,mousey()-object screen y(1):position object 1,x#,y#,z#
set cursor 0,0 :set text size 24:print "Score: ",score:print "Steps: ",count:oldc=c:c=object collision(1,0)
if c<>oldc and oldc>0:ghost object off oldc:endif:if c>0:ghost object on c:endif
if mouseclick()=1 and hold=0 and count<10:if c>0:if selected(count)>0:if object position x(c)>object position x(selected(count))-26 and object position x(c)<object position x(selected(count))+26
if object position y(c)>object position y(selected(count))-26 and object position y(c)<object position y(selected(count))+26
if colors(c,1)=colors(selected(count),1) and colors(c,2)=colors(selected(count),2) and colors(c,3)=colors(selected(count),3) and c<>selected(count):for t=1 to 10:if selected(t)=c:picked=1:endif:next t
if picked=0:count=count+1:selected(count)=c:fade object selected(count),200:play sound 1:endif:endif:endif:else:count=count+1:selected(count)=c:fade object selected(count),200:play sound 1:endif:endif:hold=1:endif
if mouseclick()=0:hold=0:hold2=0:endif:if mouseclick()=2 and hold2=0:scoreup=0:for m=1 to count:for t=101 to 325:if selected(m)>0:if object position x(t)=object position x(selected(m)) and object position y(t)>object position y(selected(m))
move object t,25:play sound 3:endif:endif:next t:if selected(m)>0:position object selected(m),object position x(selected(m)),object position y(selected(m)),-1000:score=score+scoreinc:scoreup=scoreup+scoreinc:scoreinc=scoreinc+50:endif
selected(m)=0:next m:count=0:scoreinc=0:picked=0:if scoreup>150:playsound=1:endif:texty=0:hold2=1:endif
cleared=0:for t=101 to 335:if object exist(t)=1:if object position z(t)=-1000:inc cleared:endif:endif:next t:print "Blocks cleared: ",cleared,"/225"
if cleared=>4:cls:center text 320,230,"Well Done":center text 320,250,"You scored "+str$(score)+" points!":sync:wait mouse:end:endif
if scoreup>150:if playsound=1:play sound 4:playsound=0:endif:inc texty,5:set text size texty:center text 320,240+texty,str$(scoreup)+" POINTS":endif
if camx#=75:camdown=1:endif:if camx#=-75:camdown=0:endif:if camdown=0:camx#=camx#+0.5:else:camx#=camx#-0.5:endif
endif:position camera camxpos#+(camx#/2),camypos#-(camx#/3),-350:point camera camxpos#,camypos#,0:sync:loop
and here it is spaced out (110 lines):
while mouseclick()=0:load bitmap "Splash.jpg":sync:endwhile:sync on:sync rate 60:color backdrop 0:cubenum=100:dim colors(500,3):dim selected(10):make object cube 1,1:set text font "arial"
load sound "good.wav",1:load sound "bad.wav",2:load sound "fall.wav",3:load sound "score.wav",4 : load music "zipadee.mid",1:loop music 1
wait 100
for t=1 to 15:inc yvalue:for f=1 to 15:inc cubenum:make object cube cubenum,20 : position object cubenum,-200+(f*25),250-(yvalue*25),0
colors(cubenum,1)=rnd(1)*255:colors(cubenum,2)=rnd(1)*255:colors(cubenum,3)=rnd(1)*255:color object cubenum,rgb(colors(cubenum,1),colors(cubenum,2),colors(cubenum,3)):point object cubenum,object position x(cubenum),object position y(cubenum)-100,object position z(cubenum):next f:next t
camxpos#=object position x(213):camypos#=object position y(213):do
inc x#,mousex()-object screen x(1):dec y#,mousey()-object screen y(1):position object 1,x#,y#,z#
set cursor 0,0 :set text size 24:print "Score: ",score:print "Steps: ",count:oldc=c:c=object collision(1,0)
if c<>oldc and oldc>0
ghost object off oldc
endif
if c>0
ghost object on c
endif
if mouseclick()=1 and hold=0 and count<10
if c>0
if selected(count)>0
if object position x(c)>object position x(selected(count))-26 and object position x(c)<object position x(selected(count))+26
if object position y(c)>object position y(selected(count))-26 and object position y(c)<object position y(selected(count))+26
if colors(c,1)=colors(selected(count),1) and colors(c,2)=colors(selected(count),2) and colors(c,3)=colors(selected(count),3) and c<>selected(count)
for t=1 to 10
if selected(t)=c:picked=1:endif
next t
if picked=0
count=count+1
selected(count)=c
fade object selected(count),200
play sound 1
endif
endif
endif
endif
else
count=count+1
selected(count)=c
fade object selected(count),200
play sound 1
endif
endif
hold=1
endif
if mouseclick()=0:hold=0:hold2=0:endif
if mouseclick()=2 and hold2=0:scoreup=0
for m=1 to count
for t=101 to 325
if selected(m)>0
if object position x(t)=object position x(selected(m)) and object position y(t)>object position y(selected(m))
move object t,25
play sound 3
endif
endif
next t
if selected(m)>0
position object selected(m),object position x(selected(m)),object position y(selected(m)),-1000
score=score+scoreinc
scoreup=scoreup+scoreinc
scoreinc=scoreinc+50
endif
selected(m)=0
next m
count=0:scoreinc=0:picked=0
if scoreup>150
playsound=1
endif
texty=0:hold2=1
endif
cleared=0:for t=101 to 335
if object exist(t)=1:if object position z(t)=-1000:inc cleared:endif:endif
next t
print "Blocks cleared: ",cleared,"/225"
if cleared=>4 : cls
center text 320,230,"Well Done"
center text 320,250,"You scored "+str$(score)+" points!"
sync
wait mouse
end
endif
if scoreup>150
if playsound=1
play sound 4
playsound=0
endif
inc texty,5
set text size texty:center text 320,240+texty,str$(scoreup)+" POINTS"
endif
if camx#=75
camdown=1
endif
if camx#=-75
camdown=0
endif
if camdown=0
camx#=camx#+0.5
else
camx#=camx#-0.5
endif
position camera camxpos#+(camx#/2),camypos#-(camx#/3),-350
point camera camxpos#,camypos#,0
sync
loop
Also, don't forget the media (download in first post).
Thanks guys,
-Ev
AMD939 3500+, Gigabyte PCI-E X800XL 256mb, 1024mb RAM
Logitech Z680 5.1 Speakers