'init level data
InitLevels()
'init stars and hearts
InitStars()
ResetStars()
' animate title at first
titleshape = Shapes.AddImage(Path + "/sokocute.png")
Shapes.Move(titleshape, 140,-350)
Shapes.Animate(titleshape, 140,170, 2500)
'calculate delay (higher number means more precision)
timestart = Clock.ElapsedMilliseconds
i = 0
while (i < 500000)
i = i + 1
Endwhile
timeloop = Clock.ElapsedMilliseconds - timestart
mssec = timeloop / 500000
loopmssec = 1 / mssec
'try fixed fps - 60 might be enough
loopdelay = (1000/60) * loopmssec
num = 0
While(num < loopdelay)
num = num + 1
endwhile
If gemfall = false and gemwater <> 99 and Clock.ElapsedMilliseconds - watertime > 550 then
Shapes.Animate(crystalimg[gemwater],Shapes.GetLeft(crystalimg[gemwater]), Shapes.GetTop(crystalimg[gemwater]) + 35, 650)
gemfall = true
EndIf
If gemfall = true and gemwater <> 99 and Clock.ElapsedMilliseconds - watertime > 550 and Clock.ElapsedMilliseconds - watertime < 1400 then
gemzoom = gemzoom - gemmove
gemmove = gemmove + 0.001
Sound.Stop(Path + "/sokocute02.wav")
Sound.Play(Path + "/sokocute02.wav")
Shapes.Zoom(crystalimg[gemwater], gemzoom, gemzoom)
EndIf
If gemwater <> 99 and Clock.ElapsedMilliseconds - watertime > 1400 then
Shapes.move(crystalimg[gemwater], 1000, 1000)
Shapes.move(crystalbnk[gemwater], 1000, 1000)
gemwater = 99
gemmove = 0
gemfall = false
EndIf
If (gemchng <> 99) And (Clock.ElapsedMilliseconds - gemtime > 400) Then
if ground[gemy][gemx] = 1 then
Shapes.Move(crystalbnk[gemchng], Shapes.GetLeft(crystalimg[gemchng]), Shapes.GetTop(crystalimg[gemchng]))
Shapes.Move(crystalimg[gemchng], gemchng * 52, -100)
freecells = 0
For y = 0 To 15
For x = 0 To 19
if level[y][x] = 1 then
freecells = freecells + 1
EndIF
EndFor
EndFor
If freecells = 0 then
Sound.Stop(Path + "/sokocute03.wav")
Sound.Play(Path + "/sokocute03.wav")
EndIf
else
Shapes.Move(crystalimg[gemchng], Shapes.GetLeft(crystalbnk[gemchng]), Shapes.GetTop(crystalbnk[gemchng]))
Shapes.Move(crystalbnk[gemchng], gemchng * 52, -100)
endif
gemchng = 99
EndIf
'move the player
If newmove < 25 Then
newmove = newmove + 1
xplayer = xplayer + movex
yplayer = yplayer + movey
Shapes.Move(player1, xplayer, yplayer)
Shapes.Move(player2, xplayer, yplayer)
EndIf
'blinking crystals when level is done
If freecells = 0 And Clock.ElapsedMilliseconds - blinktime > 350 then
For i = 0 to (cryst - 1)
x1 = Shapes.GetLeft(crystalimg[i])
y1 = Shapes.GetTop(crystalimg[i])
x2 = Shapes.GetLeft(crystalbnk[i])
y2 = Shapes.GetTop(crystalbnk[i])
Shapes.Move(crystalimg[i], x2, y2)
Shapes.Move(crystalbnk[i], x1, y1)
EndFor
blink = blink + 1
blinktime = Clock.ElapsedMilliseconds
EndIf
' end level if crystals changed color 10 times
If blink = 10 then
LevelExplosion()
stage = stage + 1
if stage <> 10 then
status = "reset"
resettime = Clock.ElapsedMilliseconds
GraphicsWindow.BrushColor = "#3975e5"
GraphicsWindow.FillRectangle(70,690,170,80)
GraphicsWindow.FillRectangle(800,690,224,85)
endif
'load title sceen when finished level 10
If stage = 10 then
LevelExplosion()
stage = 0
Shapes.Animate(titleshape, 140,170, 2500)
Shapes.Animate(txtstart, 305,420, 3000)
GraphicsWindow.BrushColor = "#3975e5"
GraphicsWindow.FillRectangle(70,690,170,80)
GraphicsWindow.FillRectangle(800,690,224,85)
status = "start"
ResetStars()
resettime = Clock.ElapsedMilliseconds
endif
EndIf
' show time and fps
If Clock.ElapsedMilliseconds - endtime > 1000 And status = "game" Then
gametime = Clock.ElapsedMilliseconds - starttime
GraphicsWindow.BrushColor = "#3975e5"
GraphicsWindow.FontName = "COMIC SANS MS"
GraphicsWindow.FontSize = 25
GraphicsWindow.FillRectangle(800,690,224,85)
GraphicsWindow.BrushColor = "white"
tsecgesamt = Math.Round(gametime/ 1000)
tsec = Math.Remainder(tsecgesamt , 60)
tmingesamt = Math.Floor(tsecgesamt/ 60)
tmin = Math.Remainder(tmingesamt , 60)
thour = Math.Floor(tmingesamt / 60)
If tsec < 10 then
strSec = Text.Append( ":0", tsec)
Else
strSec = Text.Append( ":", tsec)
EndIf
If tmin < 10 then
strMin = Text.Append( "0", tmin)
Else
strMin = Text.Append( "", tmin)
EndIf
If GraphicsWindow.LastKey = leftKey then
bleftKey = true
elseif GraphicsWindow.LastKey = rightKey then
brightKey = true
elseif GraphicsWindow.LastKey = forwardKey then
bforwardKey = true
elseif GraphicsWindow.LastKey = backKey then
bbackKey = true
elseif GraphicsWindow.LastKey = returnKey then
breturnKey = true
elseif GraphicsWindow.LastKey = escapeKey then
bescapeKey = true
endif
endSub
Sub KeyUp
' reset every key first
bleftKey = false
brightKey = false
bforwardKey = false
bbackKey = false
breturnKey = false
If GraphicsWindow.LastKey = pauseKey then
LevelExplosion()
EndIf
If GraphicsWindow.LastKey = escapeKey and status = "start" then
Program.End()
EndIf
If GraphicsWindow.LastKey = escapeKey And status = "game" then
LevelExplosion()
stage = 0
Shapes.Animate(titleshape, 140,170, 2500)
Shapes.Animate(txtstart, 305,420, 3000)
GraphicsWindow.BrushColor = "#3975e5"
GraphicsWindow.FillRectangle(70,690,170,80)
GraphicsWindow.FillRectangle(800,690,224,85)
status = "start"
ResetStars()
resettime = Clock.ElapsedMilliseconds
EndIf
If GraphicsWindow.LastKey = resetKey then
LevelExplosion()
status = "reset"
resettime = Clock.ElapsedMilliseconds
EndIf
If GraphicsWindow.LastKey = pluskey then
LevelExplosion()
'stage = stage + 1 'uncomment this line to cheat with F1
status = "reset"
resettime = Clock.ElapsedMilliseconds
EndIf
If GraphicsWindow.LastKey = minuskey then
'KeyUp()
LevelExplosion()
'stage = stage - 1 'uncomment this line to cheat with F2
status = "reset"
resettime = Clock.ElapsedMilliseconds
EndIf
'reload title after
If GraphicsWindow.LastKey = returnKey and status = "start" then
Shapes.Animate(titleshape, 140,-350, 2000)
Shapes.Animate(txtstart, 305, 1220, 1600)
status = "reset"
resettime = Clock.ElapsedMilliseconds
EndIf
EndSub
Sub Input
If newmove >= 25 and blink = 0 then
'move right
If(brightKey = true) and (level[posy][posx+1] <= 2) Then
'move crystal
if level[posy][posx+1] = 2 and ground[posy][posx+1] <= 1 And (level[posy][posx+2] <= 1 or ground[posy][posx+2] = 3) Then
chestarray[posy][posx+2] = chestarray[posy][posx+1]
chestarray[posy][posx+1] = 99
level[posy][posx+1] = ground[posy][posx+1]
level[posy][posx+2] = 2
Sound.Stop(Path + "/sokocute01.wav")
Sound.Play(Path + "/sokocute01.wav")
'move crystal into water
If ground[posy][posx+2] = 3 then
watertime = Clock.ElapsedMilliseconds
gemwater = chestarray[posy][posx+2]
gemzoom = 1
EndIf
If (ground[posy][posx+2] = 1 and ground[posy][posx+1] <= 0) Or (ground[posy][posx+2] <= 0 and ground[posy][posx+1] = 1) then
gemtime = Clock.ElapsedMilliseconds
gemchng = chestarray[posy][posx+2]
gemy = posy
gemx = posx+2
EndIf
'animate crystal
if ground[posy][posx+1] = 1 then
Shapes.Animate(crystalbnk[chestarray[posy][posx+2]] , (posx+2) * 50 + korrx, (posy) * 40 - 0, 400)
elseif ground[posy][posx+2] = 3 then
Shapes.Animate(crystalimg[chestarray[posy][posx+2]] , (posx+2) * 50 + korrx, (posy) * 40 - 0, 400)
else
Shapes.Animate(crystalimg[chestarray[posy][posx+2]] , (posx+2) * 50 + korrx, (posy) * 40 - 0, 400)
endif
EndIf
'move player right
If level[posy][posx+1] <= 1 then
moves = moves + 1
newmove = 0
movex = 2
movey = 0
posx = posx + 1
gametime = Clock.ElapsedMilliseconds
GraphicsWindow.BrushColor = "#3975e5"
GraphicsWindow.FontName = "COMIC SANS MS"
GraphicsWindow.FontSize = 25
GraphicsWindow.FillRectangle(70,690,170,40)
GraphicsWindow.BrushColor = "white"
GraphicsWindow.DrawText(70, 690, "moves "+ moves)
Endif
'move left
ElseIf( bleftKey = true) and (level[posy][posx-1]<= 2) Then
'move crystal
if level[posy][posx-1] = 2 And ground[posy][posx-1] <= 1 and (level[posy][posx-2] <= 1 or ground[posy][posx-2] = 3) Then
chestarray[posy][posx-2] = chestarray[posy][posx-1]
chestarray[posy][posx-1] = 99
level[posy][posx-1] = ground[posy][posx-1]
level[posy][posx-2] = 2
Sound.Stop(Path + "/sokocute01.wav")
Sound.Play(Path + "/sokocute01.wav")
'move crystal into water
If ground[posy][posx-2] = 3 then
watertime = Clock.ElapsedMilliseconds
gemwater = chestarray[posy][posx-2]
gemzoom = 1
EndIf
If (ground[posy][posx-2] = 1 and ground[posy][posx-1] <= 0) Or (ground[posy][posx-2] <= 0 and ground[posy][posx-1] = 1) then
gemtime = Clock.ElapsedMilliseconds
gemchng = chestarray[posy][posx-2]
gemy = posy
gemx = posx-2
EndIf
'animate crystal
If ground[posy][posx-1] = 1 then
Shapes.Animate(crystalbnk[chestarray[posy][posx-2]] , (posx-2) * 50 + korrx, (posy) * 40 - 0, 400)
elseif ground[posy][posx-2] = 3 then
Shapes.Animate(crystalimg[chestarray[posy][posx-2]] , (posx-2) * 50 + korrx, (posy) * 40 + 0, 400)
else
Shapes.Animate(crystalimg[chestarray[posy][posx-2]] , (posx-2) * 50 + korrx, (posy) * 40 - 0, 400)
endif
EndIf
'move player left
If level[posy][posx-1] <= 1 then
moves = moves + 1
newmove = 0
movex =-2
movey = 0
posx = posx - 1
gametime = Clock.ElapsedMilliseconds
GraphicsWindow.BrushColor = "#3975e5"
GraphicsWindow.FontName = "COMIC SANS MS"
GraphicsWindow.FontSize = 25
GraphicsWindow.FillRectangle(70,690,170,40)
GraphicsWindow.BrushColor = "white"
GraphicsWindow.DrawText(70, 690, "moves "+ moves)
Endif
'move down
ElseIf(bbackKey = true) and (level[posy+1][posx]<= 2) Then
'move crystal
if level[posy+1][posx] = 2 And ground[posy+1][posx] <= 1 and (level[posy+2][posx] <= 1 or ground[posy+2][posx] = 3) Then
chestarray[posy+2][posx] = chestarray[posy+1][posx]
chestarray[posy+1][posx] = 99
level[posy+1][posx] = ground[posy+1][posx]
level[posy+2][posx] = 2
Sound.Stop(Path + "/sokocute01.wav")
Sound.Play(Path + "/sokocute01.wav")
'move crystal into water
If ground[posy+2][posx] = 3 then
watertime = Clock.ElapsedMilliseconds
gemwater = chestarray[posy+2][posx]
gemzoom = 1
EndIf
If (ground[posy+2][posx] = 1 and ground[posy+1][posx] <= 0) Or (ground[posy+2][posx] <= 0 and ground[posy+1][posx] = 1) then
gemtime = Clock.ElapsedMilliseconds
gemchng = chestarray[posy+2][posx]
gemy = posy+2
gemx = posx
EndIf
'animate crystal
if ground[posy+1][posx] = 1 then
Shapes.Animate(crystalbnk[chestarray[posy+2][posx]] , (posx) * 50 + korrx, (posy+2) * 40 - 0, 400)
elseif ground[posy+2][posx] = 3 then
Shapes.Animate(crystalimg[chestarray[posy+2][posx]] , (posx) * 50 + korrx, (posy+2) * 40 + 0, 400)
else
Shapes.Animate(crystalimg[chestarray[posy+2][posx]] , (posx) * 50 + korrx, (posy+2) * 40 - 0, 400)
endif
EndIf
'move player down
If level[posy+1][posx] <= 1 then
moves = moves + 1
newmove = 0
movex = 0
movey = 1.6
posy = posy + 1
gametime = Clock.ElapsedMilliseconds
GraphicsWindow.BrushColor = "#3975e5"
GraphicsWindow.FontName = "COMIC SANS MS"
GraphicsWindow.FontSize = 25
GraphicsWindow.FillRectangle(70,690,170,40)
GraphicsWindow.BrushColor = "white"
GraphicsWindow.DrawText(70, 690, "moves "+ moves)
Endif
'move up
ElseIf(bforwardKey = true) and (level[posy-1][posx]<= 2) Then
'move crystal
if level[posy-1][posx] = 2 And ground[posy-1][posx] <= 1 And (level[posy-2][posx] <= 1 or ground[posy-2][posx] = 3) Then
chestarray[posy-2][posx] = chestarray[posy-1][posx]
chestarray[posy-1][posx] = 99
level[posy-1][posx] = ground[posy-1][posx]
level[posy-2][posx] = 2
Sound.Stop(Path + "/sokocute01.wav")
Sound.Play(Path + "/sokocute01.wav")
'move crystal into water
If ground[posy-2][posx] = 3 then
watertime = Clock.ElapsedMilliseconds
gemwater = chestarray[posy-2][posx]
gemzoom = 1
EndIf
If (ground[posy-2][posx] = 1 and ground[posy-1][posx] <= 0) Or (ground[posy-2][posx] <= 0 and ground[posy-1][posx] = 1) then
gemtime = Clock.ElapsedMilliseconds
gemchng = chestarray[posy-2][posx]
gemy = posy-2
gemx = posx
EndIf
'animate crystal
if ground[posy-1][posx] = 1 then
Shapes.Animate(crystalbnk[chestarray[posy-2][posx]] , (posx) * 50 + korrx, (posy-2) * 40 - 0, 400)
elseif ground[posy-2][posx] = 3 then
Shapes.Animate(crystalimg[chestarray[posy-2][posx]] , (posx) * 50 + korrx, (posy-2) * 40 + 0, 400)
else
Shapes.Animate(crystalimg[chestarray[posy-2][posx]] , (posx) * 50 + korrx, (posy-2) * 40 - 0, 400)
endif
EndIf
'move player up
if level[posy-1][posx] <= 1 then
moves = moves + 1
newmove = 0
movex = 0
movey =-1.6
posy = posy - 1
gametime = Clock.ElapsedMilliseconds
GraphicsWindow.BrushColor = "#3975e5"
GraphicsWindow.FontName = "COMIC SANS MS"
GraphicsWindow.FontSize = 25
GraphicsWindow.FillRectangle(70,690,170,40)
GraphicsWindow.BrushColor = "white"
GraphicsWindow.DrawText(70, 690, "moves "+ moves)
EndIf
EndIf
EndIf
EndSub
Sub Sort
For y = 0 To 15
For x = 0 To 15
If level[y][x] = 3 Then
Shapes.Remove(levelshapes[y][x])
levelshapes[y][x] = Shapes.AddImage(image["3"])
Shapes.Move(levelshapes[y][x], (x) * 50 + korrx, (y) * 40 - 0)
endif
'GraphicsWindow.DrawText(11*i+520,11*p+30,level[p][i])
EndFor
EndFor
EndSub
For i = 0 To shade
angle = Math.GetRandomNumber(360)
xv = Math.Cos(angle * 0.0174) * 1200
yv = Math.Sin(angle * 0.0174) * 600
Shapes.Animate(Shadow[i], xv + 512, yv + 350, 1500)
EndFor
For i = 0 To cryst
angle = Math.GetRandomNumber(360)
xv = Math.Cos(angle * 0.0174) * 1200
yv = Math.Sin(angle * 0.0174) * 600
If Shapes.GetTop(crystalimg[i]) > 0 then
Shapes.Animate(crystalimg[i], xv + 512, yv + 350, 1500)
EndIf
If Shapes.GetTop(crystalbnk[i]) > 0 then
Shapes.Animate(crystalbnk[i], xv + 512, yv + 350, 1500)
EndIf
EndFor
For y = 0 To 15
For x = 0 To 19
angle = Math.GetRandomNumber(360)
xv = Math.Cos(angle * 0.0174) * 1200
yv = Math.Sin(angle * 0.0174) * 600
Shapes.Animate(levelshapes[y][x], xv + 512, yv + 350, 1500)
EndFor
EndFor
EndSub
Sub LevelRelease
For y = 0 To 15
For x = 0 To 19
Shapes.Remove(levelshapes[y][x])
EndFor
EndFor
For i = 0 To shade
Shapes.Remove(Shadow[i])
EndFor
For i = 0 To cryst
Shapes.Remove(crystalimg[i])
Shapes.Remove(crystalbnk[i])
EndFor
For i = 0 To 20
Shapes.Remove(star)
endFor
EndSub
For i = 0 To 15
For p = 1 To Text.GetLength(block[stage][i])
blockcode = Text.GetSubText(block[stage][i], p, 1)
If blockcode = "X" then
posy = i
posx = p-1
blockcode = 0
EndIf
if blockcode = 2 then
ground[i][p-1] = 0
elseif blockcode = "C" then 'crystal on gras
ground[i][p-1] = "A"
elseif blockcode = "D" then 'crystal on wood
ground[i][p-1] = "B"
else
ground[i][p-1] = blockcode
endif
EndFor
EndFor
'load the water first
For i = 0 To 15
For p = 1 To Text.GetLength(block[stage][i])
blockcode = Text.GetSubText(block[stage][i], p, 1)
If blockcode = 3 Then
levelshapes[i][p-1] = Shapes.AddImage(image[blockcode])
angle = Math.GetRandomNumber(360)
xv = Math.Cos(angle * 0.0174) * 1000
yv = Math.Sin(angle * 0.0174) * 550
Shapes.Move(levelshapes[i][p-1], xv + 512, yv + 350)
Shapes.animate(levelshapes[i][p-1], (p-1) * 50 + korrx, (i) * 40 - 0, animtime)
Endif
EndFor
EndFor
'shadows for the water
LoadShadowWater()
For i = 0 To 15
For p = 1 To Text.GetLength(block[stage][i])
blockcode = Text.GetSubText(block[stage][i], p, 1)
If blockcode = "X" then
posy = i
posx = p-1
blockcode = 0
elseIf blockcode = "Y" then
posy = i
posx = p-1
blockcode = "A"
elseIf blockcode = "Z" then
posy = i
posx = p-1
blockcode = "B"
EndIf
if blockcode = 2 then
ground[i][p-1] = 0
elseif blockcode = "C" then
ground[i][p-1] = "A"
elseif blockcode = "D" then
ground[i][p-1] = "B"
else
ground[i][p-1] = blockcode
endif
'tried to fix strange shapes.animate behaviors if there are too many shapes flying around - no real success...
loopdelay = (1600) * loopmssec
num = 0
While(num < loopdelay)
num = num + 1
endwhile
'load blocks
f = 0
For i = 0 To 15
For p = 1 To Text.GetLength(block[stage][i])
blockcode = Text.GetSubText(block[stage][i], p, 1)
If blockcode = 2 or blockcode = "C" or blockcode = "D" Then
crystalimg[cryst] = Shapes.AddImage(image[2])
crystalbnk[cryst] = Shapes.AddImage(Path + "/sokocuteg2.png")
chestarray[i][p-1] = cryst
angle = Math.GetRandomNumber(360)
xv = Math.Cos(angle * 0.0174) * 1200
yv = Math.Sin(angle * 0.0174) * 600
Shapes.Move(crystalimg[cryst], xv + 512, yv + 350)
Shapes.animate(crystalimg[cryst] , (p-1) * 50 + korrx, (i) * 40 - 0, animtime*1.5)
'Shapes.Move(crystalimg[cryst] , (p-1) * 50 + korrx, (i) * 40 - 0)
Shapes.Move(crystalbnk[cryst] , cryst * 52 , -100)
cryst = cryst + 1
Endif
EndFor
EndFor
player1 = Shapes.AddImage(Path + "/sokocutep2.png")
'load lower player shape first. it has to be behind the walls
Shapes.Move(player1, (posx) * 50 + korrx, (posy) * 40 - 0)
LoadShadow()
'------------------------------------------------------------
'load the walls
For i = 0 To 15
For p = 1 To Text.GetLength(block[stage][i])
blockcode = Text.GetSubText(block[stage][i], p, 1)
If blockcode >= 4 Then
levelshapes[i][p-1] = Shapes.AddImage(image[blockcode])
angle = Math.GetRandomNumber(360)
xv = Math.Cos(angle * 0.0174) * 1000
yv = Math.Sin(angle * 0.0174) * 550
Shapes.Move(levelshapes[i][p-1], xv + 512, yv + 350)
Shapes.animate(levelshapes[i][p-1], (p-1) * 50 + korrx, (i) * 40 - 0, animtime)
Endif
EndFor
EndFor
'load players face at last. It has always to be in front of the walls
player2 = Shapes.AddImage(Path + "/sokocutep1.png")
Shapes.Move(player2, (posx) * 50 + korrx, (posy) * 40 - 0)
xplayer = Shapes.GetLeft(player1)
yplayer = Shapes.GetTop(player1)
EndSub
sub LoadShadow
For y = 0 To 15
For x = 0 To 19
If level[y][x] <= 2 and level[y][x] <> " " Then
angle = Math.GetRandomNumber(360)
xv = Math.Cos(angle * 0.0174) * 1200
yv = Math.Sin(angle * 0.0174) * 600
If level[y][x-1] >= 6 then
Shadow[shade] = Shapes.AddImage(Path + "/SW.png")
Shapes.Move(Shadow[shade], xv + 512, yv + 350)
Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 - 0, animtime*1.2)
shade = shade + 1
EndIf
If level[y][x+1] >= 6 then
Shadow[shade] = Shapes.AddImage(Path + "/SE.png")
Shapes.Move(Shadow[shade], xv + 512, yv + 350)
Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 - 0, animtime*1.2)
shade = shade + 1
EndIf
If level[y-1][x] >= 6 then
Shadow[shade] = Shapes.AddImage(Path + "/SN.png")
Shapes.Move(Shadow[shade], xv + 512, yv + 350)
Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 - 0, animtime*1.2)
shade = shade + 1
EndIf
If level[y][x-1] <=2 and level[y-1][x] <= 2 and level[y-1][x-1] >= 6 then
Shadow[shade] = Shapes.AddImage(Path + "/SNW.png")
Shapes.Move(Shadow[shade], xv + 512, yv + 350)
Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 - 0, animtime*1.2)
shade = shade + 1
EndIf
If level[y][x+1] <=2 and level[y-1][x] <= 2 and level[y-1][x+1] >= 6 then
Shadow[shade] = Shapes.AddImage(Path + "/SNE.png")
Shapes.Move(Shadow[shade], xv + 512, yv + 350)
Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 - 0, animtime*1.2)
shade = shade + 1
EndIf
If level[y][x-1] <=2 and level[y+1][x] <= 2 and level[y+1][x-1] >= 6 then
Shadow[shade] = Shapes.AddImage(Path + "/SSW.png")
Shapes.Move(Shadow[shade], xv + 512, yv + 350)
Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 - 0, animtime*1.2)
shade = shade + 1
EndIf
If level[y][x+1] <=2 and level[y+1][x] <= 2 and level[y+1][x+1] >= 6 then
Shadow[shade] = Shapes.AddImage(Path + "/SSE.png")
Shapes.Move(Shadow[shade], xv + 512, yv + 350)
Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 - 0, animtime*1.2)
shade = shade + 1
EndIf
endif
EndFor
EndFor
EndSub
sub LoadShadowWater
shade = 0
ky = 22
For y = 0 To 15
For x = 0 To 19
If ground[y][x] = 3 Then
angle = Math.GetRandomNumber(360)
xv = Math.Cos(angle * 0.0174) * 1200
yv = Math.Sin(angle * 0.0174) * 600
If ground[y][x-1] <> 3 and ground[y][x-1] >= 0 and ground[y][x-1] <> " " then
Shadow[shade] = Shapes.AddImage(Path + "/SW.png")
Shapes.Move(Shadow[shade], xv + 512, yv + 350)
Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 + ky, animtime*1.2)
shade = shade + 1
EndIf
If ground[y][x+1] <> 3 and ground[y+1][x] >= 0 and ground[y][x+1] <> " " then
Shadow[shade] = Shapes.AddImage(Path + "/SE.png")
Shapes.Move(Shadow[shade], xv + 512, yv + 350)
Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 + ky, animtime*1.2)
shade = shade + 1
EndIf
If ground[y-1][x] <> 3 and ground[y-1][x] >= 0 and ground[y-1][x] <> " " then
Shadow[shade] = Shapes.AddImage(Path + "/SN.png")
Shapes.Move(Shadow[shade], xv + 512, yv + 350)
Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 + ky, animtime*1.2)
shade = shade + 1
EndIf
If ground[y][x-1] = 3 and ground[y-1][x] = 3 and ground[y-1][x-1] <> 3 and ground[y-1][x-1] >= 0 then
Shadow[shade] = Shapes.AddImage(Path + "/SNW.png")
Shapes.Move(Shadow[shade], xv + 512, yv + 350)
Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 + ky, animtime*1.2)
shade = shade + 1
EndIf
If ground[y][x+1] = 3 and ground[y-1][x] = 3 and ground[y-1][x+1] <> 3 and ground[y-1][x+1] >= 0 then
Shadow[shade] = Shapes.AddImage(Path + "/SNE.png")
Shapes.Move(Shadow[shade], xv + 512, yv + 350)
Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 + ky, animtime*1.2)
shade = shade + 1
EndIf
If ground[y][x-1] = 3 and ground[y+1][x] = 3 and ground[y+1][x-1] <> 3 and ground[y+1][x-1] >= 0 then
Shadow[shade] = Shapes.AddImage(Path + "/SSW.png")
Shapes.Move(Shadow[shade], xv + 512, yv + 350)
Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 + ky, animtime*1.2)
shade = shade + 1
EndIf
If ground[y][x+1] = 3 and ground[y+1][x] = 3 and ground[y+1][x+1] <> 3 and ground[y+1][x+1] >= 0 then
Shadow[shade] = Shapes.AddImage(Path + "/SSE.png")
Shapes.Move(Shadow[shade], xv + 512, yv + 350)
Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 + ky, animtime*1.2)
shade = shade + 1
EndIf
endif
EndFor
EndFor
EndSub
Sub InitStars
For i = 0 To 12
star[i] = Shapes.AddImage(Path + "/sokocutels.png")
heart[i] = Shapes.AddImage(Path + "/sokocutelh.png")
endFor
EndSub
block[9][0] = " AAAAA A A AAAA "
block[9][1] = " A A A A "
block[9][2] = " A AAAAA AAA "
block[9][3] = " A A A A "
block[9][4] = " A A A AAAA "
block[9][5] = " "
block[9][6] = " AAAA A A AAA "
block[9][7] = " A AA A A A "
block[9][8] = " AAA A A A A A "
block[9][9]= " A A AA A A "
block[9][10]= " AAAA A A AAA "
block[9][11]= " "
block[9][12]= " "
block[9][13]= " 4444444444444444 "
block[9][14]= " 40X0020000000104 "
block[9][15]= " 4444444444444444 "