HAHA, well I never, cheers for that, I have been wondering how to do that for a while lol
Oh and for those that are interested in seeing the code so far, then here you go
Don't expect the most efficient code as I am just getting back into this coding thing
// Project: Colour Splash V2
// Created: 2015-02-05
// By: Paul Harthen
// Load music and game sounds
titleMusic = LoadMusic("/media/sounds/csplash.mp3")
SetMusicFileVolume( titleMusic, 100 )
PlayMusic( titleMusic, 0 )
global click
global splat
global pop
global boing
global wip
click = LoadSound("/media/sounds/click.wav")
splat = LoadSound("/media/sounds/splat.wav")
pop = LoadSound("/media/sounds/pop.wav")
boing = LoadSound("/media/sounds/boing.wav")
wip = LoadSound("/media/sounds/wip.wav")
// ***** Set some properties *****
#Constant scrWidth = 1280
#Constant scrHeight = 800
#Constant pageWidth = 1150
#Constant pageHeight = 800
#Constant maxPagePieces = 94
#Constant numPages = 3
#Constant numColours = 27
global pageNum = 0
global spriteTotal = 1
global memBlockMap = 1
global GameOver = 1
butWidth = 130
butHeight = 128
colEndPos_Y = scrHeight-butHeight
colEndLimit_Y = 2785
colSpeedMax = 100
global colStart = 22
SelectColour = 0
frictionCol# = 0.25
// ***** End of set some properties *****
// ***** Set display properties *****
SetVirtualResolution( scrWidth, scrHeight )
SetOrientationAllowed( 0, 0, 1, 1 )
SetSyncRate ( 60, 0 )
// ***** End of set display properties *****
// ***** Colour Palette Setup *****
Type colourType
iImage as integer
iButton as integer
iRed as integer
iGreen as integer
iBlue as integer
Endtype
global colour as colourType[numColours]
for i = 0 to numColours
colour[i].iImage = Loadimage ("/media/colours/colour" + str(i) + ".png")
colour[i].iButton = CreateSprite (colour[i].iImage)
SetSpritePosition(colour[i].iButton ,pageWidth , i * GetSpriteHeight(colour[i].iButton) - colEndLimit_Y)
SetSpriteAnimation (colour[i].iButton, butWidth, butHeight, 2)
next i
RGBData()
colourPaint = colour[colStart].iButton
global red as integer
global green as integer
global blue as integer
red = colour[colStart].iRed
green = colour[colStart].iGreen
blue = colour[colStart].iBlue
alpha = 255
PlaySprite (colourPaint, 30, 0, 1, 2)
// ***** End of colour palette setup *****
// ***** Routine to set up the side panel *****
#Constant panelNum = 6
Type panelType
iSprImage as integer
iSprNum as integer
iX as integer
iY as integer
Endtype
panelStartXPOS = -130
global panel as panelType[panelNum]
panel[1].iX = panelStartXPOS : panel[1].iY = 100
panel[2].iX = panelStartXPOS + 8 : panel[2].iY = 140
panel[3].iX = panelStartXPOS + 66 : panel[3].iY = 180
panel[4].iX = panelStartXPOS + 12 : panel[4].iY = 265
panel[5].iX = panelStartXPOS + 12 : panel[5].iY = 415
panel[6].iX = panelStartXPOS + 12 : panel[6].iY = 565
for i = 1 to 6
panel[i].iSprImage = LoadImage ( "/media/panel/panel" + str(i) + ".png" )
panel[i].iSprNum = CreateSprite ( panel[i].iSprImage )
SetSpritePosition ( panel[i].iSprNum, panel[i].iX, panel[i].iY )
if i = 2 or i = 3 then SetSpriteAnimation (panel[i].iSprNum, 66, 50, 2)
if i >=4 and i <=6 then SetSpriteAnimation (panel[i].iSprNum, 117, 91, 2)
next i
panelLimit = GetSpriteWidth(panel[1].iSprNum) - 50
SetSpriteDepth ( panel[1].iSprNum, 5 )
SetSpriteDepth ( panel[2].iSprNum, 4 )
SetSpriteDepth ( panel[3].iSprNum, 3 )
SetSpriteDepth ( panel[4].iSprNum, 2 )
SetSpriteDepth ( panel[5].iSprNum, 1 )
SetSpriteDepth ( panel[6].iSprNum, 0 )
// ***** End of routine to set up the side panel *****
// ***** Initialise sprites and memBlocks for pages *****
Type pageType
sMapFile as string
sDatFile as string
Endtype
global page as pageType[numPages]
for i = 0 to numPages
page[i].sMapFile = "/media/pages/picdat" + str(i) + "/master.png"
page[i].sDatFile = "/media/pages/picdat" + str(i) + "/map.dat"
next i
Type spriteType
iSprImage as integer
iSprNum as integer
iLeft as integer
iTop as integer
iWidth as integer
iHeight as integer
Endtype
global sprite as spriteType[maxPagePieces]
titleScreen()
loadPageSprites ( 2, 1 )
music = 1
// ***** end of initialise sprites and memBlocks for pages *****
// ***** Start of main game loop *****
do
mouseX# = GetPointerX()
mouseY# = GetPointerY()
//isitPlaying = GetMusicPlaying(titleMusic)
if GetMusicPlaying()=0 and music=1
DeleteMusic(titleMusic)
music =0
endif
if GetPointerPressed()=1 and mouseX# >= 0 and mouseX# < pageWidth and mouseY# >= 0 and mouseY# <= pageHeight
// This part colours the image
selectColour = 0
directionColour = 0
if GetSpriteHit ( mouseX#, mouseY# ) = panel[1].iSprNum
PlaySound(click)
controlPanel ( panelLimit, spriteTotal )
else
mapFileID = readMap( mouseX#, mouseY#, pageWidth)
soundRND = Random(1, 3)
if soundRND = 1
PlaySound(pop)
elseif soundRND = 2
PlaySound(boing)
elseif soundRND = 3
PlaySound(wip)
endif
if mapFileID > 0
SetSpriteColor( sprite[mapFileID].iSprNum, red, green, blue, 255)
endif
endif
elseif GetPointerPressed()=1 and mouseX# >= pageWidth and mouseX# <= scrWidth and mouseY# >= 0 and mouseY# <= scrHeight
jumpPoint:
oldMouseY# = mouseY#
selectColour = 1
colourHit = GetSpriteHit ( mouseX#, mouseY# )
while GetPointerReleased()=0
// This section of the loop is for the colour button selection
mouseX# = GetPointerX()
mouseY# = GetPointerY()
if mouseY# < oldMouseY#
// Colours Move Up
directionColour = 1
colSpeed# = (oldMouseY# - mouseY#)
if colSpeed# > 2
selectColour = 0
if colSpeed# > colSpeedMax then colSpeed# = colSpeedMax
endif
oldMouseY# = mouseY#
// display colour pallete
for i = 0 to numColours
if GetSpriteY(colour[numColours].iButton) <= colEndPos_Y
SetSpritePosition(colour[numColours].iButton ,pageWidth ,colEndPos_Y )
SetSpritePosition(colour[i].iButton ,pageWidth ,i * GetSpriteHeight(colour[i].iButton) - colEndLimit_Y )
else
SetSpritePosition(colour[i].iButton ,pageWidth ,GetSpriteY(colour[i].iButton) - colSpeed# )
endif
next i
elseif mouseY# > oldMouseY#
// Colours Move Down
directionColour = 2
colSpeed# = (mouseY# - oldMouseY#)
if colSpeed# > 2
selectColour = 0
if colSpeed# > colSpeedMax then colSpeed# = colSpeedMax
endif
oldMouseY# = mouseY#
// display colour pallete
for i = 0 to numColours
if GetSpriteY (colour[0].iButton) >= 0
SetSpritePosition(colour[i].iButton ,pageWidth ,i * GetSpriteHeight(colour[i].iButton))
else
SetSpritePosition(colour[i].iButton ,pageWidth ,GetSpriteY(colour[i].iButton) + colSpeed#)
endif
next i
endif
Sync()
endWhile
if selectColour = 1
if colourHit <> colourPaint
oldColourPaint = colourPaint
colourPaint = colourHit
PlaySound(splat)
PlaySprite (colourPaint, 30, 0, 1, 2)
PlaySprite (oldColourPaint, 30, 0, 2, 1)
for i = 0 to numColours
if colourPaint = colour[i].iButton
red = colour[i].iRed
green = colour[i].iGreen
blue = colour[i].iBlue
endif
next i
endif
selectColour = 0
endif
if directionColour > 0
while colSpeed# > 0
if directionColour = 1
for i = 0 to numColours
if GetSpriteY(colour[numColours].iButton) <= colEndPos_Y
SetSpritePosition(colour[i].iButton ,pageWidth ,i * GetSpriteHeight(colour[i].iButton) - colEndLimit_Y )
else
SetSpritePosition(colour[i].iButton ,pageWidth ,GetSpriteY(colour[i].iButton) - colSpeed# )
endif
next i
elseif directionColour = 2
for i = 0 to numColours
if GetSpriteY (colour[0].iButton) >= 0
SetSpritePosition(colour[0].iButton ,pageWidth ,0)
SetSpritePosition(colour[i].iButton ,pageWidth ,i * GetSpriteHeight(colour[i].iButton))
colSpeed# = 0
else
SetSpritePosition(colour[i].iButton ,pageWidth ,GetSpriteY(colour[i].iButton) + colSpeed#)
endif
next i
endif
colSpeed# = colSpeed# - frictionCol#
Sync()
mouseX# = GetPointerX()
mouseY# = GetPointerY()
if GetPointerPressed()=1 and mouseX# >= 0 and mouseX# < pageWidth and mouseY# >= 0 and mouseY# <= pageHeight
mapFileID = readMap( mouseX#, mouseY#, pageWidth)
if mapFileID > 0
SetSpriteColor( sprite[mapFileID].iSprNum, red, green, blue, 255)
endif
elseif GetPointerPressed()=1 and mouseX# >= pageWidth and mouseX# <= scrWidth and mouseY# >= 0 and mouseY# <= scrHeight
oldMouseY# = mouseY#
goto jumpPoint
endif
endwhile
directionColour = 0
colSpeed# = 0
endif
endif
if GameOver = 0
End
endif
Sync()
loop
// ***** End of main game loop *****
// ********** FUNCTIONS **********
// ***** Data for colour buttons *****
function RGBData()
colour[ 0].iRed= 10 : colour[ 0].iGreen= 10 : colour[ 0].iBlue= 10
colour[ 1].iRed=168 : colour[ 1].iGreen= 84 : colour[ 1].iBlue= 0
colour[ 2].iRed=175 : colour[ 2].iGreen=109 : colour[ 2].iBlue= 73
colour[ 3].iRed=180 : colour[ 3].iGreen=180 : colour[ 3].iBlue=180
colour[ 4].iRed=255 : colour[ 4].iGreen=255 : colour[ 4].iBlue=255
colour[ 5].iRed=255 : colour[ 5].iGreen=213 : colour[ 5].iBlue=226
colour[ 6].iRed=255 : colour[ 6].iGreen=174 : colour[ 6].iBlue=201
colour[ 7].iRed=255 : colour[ 7].iGreen=136 : colour[ 7].iBlue=174
colour[ 8].iRed=255 : colour[ 8].iGreen= 64 : colour[ 8].iBlue= 64
colour[ 9].iRed=236 : colour[ 9].iGreen= 0 : colour[ 9].iBlue= 0
colour[10].iRed=200 : colour[10].iGreen= 0 : colour[10].iBlue= 0
colour[11].iRed=255 : colour[11].iGreen=125 : colour[11].iBlue= 0
colour[12].iRed=255 : colour[12].iGreen=255 : colour[12].iBlue=130
colour[13].iRed=255 : colour[13].iGreen=255 : colour[13].iBlue= 0
colour[14].iRed=166 : colour[14].iGreen=234 : colour[14].iBlue= 51
colour[15].iRed=157 : colour[15].iGreen=202 : colour[15].iBlue= 23
colour[16].iRed=108 : colour[16].iGreen=255 : colour[16].iBlue=108
colour[17].iRed= 0 : colour[17].iGreen=255 : colour[17].iBlue= 0
colour[18].iRed= 0 : colour[18].iGreen=191 : colour[18].iBlue= 0
colour[19].iRed=159 : colour[19].iGreen=255 : colour[19].iBlue=255
colour[20].iRed= 94 : colour[20].iGreen=255 : colour[20].iBlue=255
colour[21].iRed= 0 : colour[21].iGreen=247 : colour[21].iBlue=247
colour[22].iRed= 0 : colour[22].iGreen=180 : colour[22].iBlue=247
colour[23].iRed= 0 : colour[23].iGreen=100 : colour[23].iBlue=247
colour[24].iRed= 0 : colour[24].iGreen= 0 : colour[24].iBlue=255
colour[25].iRed=194 : colour[25].iGreen=118 : colour[25].iBlue=194
colour[26].iRed=184 : colour[26].iGreen= 36 : colour[26].iBlue=255
colour[27].iRed=139 : colour[27].iGreen= 0 : colour[27].iBlue=206
endfunction
// Function to read x,y byte of RED value from memBlockMap image
function readMap( x, y, width)
offset = 12 + (( x + ( y * width )) * 4 )
redVal = GetMemBlockByte ( memBlockMap, offset )
endfunction redVal
// Function for the use of the control panel
function controlPanel (panelLimit, spriteTotal)
speed=100
menu = 1
for i = 0 to panelLimit step 10
for panels = 1 to 6
SetSpritePosition ( panel[panels].iSprNum, panel[panels].iX + i, panel[panels].iY )
next panels
Sync()
next i
while menu > 0
mouseX# = GetPointerX()
mouseY# = GetPointerY()
if GetPointerPressed()=1 and GetSpriteHit ( mouseX#, mouseY# ) = panel[6].iSprNum
// Exit Button
PlaySound(click)
PlaySprite (panel[6].iSprNum, speed, 0, 1, 2)
Sync()
while GetPointerReleased()=0
Sync()
endwhile
PlaySprite (panel[6].iSprNum, speed, 0, 2, 1)
panelBack( panelLimit )
EndGame()
menu = 0
elseif GetPointerPressed()=1 and GetSpriteHit ( mouseX#, mouseY# ) = panel[5].iSprNum
// Help Button
PlaySound(click)
PlaySprite (panel[5].iSprNum, speed, 0, 1, 2)
Sync()
while GetPointerReleased()=0
Sync()
endwhile
PlaySprite (panel[5].iSprNum, speed, 0, 2, 1)
// Help routine here
instructions()
panelBack( panelLimit )
menu = 0
elseif GetPointerPressed()=1 and GetSpriteHit ( mouseX#, mouseY# ) = panel[4].iSprNum
// Wipe Clean Button
PlaySound(click)
PlaySprite (panel[4].iSprNum, speed, 0, 1, 2)
Sync()
while GetPointerReleased()=0
Sync()
endwhile
PlaySprite (panel[4].iSprNum, speed, 0, 2, 1)
Sync()
for i = 1 to spriteTotal
SetSpriteColor( sprite[i].iSprNum, 255, 255, 255, 255)
next i
panelBack( panelLimit )
menu = 0
elseif GetPointerPressed()=1 and GetSpriteHit ( mouseX#, mouseY# ) = panel[2].iSprNum
// Left Button
PlaySound(click)
PlaySprite (panel[2].iSprNum, speed, 0, 1, 2)
Sync()
while GetPointerReleased()=0
Sync()
endwhile
pageNum = pageNum + 1
if pageNum > numPages then pageNum = 1
PlaySprite (panel[2].iSprNum, speed, 0, 2, 1)
loadPageSprites ( 1, 1 )
panelBack( panelLimit )
menu = 0
elseif GetPointerPressed()=1 and GetSpriteHit ( mouseX#, mouseY# ) = panel[3].iSprNum
// Right Button
PlaySound(click)
PlaySprite (panel[3].iSprNum, speed, 0, 1, 2)
Sync()
while GetPointerReleased()=0
Sync()
endwhile
PlaySprite (panel[3].iSprNum, speed, 0, 2, 1)
pageNum = pageNum - 1
if pageNum < 1 then pageNum = numPages
loadPageSprites ( 2, 1 )
panelBack( panelLimit )
menu = 0
elseif GetPointerPressed()=1 and GetSpriteHit ( mouseX#, mouseY# ) = panel[1].iSprNum
// Just tapping the panel returns it
PlaySound(click)
while GetPointerReleased()=0
Sync()
endwhile
panelBack( panelLimit )
menu = 0
endif
Sync()
endwhile
endfunction
//
function panelBack( panelLimit )
for i = panelLimit to 0 step -10
for panels = 1 to 6
SetSpritePosition ( panel[panels].iSprNum, panel[panels].iX + i, panel[panels].iY )
next panels
Sync()
next i
endfunction
// Function to control page loads
function loadPageSprites ( direction, trigger )
// Direction - 1 = Up - 2 = Down
// Trigger - 0 for just page animation - 1 for delete old sprites and memBlockMap then animation
if trigger = 1
pageOut ( direction )
deletePageSprites ()
endif
memBlockMap = CreateMemblockFromImage (LoadImage (page[pageNum].sMapFile))
OpenToRead ( 1, page[pageNum].sDatFile )
spriteTotal = ReadInteger ( 1 )
for skip = 1 to 3
ReadInteger ( 1 )
next skip
for i = 1 to spriteTotal
sprite[i].iLeft = ReadInteger ( 1 )
sprite[i].iTop = ReadInteger ( 1 )
sprite[i].iWidth = ReadInteger ( 1 )
sprite[i].iHeight = ReadInteger ( 1 )
if i < 10
zero$="00"
elseif i >= 10 and i < 100
zero$="0"
else
zero$=""
endif
sprite[i].iSprImage = LoadImage ( "/media/pages/picdat" + str(pageNum) + "/op" + zero$ + str(i) +".png" )
sprite[i].iSprNum = CreateSprite ( sprite[i].iSprImage )
if direction = 1
SetSpritePosition ( sprite[i].iSprNum, sprite[i].iLeft, sprite[i].iTop + scrHeight )
elseif direction = 2
SetSpritePosition ( sprite[i].iSprNum, sprite[i].iLeft, sprite[i].iTop - scrHeight )
endif
CreateTweenSprite( i, 2.0 )
if direction = 1
SetTweenSpriteY( i, sprite[i].iTop + scrHeight, sprite[i].iTop, TweenBounce())
elseif direction = 2
SetTweenSpriteY( i, sprite[i].iTop - scrHeight, sprite[i].iTop, TweenBounce())
endif
PlayTweenSprite( i, sprite[i].iSprNum, .1 )
next i
CloseFile ( 1 )
DeleteAllText()
while GetTweenSpritePlaying( spriteTotal, sprite[spriteTotal].iSprNum )
UpdateAllTweens( GetFrameTime() )
Sync()
endwhile
for i = 1 to spriteTotal
DeleteTween( i )
next i
endfunction
function deletePageSprites ()
for i = 1 to spriteTotal
DeleteSprite( sprite[i].iSprNum )
DeleteImage( sprite[i].iSprImage )
next i
DeleteMemblock( memBlockMap )
endfunction
function pageOut ( direction )
// Direction - 1 = Up - 2 = Down
for i = 1 to spriteTotal
CreateTweenSprite( i, 1.0 )
if direction = 1
SetTweenSpriteY( i, sprite[i].iTop, sprite[i].iTop - scrHeight, TweenSmooth2())
elseif direction = 2
SetTweenSpriteY( i, sprite[i].iTop, sprite[i].iTop + scrHeight, TweenSmooth1())
endif
PlayTweenSprite( i, sprite[i].iSprNum, .1 )
UpdateAllTweens( GetFrameTime() )
Sync()
next i
CreateText(1,"Loading Picture.....")
SetTextSize(1,48)
SetTextColor( 1, 150, 0, 150, 255 )
SetTextPosition(1,300,370)
while GetTweenSpritePlaying( spriteTotal, sprite[spriteTotal].iSprNum )
UpdateAllTweens( GetFrameTime() )
Sync()
endwhile
for i = 1 to spriteTotal
DeleteTween( i )
next i
endfunction
// Function for title screen routine
function titleScreen()
delay = 50
loadPageSprites ( 2, 0 )
pageNum = 1
SetSpriteColor( sprite[1].iSprNum, red, green, blue, 255)
SetSpriteColor( sprite[18].iSprNum, red, green, blue, 255)
SetSpriteColor( sprite[19].iSprNum, red, green, blue, 255)
SetSpriteColor( sprite[48].iSprNum, red, green, blue, 255)
SetSpriteColor( sprite[47].iSprNum, red, green, blue, 255)
SetSpriteColor( sprite[32].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
red = colour[27].iRed
green = colour[27].iGreen
blue = colour[27].iBlue
SetSpriteColor( sprite[7].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[14].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[36].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[39].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[35].iSprNum, red, green, blue, 255)
SetSpriteColor( sprite[49].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
red = colour[26].iRed
green = colour[26].iGreen
blue = colour[26].iBlue
SetSpriteColor( sprite[13].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[15].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[38].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[40].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
red = colour[25].iRed
green = colour[25].iGreen
blue = colour[25].iBlue
SetSpriteColor( sprite[6].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[16].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[33].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[34].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
red = colour[9].iRed
green = colour[9].iGreen
blue = colour[9].iBlue
SetSpriteColor( sprite[2].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[28].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[26].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
red = colour[10].iRed
green = colour[10].iGreen
blue = colour[10].iBlue
SetSpriteColor( sprite[4].iSprNum, red, green, blue, 255)
SetSpriteColor( sprite[3].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[22].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[24].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[30].iSprNum, red, green, blue, 255)
SetSpriteColor( sprite[27].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
red = colour[13].iRed
green = colour[13].iGreen
blue = colour[13].iBlue
SetSpriteColor( sprite[43].iSprNum, red, green, blue, 255)
SetSpriteColor( sprite[29].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
red = colour[1].iRed
green = colour[1].iGreen
blue = colour[1].iBlue
SetSpriteColor( sprite[42].iSprNum, red, green, blue, 255)
SetSpriteColor( sprite[46].iSprNum, red, green, blue, 255)
SetSpriteColor( sprite[44].iSprNum, red, green, blue, 255)
SetSpriteColor( sprite[41].iSprNum, red, green, blue, 255)
SetSpriteColor( sprite[57].iSprNum, red, green, blue, 255)
SetSpriteColor( sprite[56].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
red = colour[2].iRed
green = colour[2].iGreen
blue = colour[2].iBlue
SetSpriteColor( sprite[54].iSprNum, red, green, blue, 255)
SetSpriteColor( sprite[55].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
red = colour[23].iRed
green = colour[23].iGreen
blue = colour[23].iBlue
SetSpriteColor( sprite[45].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
red = colour[24].iRed
green = colour[24].iGreen
blue = colour[24].iBlue
SetSpriteColor( sprite[50].iSprNum, red, green, blue, 255)
SetSpriteColor( sprite[51].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
red = colour[23].iRed
green = colour[23].iGreen
blue = colour[23].iBlue
SetSpriteColor( sprite[45].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
red = colour[8].iRed
green = colour[8].iGreen
blue = colour[8].iBlue
SetSpriteColor( sprite[23].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
red = colour[0].iRed
green = colour[0].iGreen
blue = colour[0].iBlue
SetSpriteColor( sprite[20].iSprNum, red, green, blue, 255)
SetSpriteColor( sprite[21].iSprNum, red, green, blue, 255)
SetSpriteColor( sprite[10].iSprNum, red, green, blue, 255)
SetSpriteColor( sprite[11].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
red = colour[18].iRed
green = colour[18].iGreen
blue = colour[18].iBlue
SetSpriteColor( sprite[17].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
red = colour[17].iRed
green = colour[17].iGreen
blue = colour[17].iBlue
SetSpriteColor( sprite[5].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[31].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[12].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[25].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[37].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[53].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
SetSpriteColor( sprite[52].iSprNum, red, green, blue, 255)
Sync()
Sleep(delay)
red = colour[colStart].iRed
green = colour[colStart].iGreen
blue = colour[colStart].iBlue
Sleep(1000)
endfunction
function instructions()
wait = 1
helpImage = LoadImage("/media/panel/help.png")
helpSprite = CreateSprite(helpImage)
SetSpritePosition(helpSprite, scrWidth, 0)
help0$=" INSTRUCTIONS"
help1$=" UP arrow - Turns the page up or"
help2$=" DOWN down for another picture"
help3$="WIPE CLEAN - Clears the picture"
help4$=" ? / HELP - Instructions"
help5$=" EXIT DOOR - End the game"
help6$=" TAP THE SCREEN TO COLOUR"
CreateText(1,help0$)
CreateText(2,help1$)
CreateText(3,help2$)
CreateText(4,help3$)
CreateText(5,help4$)
CreateText(6,help5$)
CreateText(7,help6$)
CreateText(8,help0$)
CreateText(9,help1$)
CreateText(10,help2$)
CreateText(11,help3$)
CreateText(12,help4$)
CreateText(13,help5$)
CreateText(14,help6$)
for i = 1 to 14
SetTextSize(i,46)
if i >=1 and i <=7
SetTextColor( i, 0, 0, 50, 255 )
elseif i >=8 and i <=14
SetTextColor( i, 255, 255, 0, 255 )
endif
next i
SetTextPosition(1,193 + scrWidth,38)
SetTextPosition(2,193 + scrWidth,148)
SetTextPosition(3,193 + scrWidth,198)
SetTextPosition(4,193 + scrWidth,298)
SetTextPosition(5,193 + scrWidth,448)
SetTextPosition(6,193 + scrWidth,598)
SetTextPosition(7,193 + scrWidth,723)
SetTextPosition(8,190 + scrWidth,35)
SetTextPosition(9,190 + scrWidth,145)
SetTextPosition(10,190 + scrWidth,195)
SetTextPosition(11,190 + scrWidth,295)
SetTextPosition(12,190 + scrWidth,445)
SetTextPosition(13,190 + scrWidth,595)
SetTextPosition(14,190 + scrWidth,720)
for i = 1 to 14
CreateTweenText( i, 2.0 )
if i >=1 and i <=7
SetTweenTextX( i, 193 + scrWidth, 193, TweenBounce())
elseif i >=8 and i <=14
SetTweenTextX( i, 190 + scrWidth, 190, TweenBounce())
endif
PlayTweenText(i, i, .1)
next i
CreateTweenSprite(15, 2.0)
SetTweenSpriteX(15, scrWidth, 0, TweenBounce())
PlayTweenSprite(15, helpSprite, .1)
while GetTweenSpritePlaying(15, helpSprite)
UpdateAllTweens( GetFrameTime() )
Sync()
endwhile
while wait = 1
if GetPointerPressed()=1
wait = 0
endif
Sync()
endwhile
PlaySound(click)
for i = 1 to 14
CreateTweenText( i, 2.0 )
if i >=1 and i <=7
SetTweenTextX( i, 193, 193 + scrWidth, TweenSmooth2())
elseif i >=8 and i <=14
SetTweenTextX( i, 190, 190 + scrWidth, TweenSmooth2())
endif
PlayTweenText(i, i, .1)
next i
SetTweenSpriteX(15, 0, scrWidth, TweenSmooth2())
PlayTweenSprite(15, helpSprite, .1)
while GetTweenSpritePlaying(15, helpSprite)
UpdateAllTweens( GetFrameTime() )
Sync()
endwhile
for i = 1 to 15
DeleteTween( i )
next i
DeleteAllText()
DeleteSprite(helpSprite)
DeleteImage(helpImage)
endfunction
function EndGame()
DeleteSound(click)
DeleteSound(splat)
DeleteSound(pop)
DeleteSound(boing)
DeleteSound(wip)
DeleteAllSprites()
DeleteAllImages()
DeleteMemblock( memBlockMap )
DeleteAllText()
DeleteAllObjects()
GameOver = 0
endfunction
// ********** END OF FUNCTIONS **********
Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles