'================
'WRITTEN IN STONE v1.1 by Dav for QB64-GL v1.4
'================
'A Word puzzle game by Dav (My 1st ever game in QB64)
'First version coded FEB 1st-13th, 2013 for QB64-SDL.
'Updated code MAR 31st, 2020 to work in QB64-GL v1.4.
'There are 50 well know quotes, all scrambled up.
'Using mouse, unscramble the letters to make quote.
'You can only swap letters in the same column.
'======================================================
'NOTE: THIS PROGRAM REQUIRES THE "winstone-data"folder
' AND ALL OF ITS DATA FILES!
'======================================================
DECLARE SUB ButtonShow
(ButtonType%
, ButtonFile$
, x
, y
) DECLARE SUB ScreenCurtain
(way$
, left&
, right&
, speed!
) DECLARE SUB ScreenShake
(image&
, val1
, val2
, speed!
)
'=== Shared data SUBs/FUNCs use...
DIM SHARED quote
, maxquote
, row1$
, row2$
, row3$
DIM SHARED selected
, selectedcol%
, selectedrow%
, col%
, row%
, sel$
, sel2$
DIM SHARED source$
, config$
, unsolved
, music&
, musicflag
, sfxflag
, timerflag
source$ = "winstone-data\" '<<<<<<---- Location of Data files! <<<<<<<
'Set screen, fullscreen
'Give it a title....
'==================================================================================
' LOAD WINSTONE.DAT CONFIG FILE - HOLDS SOUND SETTINGS AND QUOTE INFO
'==================================================================================
'The config file is simple. It's 53 bytes, holding settings for 50 quotes and
'3 for game settings, music, sfx, timer. CHR$(1) for TRUE, CHR$(0) for false.
'Byte #1 of CHR$(0) means quote #1 isn't solved. CHR$(1) means it is, and so on...
'== these are failsafes in case on config problem
musicflag = 1
sfxflag = 1
timerflag = 1
'== max # of quotes (don't change this...)
maxquote = 50
unsolved = 0 'How many quotes are solved
'=== IF NO CONFIG FILE, MAKE ONE
'=== file not there so make a new dat file
'=== mark all quotes unsolved
config$ = ""
config$ = config$ + v$ 'all unsolved for now
unsolved = unsolved + 1
PUT #1, 51, V2$: config$
= config$
+ CHR$(1) PUT #1, 52, V2$: config$
= config$
+ CHR$(1) PUT #1, 53, V2$: config$
= config$
+ CHR$(1)
'=== see if file is large enough to read settings
'=== if not then make a new file
'=== file must be currupt, so close file, kill it, make new one.
config$ = ""
config$ = config$ + v$ 'all unsolved for now
unsolved = unsolved + 1
'=== add music, sfx & timer settings (all 1 by default)
PUT #1, 51, V2$: config$
= config$
+ CHR$(1) PUT #1, 52, V2$: config$
= config$
+ CHR$(1) PUT #1, 53, V2$: config$
= config$
+ CHR$(1)
'==== file must be there and large enough so load data.
config$ = ""
config$ = config$ + a$
'=== get game settings now
musicflag
= 0: config$
= config$
+ CHR$(0) musicflag
= 1: config$
= config$
+ CHR$(1) sfxflag
= 0: config$
= config$
+ CHR$(0) sfxflag
= 1: config$
= config$
+ CHR$(1) timerflag
= 0: config$
= config$
+ CHR$(1) timerflag
= 1: config$
= config$
+ CHR$(1) '<<, TIMER ALWAYS 1 for now
loadedconfig:
'=== CHEATER COMMAND LINE OPTION. MARKS ALL SOLVED
unsolved = 0
'===================================================================================================
'
'===================================================================================================
'==== Go ahead and Start music if musicflag on
music&
= _SNDOPEN(source$
+ "sfx\sfx_music.ogg", "VOL,SYNC,LEN,PAUSE")
'===================================================================================================
' OPEN SHARED IMAGE FILES
'===================================================================================================
'=== load title page
back&
= _LOADIMAGE(source$
+ "img\paper-title.jpg", 32)
'===== load select menu fly in vid frames.
selectframe
(t
) = _LOADIMAGE(source$
+ "vid\sel" + a$
+ ".jpg")
'===================================================================================================
'===================================================================================================
_DELAY 1 'let screen res change play catch up if needed
'=========== drop down screen
ScrollScreenDown back&, 60
ScreenShake back&, 5, 4, 75
'=== Load images for Timer bar (3 colors)
timegrn&
= _LOADIMAGE(source$
+ "img\time_grn2.jpg", 32)timeyel&
= _LOADIMAGE(source$
+ "img\time_yel2.jpg", 32)timered&
= _LOADIMAGE(source$
+ "img\time_red2.jpg", 32)
'=========
titlemenu:
'=========
'=== Pop in Main Menu on screen
menutop&
= _LOADIMAGE(source$
+ "img\menu_top2.jpg", 32) '<< Get it,_PUTIMAGE (238, 152), menutop&
, 0 '<< Set it...
'draw bitton as normal first
ButtonShow "startbtn.jpg", 565, 335
ButtonShow "quitbtn.jpg", 565, 283
ButtonShow "help.jpg", 565, 177
ButtonShow "config.jpg", 565, 229
'=== get menu choice
'=== highlight buttons if mouse over it
ButtonShow "_startbtn.jpg", 565, 335: but1 = 1
ButtonShow "startbtn.jpg", 565, 335
but1 = 0
ButtonShow "_quitbtn.jpg", 565, 283: but2 = 1
ButtonShow "quitbtn.jpg", 565, 283
but2 = 0
ButtonShow "_help.jpg", 565, 177: but3 = 1
ButtonShow "help.jpg", 565, 177
but3 = 0
ButtonShow "_config.jpg", 565, 229: but4 = 1
ButtonShow "config.jpg", 565, 229
but4 = 0
'=== if start button clicked
ButtonClick 1, "startbtn.jpg", 565, 335
ButtonClick 1, "quitbtn.jpg", 565, 283
ButtonClick 1, "help.jpg", 565, 177
HelpScreen (back&)
ButtonClick 1, "config.jpg", 565, 229
ConfigScreen (back&)
ScrollScreenUp back&, 75
'=======================================================================================
' START GAME
'=======================================================================================
quote = 1 'just a safety...
SelectQuote
GetQuote (quote)
'========
NewBoard:
'========
'=== scroll down playing board
back&
= _LOADIMAGE(source$
+ "img\board6.jpg", 32)
ScrollScreenDown back&, 60
DrawRows
'========================================================================================
' MAIN GAME LOOP
'========================================================================================
Mainloop:
poppy = 0 'flag to not show more than one popup message in a second
rumbleon = 0 'flag for rumble happening
'=== Catch mouse
'=== break up screen in 35x35 grid
col%
= INT(mx
/ 35) - 2: row%
= INT(my
/ 35) - 2
'=== clicked quote button here...
'=== turn off rumble if it was on
ButtonClick 0, "quote.jpg", 403, 302
ScrollScreenUp 0, 60 'scroll up current screen
SelectQuote
GetQuote (quote)
'Clicked HINT button
ButtonClick 0, "hint.jpg", 580, 302
'Find first hint letter here, and select it for user.
'hint letter is first letter in row that doesn't line up with origrow
'Look in 1st row first
found = 0
FOR tt
= 1 TO LEN(row1$
) 'check row1 data H1$
= UCASE$(MID$(row1$
, tt
, 1)) 'get letter in row1 H2$
= UCASE$(MID$(OrigRow1$
, tt
, 1)) 'compare with original spot 'If row1$ part needs moved, then mark this
hintcol%
= tt: hintrow%
= 1: found
= 1:
EXIT FOR FOR tt
= 1 TO LEN(row2$
) 'check row1 data H1$
= UCASE$(MID$(row2$
, tt
, 1)) 'get letter in row1 H2$
= UCASE$(MID$(OrigRow2$
, tt
, 1)) 'compare with original spot 'If row2$ part needs moved, then mark this
hintcol%
= tt: hintrow%
= 2: found
= 1:
EXIT FOR FOR tt
= 1 TO LEN(row3$
) 'check row1 data H1$
= UCASE$(MID$(row3$
, tt
, 1)) 'get letter in row1 H2$
= UCASE$(MID$(OrigRow3$
, tt
, 1)) 'compare with original spot 'If row3$ part needs moved, then mark this
hintcol%
= tt: hintrow%
= 3: found
= 1:
EXIT FOR
'flash hint letter
letter&
= _LOADIMAGE(source$
+ "fnt2\_" + H1$
+ ".jpg", 32) _PUTIMAGE (70 + (hintcol%
* 35), 70 + (hintrow%
* 35)), letter&
letter&
= _LOADIMAGE(source$
+ "fnt2\" + H1$
+ ".jpg", 32) _PUTIMAGE (70 + (hintcol%
* 35), 70 + (hintrow%
* 35)), letter&
'=== clicked title menu button here...
ESCBail:
'=== turn off rumble if it was on
ButtonClick 0, "title.jpg", 759, 302
ScrollScreenUp 0, 75 'scroll up current screen
'=== reload title as back& '<<<<<<<<<<<<<< NEED TO CHANGE THIS STUPID WAY
back&
= _LOADIMAGE(source$
+ "img\paper-title.jpg", 32)
'=== load slide in sides (left right)
left&
= _LOADIMAGE(source$
+ "\img\paper-title-left.jpg") right&
= _LOADIMAGE(source$
+ "\img\paper-title-right.jpg")
ScreenCurtain "CLOSE", left&, right&, 120
'===If inbound col & row fields clicked
'=== If no letter selected yet, then...
'=== Get 1st selected letter on current row
SelectLetter
'=== must already but one selected, so...
'=== get another selected letter (only on same Col%)
'=== then do the swap in rows$, then redraw new placements.
'=== if same column (but not same row)...ok
IF col%
= selectedcol%
AND row%
<> selectedrow%
THEN '=== get 2nd selected letter
'=== only select if not a space or empty place
'=== load 2st selected letter (highlighted one)
letter&
= _LOADIMAGE(source$
+ "fnt2\_" + sel2$
+ ".jpg", 32) _PUTIMAGE (70 + (col%
* 35), 70 + (row%
* 35)), letter&
'=== SWAP LETTER DISPLAY HERE
'load 2nd letter normal
letter&
= _LOADIMAGE(source$
+ "fnt2\" + sel2$
+ ".jpg", 32) _PUTIMAGE (70 + (col%
* 35), 70 + (row%
* 35)), letter&
'load first letter normal
letter&
= _LOADIMAGE(source$
+ "fnt2\" + sel$
+ ".jpg", 32) _PUTIMAGE (70 + (col%
* 35), 70 + (selectedrow%
* 35)), letter&
'load 2nd letter highlighted
letter&
= _LOADIMAGE(source$
+ "fnt2\_" + sel2$
+ ".jpg", 32) _PUTIMAGE (70 + (col%
* 35), 70 + (row%
* 35)), letter&
'load first letter highlighted
letter&
= _LOADIMAGE(source$
+ "fnt2\_" + sel$
+ ".jpg", 32) _PUTIMAGE (70 + (col%
* 35), 70 + (selectedrow%
* 35)), letter&
'_DELAY .02
'=== SWAP LETTERS INTERNALLY HERE
'replace current row letter with 1st sel$ letter
'replace 1st select row with curr row letter
'=== DONE! Redraw rows'''
selected = 0
DrawRows
'=== must be a new column, so
'=== un select letters, select this new one...
DrawRows '=== fresh look
SelectLetter
'==== If rows match original, YOU GOT IT!!!!
IF row1$
= OrigRow1$
AND row2$
= OrigRow2$
AND row3$
= OrigRow3$
THEN
'=== turn off rumble if it was on
'=== Popup a good message
pop&
= _LOADIMAGE(source$
+ "img\pop-z-" + rndpop$
+ ".jpg", 32)
'==== flash letters here...
FlashRows
'=== Mark quote # as solved in config$ data
unsolved = unsolved - 1 'decrease one from unsolved count
ScrollScreenUp 0, 60
'=== IF ALL QUOTES SOLVED - WIN - SHOW CREDITS!!!
Credits
back&
= _LOADIMAGE(source$
+ "img\paper-title.jpg", 32)
'=== if already solved next quote, go to select quote
quote = quote + 1
'=== if at last quote, then go to select menu
SelectQuote
'==== next quote , scroll down board again..
back&
= _LOADIMAGE(source$
+ "img\board6.jpg", 32) ScrollScreenDown back&, 60
GetQuote quote
DrawRows
'=== update timer stuff here...
'New way to draw timer because hint delay made it skip a draw sometimes
'============ GET A POPUP here ==========================
'========================================================
'=== open pop....
pop&
= _LOADIMAGE(source$
+ "img\pop-a-" + rndpop$
+ ".jpg", 32) poppy = L '<<<<<<<< poppy
pop&
= _LOADIMAGE(source$
+ "img\pop-b-" + rndpop$
+ ".jpg", 32) poppy = L '<<<<<<<< poppy
pop&
= _LOADIMAGE(source$
+ "img\pop-c-" + rndpop$
+ ".jpg", 32) poppy = L '<<<<<<<< poppy
pop&
= _LOADIMAGE(source$
+ "img\pop-d-" + rndpop$
+ ".jpg", 32) poppy = L '<<<<<<<< poppy
'==== yellow....
pop&
= _LOADIMAGE(source$
+ "img\pop-e-" + rndpop$
+ ".jpg", 32) poppy = L '<<<<<<<< poppy
pop&
= _LOADIMAGE(source$
+ "img\pop-f-" + rndpop$
+ ".jpg", 32) poppy = L '<<<<<<<< poppy
'=== red.....
pop&
= _LOADIMAGE(source$
+ "img\pop-g-" + rndpop$
+ ".jpg", 32) poppy = L '<<<<<<<< poppy
pop&
= _LOADIMAGE(source$
+ "img\pop-h-" + rndpop$
+ ".jpg", 32) poppy = L '<<<<<<<< poppy
'=== Start rumble is time near end (dooom coming...)
IF L
> 54 AND rumbleon
= 0 THEN '<<<< was 114 rumble&
= _SNDOPEN(source$
+ "sfx\sfx_rumble2.ogg", "VOL,SYNC,LEN,PAUSE") rumbleon = 1 'tag as rumble is playing
'start shaking screen if > 56 or maybe if rumble on
'=== grab current background, shake it
'curr& = _SCREENIMAGE
'========================================================
IF L
= 60 THEN '<<<< 60 seconds and timer is up
'=========== Play drop down sound
'=== drop down screen
timesup&
= _LOADIMAGE(source$
+ "img\paper-timeup.jpg", 32) ScrollScreenDown timesup&, 75
'=== shake (BOOM)
ScreenShake timesup&, 5, 4, 60
StoneRoll "RIGHT", 0, 25
'=== do retry quote here, or main menu....
SelectQuote
GetQuote quote
'Place board back
back&
= _LOADIMAGE(source$
+ "img\board6.jpg", 32) ScrollScreenDown back&, 60
DrawRows
Quit:
'=================================================================
' CLOSE ALL OPENED IMAGE & SOUND FILES, SAVE CONFIG DATA
'=================================================================
'free all select frame video image handles first...
roll&
= _SNDOPEN(source$
+ "sfx\sfx_crumble.ogg", "VOL,SYNC,LEN,PAUSE")
'Shake the screen a little
'=== shake (BOOM)
ScreenShake back&, 6, 4, 60
ScrollScreenUp back&, 60
'===== Save config data
'=========================
'=================================================================================================================
' * * * * * * * * * * * SUBS/FUNCTIONS & OTHER NOTES * * * * * * * * * * * *
'=================================================================================================================
'=================================================================================================================
'== Draws the row1$, row2$, row3$ data to screen.
'===draw row1
'IF L$ = " " THEN L$ = "space"
letter&
= _LOADIMAGE(source$
+ "fnt2\" + L$
+ ".jpg", 32)
'===draw row2
'IF L$ = " " THEN L$ = "space"
letter&
= _LOADIMAGE(source$
+ "fnt2\" + L$
+ ".jpg", 32)
'===draw row3
'IF L$ = " " THEN L$ = "space"
letter&
= _LOADIMAGE(source$
+ "fnt2\" + L$
+ ".jpg", 32)
'=================================================================================================================
'=== Animate quote rows for a sec to show solved.
'===draw row1 highlighted
'IF L$ = " " THEN L$ = "space"
letter&
= _LOADIMAGE(source$
+ "fnt2\_" + L$
+ ".jpg", 32)
'===draw row2
'IF L$ = " " THEN L$ = "space"
letter&
= _LOADIMAGE(source$
+ "fnt2\_" + L$
+ ".jpg", 32)
'===draw row3
'IF L$ = " " THEN L$ = "space"
letter&
= _LOADIMAGE(source$
+ "fnt2\_" + L$
+ ".jpg", 32)
DrawRows 'Show them normal
'=================================================================================================================
'gets a selected letter, only if no space...
'=== dont select if a space or empty place
selected = 0
'=== load 1st selected letter (highlighted one)
letter&
= _LOADIMAGE(source$
+ "fnt2\_" + sel$
+ ".jpg", 32) _PUTIMAGE (70 + (col%
* 35), 70 + (row%
* 35)), letter&
selected = 1: selectedrow% = row%: selectedcol% = col%
'=== select sound
'=== time for mouse button to get up
'=================================================================================================================
SUB HelpScreen
(imagehandle&
)
pic&
= _LOADIMAGE(source$
+ "\img\helpscreen.jpg")
StoneRoll "RIGHT", pic&, 25
'=== Catch mouse
ButtonShow "_back.jpg", 417, 687
ButtonShow "back.jpg", 417, 687
'=== if back button
ButtonClick 1, "back.jpg", 417, 687
StoneRoll "LEFT", imagehandle&, 25
'=================================================================================================================
SUB ConfigScreen
(imagehandle&
)
pic&
= _LOADIMAGE(source$
+ "\img\configscreen2.jpg")
'=== Mark setting on screen here.
LINE (451, 252)-(476, 275), _RGB32(0, 255, 0), BF
'ON = green LINE (585, 252)-(610, 275), _RGB32(0, 255, 0), BF
'OFF = green
LINE (451, 309)-(476, 332), _RGB32(0, 255, 0), BF
'ON = green LINE (587, 309)-(612, 332), _RGB32(0, 255, 0), BF
'OFF = green
LINE (451, 369)-(477, 393), _RGB32(0, 255, 0), BF
'ON = green LINE (588, 370)-(614, 394), _RGB32(0, 255, 0), BF
'OFF = green
StoneRoll "RIGHT", pic&, 25
ConfigTop:
'=== Catch mouse
ButtonShow "_back.jpg", 417, 687
ButtonShow "back.jpg", 417, 687
'=== if back button
ButtonClick 1, "back.jpg", 417, 687
'Music ON click
musicflag = 1
MID$(config$
, 51, 1) = CHR$(1) 'MARK CONFIG SPOT AS MUSIC ON
LINE (451, 252)-(476, 275), _RGB32(0, 255, 0), BF
'ON = green LINE (585, 252)-(610, 275), _RGB32(255, 255, 255), BF
'OFF = white 'Music OFF clicked
musicflag = 0
MID$(config$
, 51, 1) = CHR$(0) 'MARK CONFIG SPOT AS MUSIC OFF
LINE (451, 252)-(476, 275), _RGB32(255, 255, 255), BF
'ON LINE (585, 252)-(610, 275), _RGB32(0, 255, 0), BF
'OFF 'SFX ON clicked
sfxflag = 1
MID$(config$
, 52, 1) = CHR$(1) 'MARK CONFIG SPOT AS SFX ON
LINE (451, 309)-(476, 332), _RGB32(0, 255, 0), BF
'ON LINE (587, 309)-(612, 332), _RGB32(255, 255, 255), BF
'SFX OFF clicked
sfxflag = 0
MID$(config$
, 52, 1) = CHR$(0) 'MARK CONFIG SPOT AS SFX OFF
LINE (451, 309)-(476, 332), _RGB32(255, 255, 255), BF
'ON 'TIMER OFF CLICKED
timerflag = 1
MID$(config$
, 53, 1) = CHR$(1) 'MARK CONFIG SPOT AS TIMER ON
timerwimp&
= _LOADIMAGE(source$
+ "img\timernotice.jpg")
'=== wait for Reply...
'hover button
ButtonShow "_wimp.jpg", 286, 466
ButtonClick 1, "wimp.jpg", 286, 466
ButtonShow "wimp.jpg", 286, 466
'==== RESET GAME CLICKED
ButtonClick 0, "reset.jpg", 369, 585
timerwimp&
= _LOADIMAGE(source$
+ "img\resetnotice.jpg")
'=== Get YES or NO
'YES button poll
ButtonShow "_yes.jpg", 318, 395
ButtonClick 1, "yes.jpg", 318, 395
'=== RESET CONFIG DATA HERE (ONLY QUOTE STUFF)
unsolved = 50
ButtonShow "yes.jpg", 318, 395
'NO BUTTON poll
ButtonShow "_no.jpg", 516, 395
ButtonClick 1, "no.jpg", 516, 395
ButtonShow "no.jpg", 516, 395
StoneRoll "LEFT", imagehandle&, 25
'=================================================================================================================
'=== Brings up Select Quote Menu
selectmenu&
= _LOADIMAGE(source$
+ "img\select.jpg", 32) solvedimg&
= _LOADIMAGE(source$
+ "img\solved.jpg", 32)
'=== Play Select menu fly in vid
'========================
'=======================
_FREEIMAGE selectmenu&
'no need it because we're going to change it so much, just grab background now
'=== If quotes have been solved, put solved tag image ..
'===load select menu message based on solved #
selectmsg&
= _LOADIMAGE(source$
+ "img\select-champ.jpg", 32) selectmsg&
= _LOADIMAGE(source$
+ "img\select-msg.jpg", 32)
'NOW grab screen again as select menu
'=== Grab background
'=== get menu choice
'=== Catch mouse
'== 1
SelectNumber
"1", 209, 173, selectmenu&:
EXIT DO '== 2
SelectNumber
"2", 284, 173, selectmenu&:
EXIT DO '== 3
SelectNumber
"3", 359, 173, selectmenu&:
EXIT DO '== 4
SelectNumber
"4", 434, 173, selectmenu&:
EXIT DO '== 5
SelectNumber
"5", 509, 173, selectmenu&:
EXIT DO '== 6
SelectNumber
"6", 584, 173, selectmenu&:
EXIT DO '== 7
SelectNumber
"7", 659, 173, selectmenu&:
EXIT DO '== 8
SelectNumber
"8", 734, 173, selectmenu&:
EXIT DO '== 9
SelectNumber
"9", 209, 235, selectmenu&:
EXIT DO '== 10
SelectNumber
"10", 284, 235, selectmenu&:
EXIT DO '== 11
SelectNumber
"11", 359, 235, selectmenu&:
EXIT DO '== 12
SelectNumber
"12", 434, 235, selectmenu&:
EXIT DO '== 13
SelectNumber
"13", 509, 235, selectmenu&:
EXIT DO '=== 14
SelectNumber
"14", 584, 235, selectmenu&:
EXIT DO '=== 15
SelectNumber
"15", 659, 235, selectmenu&:
EXIT DO '=== 16
SelectNumber
"16", 734, 235, selectmenu&:
EXIT DO '=== 17
SelectNumber
"17", 209, 297, selectmenu&:
EXIT DO '=== 18
SelectNumber
"18", 284, 297, selectmenu&:
EXIT DO '=== 19
SelectNumber
"19", 359, 297, selectmenu&:
EXIT DO '=== 20
SelectNumber
"20", 434, 297, selectmenu&:
EXIT DO '=== 21
SelectNumber
"21", 509, 297, selectmenu&:
EXIT DO '=== 22
SelectNumber
"22", 584, 297, selectmenu&:
EXIT DO '=== 23
SelectNumber
"23", 659, 297, selectmenu&:
EXIT DO '=== 24
SelectNumber
"24", 734, 297, selectmenu&:
EXIT DO '=== 25
SelectNumber
"25", 209, 359, selectmenu&:
EXIT DO '=== 26
SelectNumber
"26", 284, 359, selectmenu&:
EXIT DO '=== 27
SelectNumber
"27", 359, 359, selectmenu&:
EXIT DO '=== 28
SelectNumber
"28", 434, 359, selectmenu&:
EXIT DO '=== 29
SelectNumber
"29", 509, 359, selectmenu&:
EXIT DO '=== 30
SelectNumber
"30", 584, 359, selectmenu&:
EXIT DO '=== 31
SelectNumber
"31", 659, 359, selectmenu&:
EXIT DO '=== 32
SelectNumber
"32", 734, 359, selectmenu&:
EXIT DO '=== 33
SelectNumber
"33", 209, 421, selectmenu&:
EXIT DO '=== 34
SelectNumber
"34", 284, 421, selectmenu&:
EXIT DO '=== 35
SelectNumber
"35", 359, 421, selectmenu&:
EXIT DO '=== 36
SelectNumber
"36", 434, 421, selectmenu&:
EXIT DO '=== 37
SelectNumber
"37", 509, 421, selectmenu&:
EXIT DO '=== 38
SelectNumber
"38", 584, 421, selectmenu&:
EXIT DO '=== 39
SelectNumber
"39", 659, 421, selectmenu&:
EXIT DO '=== 40
SelectNumber
"40", 734, 421, selectmenu&:
EXIT DO '=== 41
SelectNumber
"41", 209, 483, selectmenu&:
EXIT DO '=== 42
SelectNumber
"42", 284, 483, selectmenu&:
EXIT DO '=== 43
SelectNumber
"43", 359, 483, selectmenu&:
EXIT DO '=== 44
SelectNumber
"44", 434, 483, selectmenu&:
EXIT DO '=== 45
SelectNumber
"45", 509, 483, selectmenu&:
EXIT DO '=== 46
SelectNumber
"46", 584, 483, selectmenu&:
EXIT DO '=== 47
SelectNumber
"47", 659, 483, selectmenu&:
EXIT DO '=== 48
SelectNumber
"48", 734, 483, selectmenu&:
EXIT DO '=== 49
SelectNumber
"49", 209, 545, selectmenu&:
EXIT DO '=== 50
SelectNumber
"50", 284, 545, selectmenu&:
EXIT DO
'=== Play select menu again, flying out.
'========================
'=======================
SUB SelectNumber
(number$
, x
, y
, image&
) btn&
= _LOADIMAGE(source$
+ "num\" + number$
+ ".jpg", 32)
'================================================================================================================
'=== Gets new quote to solve based on quote value,
'=== Sets the Row data...
'' QUOTES MUST NOT BE LONGER THAN 23 LETTERS ON ONE ROW
'' AND ALL ROWS SHOULD BE SAME LENGTH (PAD WITH SPACES)
OrigRow1$ = "GREAT MINDS ": row1$ = OrigRow1$
OrigRow2$ = "THINK ALIKE ": row2$ = OrigRow2$
OrigRow3$ = " ": row3$ = OrigRow3$
OrigRow1$ = "TO ERR IS HUMAN ": row1$ = OrigRow1$
OrigRow2$ = "TO FORGIVE DEVINE": row2$ = OrigRow2$
OrigRow3$ = " ": row3$ = OrigRow3$
OrigRow1$ = "IT AINT OVER TILL ": row1$ = OrigRow1$
OrigRow2$ = "THE FAT LADY SINGS ": row2$ = OrigRow2$
OrigRow3$ = " ": row3$ = OrigRow3$
OrigRow1$ = "A ROLLING STONE ": row1$ = OrigRow1$
OrigRow2$ = "GATHERS NO MOSS ": row2$ = OrigRow2$
OrigRow3$ = " ": row3$ = OrigRow3$
OrigRow1$ = "LAUGHTER IS THE ": row1$ = OrigRow1$
OrigRow2$ = "BEST MEDICINE ": row2$ = OrigRow2$
OrigRow3$ = " ": row3$ = OrigRow3$
OrigRow1$ = "ABSENCE MAKES THE ": row1$ = OrigRow1$
OrigRow2$ = "HEART GROW FONDER ": row2$ = OrigRow2$
OrigRow3$ = " ": row3$ = OrigRow3$
OrigRow1$ = "YOU CANT HAVE YOUR ": row1$ = OrigRow1$
OrigRow2$ = "CAKE AND EAT IT TOO": row2$ = OrigRow2$
OrigRow3$ = " ": row3$ = OrigRow3$
OrigRow1$ = "IF AT FIRST YOU DONT ": row1$ = OrigRow1$
OrigRow2$ = "SUCCEED TRY TRY AGAIN": row2$ = OrigRow2$
OrigRow3$ = " ": row3$ = OrigRow3$
OrigRow1$ = "NECESSITY IS ": row1$ = OrigRow1$
OrigRow2$ = "THE MOTHER OF ": row2$ = OrigRow2$
OrigRow3$ = "INVENTION ": row3$ = OrigRow3$
OrigRow1$ = "CLEANLINESS ": row1$ = OrigRow1$
OrigRow2$ = "IS NEXT TO ": row2$ = OrigRow2$
OrigRow3$ = "GODLINESS": row3$ = OrigRow3$
OrigRow1$ = "THE BIGGER THEY ": row1$ = OrigRow1$
OrigRow2$ = "ARE THE HARDER ": row2$ = OrigRow2$
OrigRow3$ = "THEY FALL ": row3$ = OrigRow3$
OrigRow1$ = "ACTIONS SPEAK ": row1$ = OrigRow1$
OrigRow2$ = "LOUDER THAN ": row2$ = OrigRow2$
OrigRow3$ = "WORDS ": row3$ = OrigRow3$
OrigRow1$ = "A CHAIN IS ONLY ": row1$ = OrigRow1$
OrigRow2$ = "AS STRONG AS ITS ": row2$ = OrigRow2$
OrigRow3$ = "WEAKEST LINK ": row3$ = OrigRow3$
OrigRow1$ = "BIRDS OF A ": row1$ = OrigRow1$
OrigRow2$ = "FEATHER FLOCK ": row2$ = OrigRow2$
OrigRow3$ = "TOGETHER ": row3$ = OrigRow3$
OrigRow1$ = "WHEN THE CATS ": row1$ = OrigRow1$
OrigRow2$ = "AWAY THE MICE ": row2$ = OrigRow2$
OrigRow3$ = "WILL PLAY ": row3$ = OrigRow3$
OrigRow1$ = "A FOOL AND HIS ": row1$ = OrigRow1$
OrigRow2$ = "MONEY ARE SOON ": row2$ = OrigRow2$
OrigRow3$ = "PARTED ": row3$ = OrigRow3$
OrigRow1$ = "NONE SO BLIND ": row1$ = OrigRow1$
OrigRow2$ = "AS THOSE WHO ": row2$ = OrigRow2$
OrigRow3$ = "WILL NOT SEE ": row3$ = OrigRow3$
OrigRow1$ = "YOU CANT JUDGE ": row1$ = OrigRow1$
OrigRow2$ = "A BOOK BY ITS ": row2$ = OrigRow2$
OrigRow3$ = "COVER ": row3$ = OrigRow3$
OrigRow1$ = "DONT PUT ALL ": row1$ = OrigRow1$
OrigRow2$ = "YOUR EGGS IN ": row2$ = OrigRow2$
OrigRow3$ = "ONE BASKET ": row3$ = OrigRow3$
OrigRow1$ = "FOOLS RUSH IN ": row1$ = OrigRow1$
OrigRow2$ = "WHERE ANGELS ": row2$ = OrigRow2$
OrigRow3$ = "FEAR TO TREAD ": row3$ = OrigRow3$
OrigRow1$ = "ALL WORK AND NO ": row1$ = OrigRow1$
OrigRow2$ = "PLAY MAKES JACK ": row2$ = OrigRow2$
OrigRow3$ = "A DULL BOY ": row3$ = OrigRow3$
OrigRow1$ = "OLD SOLDIERS NEVER ": row1$ = OrigRow1$
OrigRow2$ = "DIE THEY SIMPLY ": row2$ = OrigRow2$
OrigRow3$ = "FADE AWAY ": row3$ = OrigRow3$
OrigRow1$ = "DONT COUNT YOUR ": row1$ = OrigRow1$
OrigRow2$ = "CHICKENS BEFORE ": row2$ = OrigRow2$
OrigRow3$ = "THEY ARE HATCHED": row3$ = OrigRow3$
OrigRow1$ = "LIGHTNING NEVER ": row1$ = OrigRow1$
OrigRow2$ = "STRIKES TWICE IN ": row2$ = OrigRow2$
OrigRow3$ = "THE SAME PLACE ": row3$ = OrigRow3$
OrigRow1$ = "AN OUNCE OF PREVENTION": row1$ = OrigRow1$
OrigRow2$ = "IS WORTH A POUND OF": row2$ = OrigRow2$
OrigRow3$ = " CURE ": row3$ = OrigRow3$
OrigRow1$ = "DONT CROSS YOUR ": row1$ = OrigRow1$
OrigRow2$ = "BRIDGES BEFORE ": row2$ = OrigRow2$
OrigRow3$ = "YOU COME TO THEM": row3$ = OrigRow3$
OrigRow1$ = "IT WAS THE LAST ": row1$ = OrigRow1$
OrigRow2$ = "STRAW THAT BROKE ": row2$ = OrigRow2$
OrigRow3$ = "THE CAMELS BACk": row3$ = OrigRow3$
OrigRow1$ = "YOU CAN CATCH MORE ": row1$ = OrigRow1$
OrigRow2$ = "FLIES WITH HONEY ": row2$ = OrigRow2$
OrigRow3$ = "THAN WITH VINEGAR ": row3$ = OrigRow3$
OrigRow1$ = "NEVER PUT OFF UNTIL": row1$ = OrigRow1$
OrigRow2$ = "TOMORROW WHAT YOU ": row2$ = OrigRow2$
OrigRow3$ = "CAN DO TODAY ": row3$ = OrigRow3$
OrigRow1$ = "IF YOU LIE DOWN ": row1$ = OrigRow1$
OrigRow2$ = "WITH DOGS YOU WILL": row2$ = OrigRow2$
OrigRow3$ = "GET UP WITH FLEAS ": row3$ = OrigRow3$
OrigRow1$ = "THOSE WHO LIVE IN ": row1$ = OrigRow1$
OrigRow2$ = "GLASS HOUSES SHOULD": row2$ = OrigRow2$
OrigRow3$ = "NOT THROW STONES ": row3$ = OrigRow3$
OrigRow1$ = " NECESSITY IS A HARD": row1$ = OrigRow1$
OrigRow2$ = "NURSE BUT SHE RAISES": row2$ = OrigRow2$
OrigRow3$ = "STRONG CHILDREN ": row3$ = OrigRow3$
OrigRow1$ = "IT IS BETTER TO BE ": row1$ = OrigRow1$
OrigRow2$ = "GREEN AND GROWING ": row2$ = OrigRow2$
OrigRow3$ = "THAN RIPE AND ROTTEN": row3$ = OrigRow3$
OrigRow1$ = "HE WHO FIGHTS AND ": row1$ = OrigRow1$
OrigRow2$ = "RUNS AWAY MAY LIVE ": row2$ = OrigRow2$
OrigRow3$ = "TO FIGHT ANOTHER DAY": row3$ = OrigRow3$
OrigRow1$ = "YOU CAN LEAD A HORSE": row1$ = OrigRow1$
OrigRow2$ = "TO WATER BUT YOU ": row2$ = OrigRow2$
OrigRow3$ = "CANT MAKE HIM DRINK ": row3$ = OrigRow3$
OrigRow1$ = "THE GRASS IS ALWAYS": row1$ = OrigRow1$
OrigRow2$ = "GREENER ON THE OTHER": row2$ = OrigRow2$
OrigRow3$ = "SIDE OF THE FENCE ": row3$ = OrigRow3$
OrigRow1$ = "THOSE WHO DO NOT ": row1$ = OrigRow1$
OrigRow2$ = "LEARN FROM HISTORY ARE": row2$ = OrigRow2$
OrigRow3$ = "DOOMED TO REPEAT IT ": row3$ = OrigRow3$
OrigRow1$ = "BETTER TO HAVE LOVED ": row1$ = OrigRow1$
OrigRow2$ = "AND LOST THAN NEVER ": row2$ = OrigRow2$
OrigRow3$ = "TO HAVE LOVED AT ALL ": row3$ = OrigRow3$
OrigRow1$ = "LAUGH AND THE WORLD ": row1$ = OrigRow1$
OrigRow2$ = " LAUGHS WITH YOU WEEP ": row2$ = OrigRow2$
OrigRow3$ = " AND YOU WEEP ALONE ": row3$ = OrigRow3$
OrigRow1$ = "OH WHAT A TANGLED WEB ": row1$ = OrigRow1$
OrigRow2$ = "WE WEAVE WHEN FIRST WE ": row2$ = OrigRow2$
OrigRow3$ = "PRACTICE TO DECEIVE ": row3$ = OrigRow3$
OrigRow1$ = "IF YOU DONT KNOW WHERE ": row1$ = OrigRow1$
OrigRow2$ = "YOURE GOING THEN THE ": row2$ = OrigRow2$
OrigRow3$ = "JOURNEYS NEVER ENDING ": row3$ = OrigRow3$
OrigRow1$ = "ANSWER TO THE ULTIMATE ": row1$ = OrigRow1$
OrigRow2$ = "QUESTION OF LIFE THE ": row2$ = OrigRow2$
OrigRow3$ = "UNIVERSE AND EVERYTHING": row3$ = OrigRow3$
OrigRow1$ = "FOOL ME ONCE SHAME ON ": row1$ = OrigRow1$
OrigRow2$ = "YOU FOOL ME TWICE ": row2$ = OrigRow2$
OrigRow3$ = " SHAME ON ME ": row3$ = OrigRow3$
OrigRow1$ = "A BROKEN FRIENDSHIP ": row1$ = OrigRow1$
OrigRow2$ = "MAY BE SOLDERED BUT ": row2$ = OrigRow2$
OrigRow3$ = "WILL NEVER BE SOUND ": row3$ = OrigRow3$
OrigRow1$ = "IF YOU CANNOT HAVE THE": row1$ = OrigRow1$
OrigRow2$ = "BEST THEN MAKE THE ": row2$ = OrigRow2$
OrigRow3$ = "BEST OF WHAT YOU HAVE ": row3$ = OrigRow3$
OrigRow1$ = "HE WHO SAYS WHAT HE ": row1$ = OrigRow1$
OrigRow2$ = "LIKES SHALL HEAR WHAT": row2$ = OrigRow2$
OrigRow3$ = " HE DOESNT LIKE ": row3$ = OrigRow3$
OrigRow1$ = "HE THAT HAS A GREAT ": row1$ = OrigRow1$
OrigRow2$ = "NOSE THINKS EVERYBODY": row2$ = OrigRow2$
OrigRow3$ = "IS SPEAKING OF IT ": row3$ = OrigRow3$
OrigRow1$ = "HE THAT WOULD HAVE ": row1$ = OrigRow1$
OrigRow2$ = "EGGS MUST ENDURE THE ": row2$ = OrigRow2$
OrigRow3$ = "CRACKLING OF THE HENS": row3$ = OrigRow3$
OrigRow1$ = "A FRIEND IS SOMEONE": row1$ = OrigRow1$
OrigRow2$ = "KNOWS ALL ABOUT YOU ": row2$ = OrigRow2$
OrigRow3$ = " AND STILL LOVES YOU": row3$ = OrigRow3$
OrigRow1$ = "A MAN OF WORDS AND ": row1$ = OrigRow1$
OrigRow2$ = "NOT DEEDS IS LIKE A ": row2$ = OrigRow2$
OrigRow3$ = "GARDEN FULL OF WEEDS": row3$ = OrigRow3$
'failsafe...
OrigRow1$ = "TO ERR IS HUMAN ": row1$ = OrigRow1$
OrigRow2$ = "TO FORGIVE DEVINE": row2$ = OrigRow2$
OrigRow3$ = " ": row3$ = OrigRow3$
remix:
'maybe make tag to set if 1&2 were not swapped, swap 1&3, if no space.?
'=== Randomly Mix up the letters in rows
'=== mix up row 1 with 2
'=== Only swap 1 & 2 when no space present
'=== mix up row 2 with 3
'=== Only swap 2 &3 when no space present
'=== just in case no mixing occurred (happens once in a blue moon)..
'==================================================================================================
'===================================================================================================
'======================================================================================
' ScrollScreenDown
'======================================================================================
SUB ScrollScreenDown
(image&
, speed!
)
'=== This SUB Scrolls Down a previously opened image.
'=== image& = previously opened image handle to use.
'=== THE IMAGE MUST BE PREVIOUSLY OPENED OR AN ERROR WILL OCCUR!
'=== speed& = Value for the _LIMIT.
_PUTIMAGE , image&
, 0 'make sure it's centered
'======================================================================================
' ScrollScreenUp
'======================================================================================
SUB ScrollScreenUp
(image&
, speed!
)
'=== This SUB Scrolls the screen UP out of sight.
'=== image& = previously opened image handle to use.
'=== THE IMAGE MUST BE PREVIOUSLY OPENED OR AN ERROR WILL OCCUR!
'=== speed! = Value for the _LIMIT.
'=== NOTE: If image& value is 0, then scrolls up the current screen.
usecurrent = 0
'image& = _SCREENIMAGE
usecurrent = 1
rev = 767
LINE (0, rev
- 25)-(1023, rev
), _RGB32(0, 0, 0), BF
rev = rev - 25
'======================================================================================
' StoneRoll
'======================================================================================
SUB StoneRoll
(way$
, image&
, speed!
)
'=== The SUB rolls a stone column sequence left or right.
'=== An optional image& can be given to drag along from behind.
'=== way$: "LEFT" = Roll left. "RIGHT" = Roll right.
'=== image& = Optional Previously opened imagehandle to drag in.
'=== speed! = Value for the _LIMIT. (I think in fps)
'=== Load the stone column image sequence below....
rollframe
(t
) = _LOADIMAGE(source$
+ "vid\roll" + a$
+ ".jpg")
roll&
= _SNDOPEN(source$
+ "sfx\sfx_roll.ogg", "VOL,SYNC,LEN,PAUSE")
'=== choose what to do...
x = -135
x = x + 20
'_AUTODISPLAY
x = 1024
LINE (x
+ 135, 0)-(1023, 767), _RGB32(0, 0, 0), BF
x = x - 20
'_AUTODISPLAY
'== center screen if image given
'=== free up used image handles
'==================================================================================
SUB ScreenCurtain
(way$
, left&
, right&
, speed!
)
'=== This opened and closes the screen like a curtain.
'=== It uses two previously opened images which are just
'=== the screen split into a left & right side.
'=== way$: "OPEN" = open curtain, "CLOSE" = Close it
'=== speed! = Value for the _LIMIT
roll&
= _SNDOPEN(source$
+ "sfx\sfx_roll.ogg", "VOL,SYNC,LEN,PAUSE")
x2 = 1024
'The y is randoming shaked up
'for a dragging effect
x2 = x2 - 4
'=== make sure image is centered
'=== A little shake to show joining
ScreenShake 0, 4, 3, 60
x2 = 513
x2 = x2 + 5
'======================================================================================
' ScreenShake
'======================================================================================
SUB ScreenShake
(image&
, val1
, val2
, speed!
)
'=== This SUB shakes the current screen
'=== image& = previously image handle to use.
'=== val1 = first loop (x)
'=== val2 = second loop (y)
'=== speed! = Value for the _LIMIT
'=== NOTE: Ifimage& = 0 then uses current screen.
usecurrent = 0
usecurrent = 1
'=== center screen after shaking
'======================================================================================
'======================================================================================
left&
= _LOADIMAGE(source$
+ "img\paper-title-left.jpg") right&
= _LOADIMAGE(source$
+ "img\paper-title-right.jpg")
ScreenCurtain "CLOSE", left&, right&, 60
'=== load crumble frame numbers...
framenum
(t
) = _LOADIMAGE(source$
+ "vid\crum" + a$
+ ".jpg")
'=== start crumble sound
'=== BIG Shake
ScreenShake 0, 6, 5, 60
'CRUMLE!!!!
'IF INKEY$ <> "" THEN EXIT DO
'WASH OUT!!!!
'free all image handles...
creditmusic&
= _SNDOPEN(source$
+ "sfx\credits.ogg")
y = -768
_PUTIMAGE (0, 0), pic&
, 0, (0, y
)-(1024, y
+ 768) x1
= RND * 1024: y1
= RND * 768 LINE (x1
, y1
)-(x1
+ 12, y1
+ 1), _RGB32(115, 115, 115), BF
'across LINE (x1
+ 6, y1
- 6)-(x1
+ 7, y1
+ 6), _RGB32(115, 115, 115), BF
'down
'======================================================================================
'======================================================================================
SUB ButtonShow
(ButtonFile$
, x
, y
) btn&
= _LOADIMAGE(source$
+ "img\" + ButtonFile$
, 32) '_DISPLAY: _AUTODISPLAY
'======================================================================================
'======================================================================================
SUB ButtonClick
(ButtonType%
, ButtonFile$
, x
, y
) '=== ButtonType% is if a hover highlighted button on not.
ButtonShow
"_" + ButtonFile$
, x
, y:
_DELAY .15 ButtonShow ButtonFile$
, x
, y:
_DELAY .15 ButtonShow ButtonFile$
, x
, y:
_DELAY .15 ButtonShow
"_" + ButtonFile$
, x
, y:
_DELAY .15 ButtonShow ButtonFile$, x, y