Post by PeterMaria on Mar 7, 2011 13:57:52 GMT -5
Hi,
This game should be for Easter days.
Before you start, you have to do some settings.
Choose 'OPTION' in your BASIC4GL IDE
Set SCREENMODE to 640x480 and set FULLSCREEN.
Get the source code into your IDE and click then GO!
You see a game like a hurricane, you have dreamed thereof. LOL
What must I do in this game?
You have to collect all mushrooms, before your oxygen runs out.
There are boxes that you can push. When you are get blocked by a bee, then push
a box in their direction and the bee will change their direction.
That's all.
by the way: don't press the escape key while you are playing the game!
It brings you home to Windows.
Important:
I have this written under WINDOWS7 and it appears to me that BASIC4GL got some errors!
The Windows colour table won't restored.
When I make an executable file and I want to run it, you will get a crash!
The conditional expressions work not properly.
Okay, I'm hungry.
This game should be for Easter days.
Before you start, you have to do some settings.
Choose 'OPTION' in your BASIC4GL IDE
Set SCREENMODE to 640x480 and set FULLSCREEN.
Get the source code into your IDE and click then GO!
You see a game like a hurricane, you have dreamed thereof. LOL
What must I do in this game?
You have to collect all mushrooms, before your oxygen runs out.
There are boxes that you can push. When you are get blocked by a bee, then push
a box in their direction and the bee will change their direction.
That's all.
by the way: don't press the escape key while you are playing the game!
It brings you home to Windows.
Important:
I have this written under WINDOWS7 and it appears to me that BASIC4GL got some errors!
The Windows colour table won't restored.
When I make an executable file and I want to run it, you will get a crash!
The conditional expressions work not properly.
Okay, I'm hungry.
'Mushroom by Peter Wirbelauer o7/o3/2011
TextMode(TEXT_BUFFERED)
ResizeSpriteArea(640,496)
Dim iAx,iBx,iCx,iDx,pic,RasReg,BeeRas,xHead,yHead,rHead,zHead,pHead,Fo(95),Fa,lev,cH,curX,curY,curZ,curU,curD,curL,curR
Dim xMush,yMush,zMush,Mush,Oxy,iTime,Score,Over,count,xBum,yBum,zBum,yCur,xCur,mx,my,pz,img
Dim s0(31),s1(3),s2(15),s3(4),s4(15),s5(15),s6(15),s7(15),s8(15),s9(15),sA(15),sB(0),w1,w2,w3,w4,w5,w8
Dim Map1(360)
Dim Map2(360)
Dim xBee(360)
Dim yBee(360)
Dim zBee(360)
Dim rBee(360)
Dim iBee(360)
Dim xBox(360)
Dim yBox(360)
Dim zBox(360)
Dim rBox(360)
Dim iBox(360)
oxy = LoadTex("Mush/oxygen.png")
pic = LoadTex("Mush/Nebula.png")
img = LoadTex("Mush/picture.png")
Fo = LoadTexStrip("Mush/FontStrip.png",32,32)
s0 = LoadTexStrip("Mush/donestrip.png",32,32)
s1 = LoadTexStrip("Mush/headstrip.png",32,32)
s2 = LoadTexStrip("Mush/boxxstrip.png",32,32)
s3 = LoadTexStrip("Mush/tilestrip.png",32,32)
s4 = LoadTexStrip("Mush/BeestripL.png",32,32)
s5 = LoadTexStrip("Mush/BeestripR.png",32,32)
s6 = LoadTexStrip("Mush/BeestripU.png",32,32)
s7 = LoadTexStrip("Mush/BeestripD.png",32,32)
s8 = LoadTexStrip("Mush/MushStrip.png",32,32)
s9 = LoadTexStrip("Mush/LostLifes.png",64,64)
sA = LoadTexStrip("Mush/markstrip.png",32,32)
sB = LoadTexStrip("Mush/mushrooms.png",32,32)
w1 = LoadSound("Mush/clic.wav")
w2 = LoadSound("Mush/done.wav")
w3 = LoadSound("Mush/eats.wav")
w4 = LoadSound("Mush/bums.wav")
w5 = LoadSound("Mush/push.wav")
Function Rand(min, max)
Return rnd() % (max - min + 1) + min
End Function
'--------------------------------------
Sub Sprite(nr(),x,y,w,h,frame)
NewSprite(nr)
SprSetxCentre(0):SprSetyCentre(0)
SprSetZOrder(1)
SprSetSize(w,h)
SprSetPos(x,y)
SprSetFrame(frame)
End Sub
'--------------------------------------
Sub Bitmap(Hnd,x1,y1,w1,h1)
NewSprite(Hnd)
SprSetxCentre(0):SprSetyCentre(0)
SprSetZOrder(1)
SprSetSize(w1,h1)
SprSetPos (x1,y1)
End Sub
'--------------------------------------
Sub Text(txt$,x4,y4,w4,h4)
Dim sx, jx, px
sx = Len(txt$)
For jx =1 To sx
px = Asc(Mid$(txt$,jx,1))
iF px >=32 And px <=127 Then
px = px -32
Sprite(Fo,x4,y4,w4,h4,px)
x4 = x4 + w4
End iF
Next
End Sub
'--------------------------------------
Function EscKey()
Return ScanKeyDown(vk_escape)
End Function
'--------------------------------------
Function Key(cKey)
Return ScanKeyDown(cKey)
End Function
'--------------------------------------
Sub LoadMaps()
Dim File,pj
File = OpenFileRead("Maps\Map" + Lev + "-1.bin")
For pj =0 To 299
Map1(pj) = ReadByte(File)
Next
CloseFile(File)
File = OpenFileRead("Maps\Map" + Lev + "-2.bin")
For pj =0 To 299
Map2(pj) = ReadByte(File)
Next
CloseFile(File)
End Sub
Sub FindHead()
For iCx =0 To 14
For iDx =0 To 19
iBx = iCx*20 + iDx
iF Map2(iBx) =5 Then
xHead = iDx *32
yHead = iCx *32
rHead = 0:zHead =0
ElseiF Map2(iBx) =3 Then
Mush = Mush +1
End iF
Next: Next
End Sub
Sub Initialize()
For iBx =0 To 299
xBee(iBx) =0:yBee(iBx) =0:zBee(iBx) =0:rBee(iBx) =0:iBee(iBx) =0
xBox(iBx) =0:yBox(iBx) =0:zBox(iBx) =0:rBox(iBx) =0:iBox(iBx) =0
Next
pHead =3:BeeRas =0:RasReg =0
Score =0:cH =0:count =200
iTime =0:Over =0:Mush =0
xBum =0:yBum =0:zBum =0 :curX =128:curY =160
FindHead()
Bitmap(oxy,0,480,640,16)
End Sub
Sub ShowMaps()
For iCx =0 To 14
For iDx =0 To 19
iBx = iCx*20 + iDx
iF Map1(iBx) =2 Then: Sprite(s3,iDx*32,iCx*32,32,32,2): End iF
iF Map2(iBx) =1 Then: Sprite(s3,iDx*32,iCx*32,32,32,1): End iF
iF Map2(iBx) =3 Then: Sprite(s3,iDx*32,iCx*32,32,32,3): End iF
iF Map2(iBx) =4 Then: Sprite(s3,iDx*32,iCx*32,32,32,4): End iF
Next: Next
End Sub
Sub ScanHead()
iF RasReg >0 Then: Return: End iF
iDx = xHead /32 : iCx = yHead /32
iBx = iCx *20 + iDx
iF Map2(iBx) =5 And Key(vk_right) And Map2(iBx+1) =4 And Map2(iBx+2) =0 Then
Map2(iBx) =0 : Map2(iBx+1) =5 : Map2(iBx+2)=10
rHead =1 : pHead =1
xBox(iBx+1) = xHead+32
yBox(iBx+1) = yHead
rBox(iBx+1) = 1
iBox(iBx+1) = 1
PlaySound(w5)
ElseiF Map2(iBx) =5 And Key(vk_left) And Map2(iBx-1) =4 land Map2(iBx-2) =0 Then
Map2(iBx) =0 : Map2(iBx-1) =5 : Map2(iBx-2)=10
rHead =2 : pHead =2
xBox(iBx-1) = xHead-32
yBox(iBx-1) = yHead
rBox(iBx-1) = 2
iBox(iBx-1) = 1
PlaySound(w5)
ElseiF Map2(iBx) =5 And Key(vk_up) And Map2(iBx-20) =4 land Map2(iBx-40) =0 Then
Map2(iBx) =0 : Map2(iBx-20) =5 : Map2(iBx-40)=10
rHead =3 : pHead =3
xBox(iBx-20) = xHead
yBox(iBx-20) = yHead-32
rBox(iBx-20) = 3
iBox(iBx-20) = 1
PlaySound(w5)
ElseiF Map2(iBx) =5 And Key(vk_down) And Map2(iBx+20) =4 And Map2(iBx+40) =0 Then
Map2(iBx) =0 : Map2(iBx+20) =5 : Map2(iBx+40)=10
rHead =4 : pHead =4
xBox(iBx+20) = xHead
yBox(iBx+20) = yHead+32
rBox(iBx+20) = 4
iBox(iBx+20) = 1
PlaySound(w5)
ElseiF Map2(iBx) =5 And Key(vk_right) And Map2(iBx+1) =0 Then
rHead =1 :pHead =1
Map2(iBx) =0 : Map2(iBx+1) =5
PlaySound(w5)
ElseiF Map2(iBx) =5 And key(vk_left) And Map2(iBx-1) =0 Then
rHead =2 :pHead =2
Map2(iBx) =0 : Map2(iBx-1) =5
PlaySound(w5)
ElseiF Map2(iBx) =5 And Key(vk_up) And Map2(iBx-20) =0 Then
rHead =3 :pHead =3
Map2(iBx) =0 : Map2(iBx-20) =5
PlaySound(w5)
ElseiF Map2(iBx) =5 And Key(vk_down) And Map2(iBx+20) =0 Then
rHead =4 :pHead =4
Map2(iBx) =0 : Map2(iBx+20) =5
PlaySound(w5)
ElseiF Map2(iBx) =5 And Key(vk_right) And Map2(iBx+1) =3 Then
Map2(iBx) =0 : Map2(iBx+1) =5
xMush = xHead +32 : yMush = yHead
rHead =1: pHead =1
Score = Score +10
PlaySound(w3)
ElseiF Map2(iBx) =5 And Key(vk_left) And Map2(iBx-1) =3 Then
Map2(iBx) =0 : Map2(iBx-1) =5
xMush = xHead -32 : yMush = yHead
rHead =2: pHead =2
Score = Score +10
PlaySound(w3)
ElseiF Map2(iBx) =5 And Key(vk_up) And Map2(iBx-20) =3 Then
Map2(iBx) =0 : Map2(iBx-20) =5
xMush = xHead : yMush = yHead -32
rHead =3: pHead =3
Score = Score +10
PlaySound(w3)
ElseiF Map2(iBx) =5 And Key(vk_down) And Map2(iBx+20) =3 Then
Map2(iBx) =0 : Map2(iBx+20) =5
xMush = xHead : yMush = yHead +32
rHead =4: pHead =4
Score = Score +10
PlaySound(w3)
Else
rHead =0
End iF
End Sub
Sub ShowHead()
iF rHead =0 And pHead =1 Then
Sprite(s1,xHead,yHead,32,32,3)
ElseiF rHead =0 And pHead =2 Then
Sprite(s1,xHead,yHead,32,32,1)
ElseiF rHead =0 And pHead =3 Then
Sprite(s1,xHead,yHead,32,32,0)
ElseiF rHead =0 And pHead =4 Then
Sprite(s1,xHead,yHead,32,32,2)
ElseiF rHead =1 Then
xHead = xHead +2
Sprite(s1,xHead,yHead,32,32,3)
RasReg = RasReg +2
iF RasReg =32 Then
RasReg =0 : rHead =0
End iF
ElseiF rHead =2 Then
xHead = xHead -2
Sprite(s1,xHead,yHead,32,32,1)
RasReg = RasReg +2
iF RasReg =32 Then
RasReg =0 : rHead =0
End iF
ElseiF rHead =3 Then
yHead = yHead -2
Sprite(s1,xHead,yHead,32,32,0)
RasReg = RasReg +2
If RasReg =32 Then
RasReg =0 : rHead =0
End iF
ElseiF rHead =4 Then
yHead = yHead +2
Sprite(s1,xHead,yHead,32,32,2)
RasReg = RasReg +2
iF RasReg =32 Then
RasReg =0 : rHead =0
End iF
End iF
End Sub
Sub ShowBoxes()
For iBx =20 To 280
iF iBox(iBx) =1 And rBox(iBx) =1 Then
xBox(iBx) = xBox(iBx) +2
Sprite(s2,xBox(iBx),yBox(iBx),32,32,zBox(iBx))
zBox(iBx) = zBox(iBx) +1
iF zBox(iBx) =16 Then
zBox(iBx) =0:iBox(iBx) =0:rBox(iBx) =0
iCx = (yBox(iBx) *20 + xBox(iBx)) /32
Map2(iCx) =4
End iF
ElseiF iBox(iBx) =1 And rBox(iBx) =2 Then
xBox(iBx) = xBox(iBx) -2
Sprite(s2,xBox(iBx),yBox(iBx),32,32,zBox(iBx))
zBox(iBx) = zBox(iBx) +1
iF zBox(iBx) =16 Then
zBox(iBx) =0:iBox(iBx) =0:rBox(iBx) =0
iCx = (yBox(iBx) *20 + xBox(iBx)) /32
Map2(iCx) =4
End iF
ElseiF iBox(iBx) =1 And rBox(iBx) =3 Then
yBox(iBx) = yBox(iBx) -2
Sprite(s2,xBox(iBx),yBox(iBx),32,32,zBox(iBx))
zBox(iBx) = zBox(iBx) +1
iF zBox(iBx) =16 Then
zBox(iBx) =0:iBox(iBx) =0:rBox(iBx) =0
iCx = (yBox(iBx) *20 + xBox(iBx)) /32
Map2(iCx) =4
End iF
ElseiF iBox(iBx) =1 And rBox(iBx) =4 Then
yBox(iBx) = yBox(iBx) +2
Sprite(s2,xBox(iBx),yBox(iBx),32,32,zBox(iBx))
zBox(iBx) = zBox(iBx) +1
iF zBox(iBx) =16 Then
zBox(iBx) =0:iBox(iBx) =0:rBox(iBx) =0
iCx = (yBox(iBx) *20 + xBox(iBx)) /32
Map2(iCx) =4
End iF
End iF
Next
End Sub
Sub Mushroom()
iF yMush =0 Then: Return: End iF
Sprite(s8,xMush,yMush,32,32,zMush)
zMush = zMush +1
iF zMush =16 Then
zMush =0 : yMush =0
Mush = Mush -1
End iF
End sub
Sub BeeGetHead()
iF RasReg =1 Then: Return: End iF
iDx = xHead /32 : iCx = yHead /32
iBx = iCx *20 + iDx
iF Map2(iBx) >=6 And Map2(iBx) <=9 Then
RasReg =1:rHead =8:Over =3
xBum = xHead:yBum = yHead
PlaySound(w4)
End iF
End Sub
Sub ShowOxygen()
iF Over > 0 Then: Return: End iF
iF iTime < 100 Then: iTime = iTime +1: End iF
iF iTime = 100 Then
count = count -1
iTime = 0
IF count =0 Then
Over =1:RasReg =1:rHead =8
xBum = xHead:yBum = yHead
PlaySound(w4)
End iF
End iF
End Sub
Sub HeadAround()
iF Over =2 Then
Sprite(s0,xHead,yHead,32,32,zHead)
cH = cH +1
If cH =2 Then
cH =0
zHead = zHead +1
iF zHead =32 Then: Over =3: End iF
End iF
End iF
End Sub
Sub ShowDone()
iF Mush =0 And Over =0 Then
Over = 2:iAx = 0
Score = Score + count
RasReg =1:rHead =8:zHead =0
PlaySound(w2)
End iF
End Sub
Sub ShowDestroy()
iF yBum > 0 Then
Sprite(s9,xBum-16,yBum-16,64,64,zBum)
zBum = zBum +1
iF zBum =16 Then: zBum =0: End iF
End iF
End Sub
Sub ShowPause()
iF Key(80) Then
While Not Key(vk_space)
Bitmap(pic,0,0,640,496)
Text("pause",240,208,32,48)
Text("press space bar",80,400,32,48)
DrawText()
WaitTimer(10)
Wend
End iF
End Sub
Sub SetBee(r)
xBee(iBx) = iDx *32
yBee(iBx) = iCx *32
iBee(iBx) = 1
rBee(iBx) = r
End Sub
Sub ShowBees()
For iBx =20 To 280
iF iBee(iBx) =2 And rBee(iBx) =1 Then
Sprite(s5,xBee(iBx),yBee(iBx),32,32,zBee(iBx))
zBee(iBx) = zBee(iBx) +1
iF zBee(iBx) =16 Then: zBee(iBx) =0: End iF
ElseiF iBee(iBx) =2 And rBee(iBx) =2 Then
Sprite(s4,xBee(iBx),yBee(iBx),32,32,zBee(iBx))
zBee(iBx) = zBee(iBx) +1
iF zBee(iBx) =16 Then: zBee(iBx) =0: End iF
ElseiF iBee(iBx) =2 And rBee(iBx) =3 Then
Sprite(s6,xBee(iBx),yBee(iBx),32,32,zBee(iBx))
zBee(iBx) = zBee(iBx) +1
iF zBee(iBx) =16 Then: zBee(iBx) =0: End iF
ElseiF iBee(iBx) =2 And rBee(iBx) =4 Then
Sprite(s7,xBee(iBx),yBee(iBx),32,32,zBee(iBx))
zBee(iBx) = zBee(iBx) +1
iF zBee(iBx) =16 Then: zBee(iBx) =0: End iF
ElseiF iBee(iBx) =1 And rBee(iBx) =1 Then
xBee(iBx) = xBee(iBx) +2
Sprite(s5,xBee(iBx),yBee(iBx),32,32,zBee(iBx))
zBee(iBx) = zBee(iBx) +1
iF zBee(iBx) =16 Then
zBee(iBx) =0 : iBee(iBx) =0
iAx = (yBee(iBx) *20 + xBee(iBx)) /32
Map2(iAx) =7 : Map2(iAx-1) =0
End iF
ElseiF iBee(iBx) =1 And rBee(iBx) =2 Then
xBee(iBx) = xBee(iBx) -2
Sprite(s4,xBee(iBx),yBee(iBx),32,32,zBee(iBx))
zBee(iBx) = zBee(iBx) +1
iF zBee(iBx) =16 Then
zBee(iBx) =0 : iBee(iBx) =0
iAx = (yBee(iBx) *20 + xBee(iBx)) /32
Map2(iAx) =6 : Map2(iAx+1) =0
End iF
ElseiF iBee(iBx) =1 And rBee(iBx) =3 Then
yBee(iBx) = yBee(iBx) -2
Sprite(s6,xBee(iBx),yBee(iBx),32,32,zBee(iBx))
zBee(iBx) = zBee(iBx) +1
iF zBee(iBx) =16 Then
zBee(iBx) =0 : iBee(iBx) =0
iAx = (yBee(iBx) *20 + xBee(iBx)) /32
Map2(iAx) =8 : Map2(iAx+20) =0
End iF
ElseiF iBee(iBx) =1 And rBee(iBx) =4 Then
yBee(iBx) = yBee(iBx) +2
Sprite(s7,xBee(iBx),yBee(iBx),32,32,zBee(iBx))
zBee(iBx) = zBee(iBx) +1
iF zBee(iBx) =16 Then
zBee(iBx) =0 : iBee(iBx) =0
iAx = (yBee(iBx) *20 + xBee(iBx)) /32
Map2(iAx) =9 : Map2(iAx-20) =0
End iF
End iF
Next
End Sub
Sub ScanBees()
iF BeeRas >0 Then: Return: End iF
For iCx =1 To 13
For iDx =1 To 18
iBx = iCx *20 + iDx
iF Map2(iBx) =6 And (Map2(iBx-1) =5 Or Map2(iBx-1) =0) Then
Map2(iBx-1) =15
SetBee(2)
ElseiF Map2(iBx) =7 And (Map2(iBx+1) =5 Or Map2(iBx+1) =0) Then
Map2(iBx+1) =15
SetBee(1)
ElseiF Map2(iBx) =8 And (Map2(iBx-20) =5 Or Map2(iBx-20) =0) Then
Map2(iBx-20) =15
SetBee(3)
ElseiF Map2(iBx) =9 And (Map2(iBx+20) =5 Or Map2(iBx+20) =0) Then
Map2(iBx+20) =15
SetBee(4)
ElseiF Map2(iBx) =6 And Map2(iBx-1) =4 And (Map2(iBx-20) =0 Or Map2(iBx-20) =5) Then
Map2(iBx-20) =15
SetBee(3)
ElseiF Map2(iBx) =6 And Map2(iBx-1) =4 And (Map2(iBx+20) =0 Or Map2(iBx+20) =5) Then
Map2(iBx+20) =15
SetBee(4)
ElseiF Map2(iBx) =7 And Map2(iBx+1) =4 And (Map2(iBx-20) =0 Or Map2(iBx-20) =5) Then
Map2(iBx-20) =15
SetBee(3)
ElseiF Map2(iBx) =7 And Map2(iBx+1) =4 And (Map2(iBx+20) =0 Or Map2(iBx+20) =5) Then
Map2(iBx+20) =15
SetBee(4)
ElseiF Map2(iBx) =8 And Map2(iBx-20) =4 And (Map2(iBx+1) =0 Or Map2(iBx+1) =5) Then
Map2(iBx+1) =15
SetBee(1)
ElseiF Map2(iBx) =8 And Map2(iBx-20) =4 And (Map2(iBx-1) =0 Or Map2(iBx-1) =5) Then
Map2(iBx-1) =15
SetBee(2)
ElseiF Map2(iBx) =9 And Map2(iBx+20) =4 And (Map2(iBx+1) =0 Or Map2(iBx+1) =5) Then
Map2(iBx+1) =15
SetBee(1)
ElseiF Map2(iBx) =9 And Map2(iBx+20) =4 And (Map2(iBx-1) =0 Or Map2(iBx-1) =5) Then
Map2(iBx-1) =15
SetBee(2)
ElseiF Map2(iBx) =6 And Map2(iBx-1) <> 0 And (Map2(iBx+1) =0 Or Map2(iBx+1) =5) Then
Map2(iBx+1) =15
SetBee(1)
ElseiF Map2(iBx) =7 And Map2(iBx+1) <> 0 And (Map2(iBx-1) =0 Or Map2(iBx-1) =5) Then
Map2(iBx-1) =15
SetBee(2)
ElseiF Map2(iBx) =8 And Map2(iBx-20) <> 0 And (Map2(iBx+20) =0 Or Map2(iBx+20) =5) Then
Map2(iBx+20) =15
SetBee(4)
ElseiF Map2(iBx) =9 And Map2(iBx+20) <> 0 And (Map2(iBx-20) =0 Or Map2(iBx-20) =5) Then
Map2(iBx-20) =15
SetBee(3)
ElseiF Map2(iBx) =6 And Map2(iBx-1) <> 0 And Map2(iBx+1) =4 And Map2(iBx-20) =0 Then
Map2(iBx-20) =15
SetBee(3)
ElseiF Map2(iBx) =6 And Map2(iBx-1) <> 0 And Map2(iBx+1) =4 And Map2(iBx+20) =0 Then
Map2(iBx+20) =15
SetBee(4)
ElseiF Map2(iBx) =7 And Map2(iBx+1) <> 0 And Map2(iBx-1) =4 And Map2(iBx-20) =0 Then
Map2(iBx-20) =15
SetBee(3)
ElseiF Map2(iBx) =7 And Map2(iBx+1) <> 0 And Map2(iBx-1) =4 And Map2(iBx+20) =0 Then
Map2(iBx+20) =15
SetBee(4)
ElseiF Map2(iBx) =8 And Map2(iBx-20) <> 0 And Map2(iBx+20) =4 And Map2(iBx+1) =0 Then
Map2(iBx+1) =15
SetBee(1)
ElseiF Map2(iBx) =8 And Map2(iBx-20) <> 0 And Map2(iBx+20) =4 And Map2(iBx-1) =0 Then
Map2(iBx-1) =15
SetBee(2)
ElseiF Map2(iBx) =9 And Map2(iBx+20) <> 0 And Map2(iBx-20) =4 And Map2(iBx+1) =0 Then
Map2(iBx+1) =15
SetBee(1)
ElseiF Map2(iBx) =9 And Map2(iBx+20) <> 0 And Map2(iBx-20) =4 And Map2(iBx-1) =0 Then
Map2(iBx-1) =15
SetBee(2)
ElseiF Map2(iBx) =6 And Map2(iBx-1) > 0 And Map2(iBx+1) > 0 Then
SetBee(2)
iBee(iBx) =2
ElseiF Map2(iBx) =7 And Map2(iBx+1) > 0 And Map2(iBx-1) > 0 Then
SetBee(1)
iBee(iBx) =2
ElseiF Map2(iBx) =8 And Map2(iBx+20) > 0 And Map2(iBx-20) > 0 Then
SetBee(3)
iBee(iBx) =2
ElseiF Map2(iBx) =9 And Map2(iBx-20) > 0 And Map2(iBx+20) > 0 Then
SetBee(4)
iBee(iBx) =2
End iF
Next: Next
End Sub
Sub MainGame()
While Not Key(vk_space)
Bitmap(pic,0,0,640,480)
ShowMaps()
ScanHead()
ScanBees()
ShowBoxes()
Mushroom()
ShowHead()
ShowBees()
BeeGetHead()
ShowOxygen()
ShowDestroy()
ShowDone()
HeadAround()
ShowPause()
BeeRas = BeeRas +2
iF BeeRas =32 Then: BeeRas =0: End iF
iF Over =3 Then: Text("press space bar!",64,232,32,64): End iF
Text("score:" + Score,32,0,32,32)
Text("Map" + lev,448,0,32,32)
Bitmap(oxy,0,480,640,16)
Text("oxygen:",230,480,16,16)
Text (Str$(count),350,480,16,16)
DrawText()
WaitTimer(20)
ClearSprites()
Wend
End Sub
Sub MainMenu()
While (1)
Bitmap(img,0,0,640,496)
Text("mushroom game",112,32,32,32)
Text("peter wirbelauer",64,66,32,32)
iF Key(vk_up) And yCur > 128 And CurU =0 Then
yCur = yCur -32: CurU =1
PlaySound(w1)
End iF
iF Key(vk_down) And yCur < 160 And CurD =0 Then
yCur = yCur +32: CurD =1
PlaySound(w1)
End iF
Text("maps " + Lev,128,128,32,32)
Text("exit ", 128,160,32,32)
iF Key(vk_left) And yCur =128 And Lev > 1 And CurL =0 Then
Lev = Lev -1: CurL =1
PlaySound(w1)
End iF
iF Key(vk_right) And yCur =128 And Lev <22 And CurR =0 Then
Lev = Lev +1: CurR =1
PlaySound(w1)
End iF
iF Key(vk_return) And yCur =128 Then
LoadMaps()
Initialize()
MainGame()
ElseiF Key(vk_return) And yCur =160 Then
Return
End iF
Sprite(sB,xCur+48,yCur,32,32,0)
DrawText()
WaitTimer(20)
ClearSprites()
iF Not Key(vk_up) Then: CurU =0: End iF
iF Not Key(vk_Down) Then: CurD =0: End iF
iF Not Key(vk_right) Then: CurR =0: End iF
iF Not Key(vk_left) Then: CurL =0: End iF
Wend
End Sub
Lev =1
xCur =128:yCur =128
MainMenu()
End