gosub setup
do
gosub check_for_collision
gosub check_match_no_match
sync
if mouseclick()=0 and mke=1 then mke=0
loop
end
remstart
REM SUBROUTINES
remend
check_for_collision:
while numchoice<2
gosub drawboard
show mouse
rem check sprite collision with any sprite and
rem the detector dot
detspr=sprite image(26)
sprite 26,mousex(),mousey(),detspr
bang=sprite collision(26,0)
if bang > 0
rem hide the sprite if it if clicked
if mouseclick()=1 and mke=0
mke=1
img=sprite image(bang)
hide sprite img
inc numchoice
if numchoice=1
flowerchoice1=numbers(img)
sprchoice1=img
endif
if numchoice=2
flowerchoice2=numbers(img)
sprchoice2=img
endif
endif
endif
if mouseclick()=0 and mke=1 then mke=0
endwhile
return
check_match_no_match:
rem checking to see if there's a match or no match
mode$="no match"
if flowerchoice1=flowerchoice2+100 or flowerchoice1=flowerchoice2-100 or flowerchoice2=flowerchoice1+100 or flowerchoice2=flowerchoice1-100
mode$="match"
endif
if flowerchoice1=113 or flowerchoice2=113
mode$="wild card match"
endif
rem finding the matching flower used with the wild card
if flowerchoice1=113 and flowerchoice2>200
flowerchoice3=flowerchoice2-100
endif
if flowerchoice1=113 and flowerchoice2<200
flowerchoice3=flowerchoice2+100
endif
if flowerchoice2=113 and flowerchoice1>200
flowerchoice3=flowerchoice1-100
endif
if flowerchoice2=113 and flowerchoice1<200
flowerchoice3=flowerchoice1+100
endif
for t=1 to 25
if flowerchoice3=numbers(t)
sprchoice3=t
endif
next t
hide mouse
if mode$="match"
gosub match
while delay<2000
paste image 31,0,-25
center text 320,400,"YOU HAVE A MATCH"
center text 320,440,"TAKE A GUESS"
rem paste puzzle images
paste image sprchoice1+300,piccords(sprchoice1,1),piccords(sprchoice1,2)
paste image sprchoice2+300,piccords(sprchoice2,1),piccords(sprchoice2,2)
get image flowerchoice1,piccords(sprchoice1,1),piccords(sprchoice1,2),piccords(sprchoice1,1)+50,piccords(sprchoice1,2)+50
get image flowerchoice2,piccords(sprchoice2,1),piccords(sprchoice2,2),piccords(sprchoice2,1)+50,piccords(sprchoice2,2)+50
paste image 500,piccords(1,1),piccords(1,2)
inc delay
endwhile
endif
if mode$="wild card match"
gosub wild_card_match
while delay<2000
paste image 31,0,-25
center text 320,400,"YOU HAVE A WILD CARD MATCH"
center text 320,440,"TAKE A GUESS"
paste image sprchoice1+300,piccords(sprchoice1,1),piccords(sprchoice1,2)
paste image sprchoice2+300,piccords(sprchoice2,1),piccords(sprchoice2,2)
paste image sprchoice3+300,piccords(sprchoice3,1),piccords(sprchoice3,2)
get image flowerchoice1,piccords(sprchoice1,1),piccords(sprchoice1,2),piccords(sprchoice1,1)+50,piccords(sprchoice1,2)+50
get image flowerchoice2,piccords(sprchoice2,1),piccords(sprchoice2,2),piccords(sprchoice2,1)+50,piccords(sprchoice2,2)+50
get image flowerchoice3,piccords(sprchoice3,1),piccords(sprchoice3,2),piccords(sprchoice3,1)+50,piccords(sprchoice3,2)+50
paste image 500,piccords(1,1),piccords(1,2)
inc delay
endwhile
endif
if mode$="no match"
while delay<870
paste image 31,0,-25
center text 320,400,"NO MATCH HERE"
center text 320,440,"TRY AGAIN"
rem the puzzle pieces under sprites and flower images
paste image 500,piccords(1,1),piccords(1,2)
paste image flowerchoice1,piccords(sprchoice1,1),piccords(sprchoice1,2)
paste image flowerchoice2,piccords(sprchoice2,1),piccords(sprchoice2,2)
for t5=33 to 63
get image t5,piccords(sprchoice1,1),piccords(sprchoice1,2),piccords(sprchoice1,1)+50,piccords(sprchoice1,2)+50
next t5
inc delay
endwhile
show sprite sprchoice1
show sprite sprchoice2
endif
numchoice=0:delay=0
return
setup:
dim piccords(25,2):dim pics(223):dim numbers(25)
cls 0:sync on:backdrop on:color backdrop 0
nextpuz=2:randomize timer:randomize 223
for t=1 to 223
pics(t)=t
next t
for t=1 to 25
numbers(t)=t
next t
rem load flower pics and get pic cords
for t=101 to 113
load image "flower "+str$(t)+".jpg",t
next t
for t=201 to 212
load image "flower "+str$(t)+".jpg",t
next t
t=1
for y=115 to 315 step 50
for x=195 to 395 step 50
piccords(t,1)=x:piccords(t,2)=y
inc t
next x
next y
rem chose random flower pics for positioning onto screen
for t=1 to 13
while pics(ranum)=0
ranum=rnd(12)+101
endwhile
numbers(t)=pics(ranum)
pics(ranum)=0
next t
for t=14 to 25
while pics(ranum)=0
ranum=rnd(11)+201
endwhile
numbers(t)=pics(ranum)
pics(ranum)=0
next t
create bitmap 1,screen width(),screen height()
rem load puzzle image and get smaller images of it
load image "Puzzle 0"+str$(nextpuz)+".jpg",30
paste image 30,piccords(1,1),piccords(1,2)
get image 500,piccords(1,1),piccords(1,2),piccords(25,1)+50,piccords(25,2)+50
puznum=301
for t=1 to 25
get image puznum,piccords(t,1),piccords(t,2),piccords(t,1)+50,piccords(t,2)+50
inc puznum
next t
cls 0
rem make image for sprites
n=1
for sp=1 to 25
ink rgb(200,30,30),0
box 0,0,50,50
ink rgb(200,0,0),0
box 2,2,48,48
ink rgb(200,200,0),0
box 4,4,46,46
ink rgb(200,0,0),0
set text to bold
center text 25,18, str$(n)
inc n
get image sp,0,0,51,51
next sp
rem make a sprite detector to use at the mouse position
ink rgb(255,255,255),0
dot 0,0
get image 26,0,0,1,1
cls 0
load image "Logo.jpg",31
paste image 31,0,0
blur bitmap 1,2
get image 31,0,0,639,479
set current bitmap 0
sprite 26,mousex(),mousey(),26
hide sprite 26
gosub drawboard
set text size 20
for t=1 to 25
sprite t,piccords(t,1),piccords(t,2),t
next t
return
drawboard:
paste image 31,0,-25
paste image 500,piccords(1,1),piccords(1,2)
for t=1 to 25
paste image numbers(t),piccords(t,1),piccords(t,2)
next t
return
match:
paste image 31,0,-25
center text 320,400,"YOU HAVE A MATCH"
center text 320,440,"TAKE A GUESS"
rem hide and move sprites
hide sprite sprchoice1
hide sprite sprchoice2
sprite sprchoice1,0,0,sprchoice1
sprite sprchoice2,0,0,sprchoice2
rem make image of the puzzle images revealed
set current bitmap 1
paste image sprchoice1+300,piccords(sprchoice1,1),piccords(sprchoice1,2)
paste image sprchoice2+300,piccords(sprchoice2,1),piccords(sprchoice2,2)
get image 500,piccords(1,1),piccords(1,2),piccords(25,1)+50,piccords(25,2)+50
set current bitmap 0
return
wild_card_match:
paste image 31,0,-25
center text 320,400,"YOU HAVE A WILD CARD MATCH"
center text 320,440,"TAKE A GUESS"
hide sprite sprchoice1
hide sprite sprchoice2
hide sprite sprchoice3
sprite sprchoice1,0,0,sprchoice1
sprite sprchoice2,0,0,sprchoice2
sprite sprchoice3,0,0,sprchoice3
set current bitmap 1
paste image sprchoice1+300,piccords(sprchoice1,1),piccords(sprchoice1,2)
paste image sprchoice2+300,piccords(sprchoice2,1),piccords(sprchoice2,2)
paste image sprchoice3+300,piccords(sprchoice3,1),piccords(sprchoice3,2)
get image 500,piccords(1,1),piccords(1,2),piccords(25,1)+50,piccords(25,2)+50
set current bitmap 0
return
Happy Trails