Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Smoke and Mirrors Strategy Game
#1
In this game you play as Marie Antoinette with your mission to rescue Louis XVI.  This is a game of strategy / puzzle solving.
   

Unzip the file and extract the folder into your PEQB64 directory.  In the IDE make sure that you have the Run Option “Save EXE in source folder” checked.

.zip   Smoke And Mirrors.zip (Size: 7.27 MB / Downloads: 13)

You will need the User Manual to see how to play the game which is something of a challenge.  You would need to be a dedicated fan of problem-solving games.  The project is included here as part of the historical archiving of older QB64.net projects.

.pdf   Smoke and Mirrors User Manual.pdf (Size: 287.63 KB / Downloads: 13)

The video shows of some of the manoeuvres up to the first level and a view of some of the inventory items.



Code: (Select All)
'Smoke and Mirrors Program 2025-12-22 by Magdha ex Qwerkey
'Vous etes Marie-Antoinette. Votre mission est de sauver le roi Louis Seize.

'Images from pngimg.com
'Sound effects from freesfx.co.uk

'...
'Gunpowder, Gelatine
'Dynamite with a laser beam
'Guaranteed to blow your mind
'...
'Anytime

_TITLE "Smoke And Mirrors Graphics Puzzle Game"
$EXEICON:'.\louis.ico'

CONST False = 0, True = NOT False
CONST Roger% = 1200, John% = 755, Brian%% = 15, Freddie%% = False 'Freddie is False in released version
DIM SHARED Orient%%(1, 3), StadionDef%%(2, 16, 25), Stadion%%(2, 16, 25), MAPosVert%%, MAPosHoriz%%
DIM SHARED BeamPosVert%%, BeamPosHoriz%%, LaserDir%%, LaserSearch%%, NextInventory%%, MoreBeams%%
DIM SHARED InvSound&(10), SonsDuRoyaume&(10), Indicators&(1)
DIM FlameTime%%(10), Beam&(2, 3), Dialogue&(1, 17), Miroir&(3), BeamGrid%%(15, 24), SaveGame&(10)
DIM Inventory&(2, 10), Obstacle&(1), Bullet&(29), Bang&(1, 29), Usain&(3), Actions&(2)
Orient%%(0, 0) = 0: Orient%%(0, 1) = -1: Orient%%(0, 2) = 0: Orient%%(0, 3) = 1
Orient%%(1, 0) = -1: Orient%%(1, 1) = 0: Orient%%(1, 2) = 1: Orient%%(1, 3) = 0
RANDOMIZE (TIMER)

OPEN "smokesdat.dat" FOR INPUT AS #1
INPUT #1, MoveSounds%%
INPUT #1, LazyBeam%%
CLOSE #1

'Initial Data
'FirePeriod
DATA 4,3,2,2,4,6,5,7,4,5,6
FOR N%% = 0 TO 10
    READ FlameTime%%(N%%)
NEXT N%%
'Inventory
DATA 3,23
DATA 10,23
DATA 1,3
DATA 1,11
DATA 2,6
DATA 12,13
DATA 15,1
DATA 10,13
DATA 9,10
DATA 8,20
FOR N%% = 1 TO 10
    READ Vert%%, Horiz%%
    StadionDef%%(0, Vert%%, Horiz%%) = N%%
NEXT N%%
'Load Inventory Sounds and Images & Make Hardware Images
FOR N%% = 1 TO 10
    IF Freddie%% THEN InvSound&(N%%) = _SNDOPEN("kq" + LTRIM$(STR$(N%%)) + ".wav", "sync,vol")
    Temp1& = _LOADIMAGE("kq" + LTRIM$(STR$(N%%)) + ".png", 32)
    Temp& = _NEWIMAGE(74, 69, 32)
    _DEST Temp&
    _PUTIMAGE (0, 0)-(73, 68), Temp1&
    Inventory&(1, N%%) = HardwareImage&(Temp&)
    Temp1& = _LOADIMAGE("kq" + LTRIM$(STR$(N%% + 10)) + ".png", 32)
    Temp& = _NEWIMAGE(46, 46, 32)
    _DEST Temp&
    _PUTIMAGE (0, 0)-(45, 45), Temp1&
    Inventory&(0, N%%) = HardwareImage&(Temp&)
NEXT N%%
'Load Game Sounds
SonsDuRoyaume&(0) = _SNDOPEN("arcing.wav", "sync,vol")
SonsDuRoyaume&(1) = _SNDOPEN("chopin.wav", "sync,vol")
SonsDuRoyaume&(2) = _SNDOPEN("fanfare.wav", "sync,vol")
SonsDuRoyaume&(3) = _SNDOPEN("lighter.wav", "sync,vol")
SonsDuRoyaume&(4) = _SNDOPEN("turn.wav", "sync,vol")
SonsDuRoyaume&(5) = _SNDOPEN("move.wav", "sync,vol")
SonsDuRoyaume&(6) = _SNDOPEN("move1.wav", "sync,vol")
SonsDuRoyaume&(7) = _SNDOPEN("onfire.wav", "sync,vol")
SonsDuRoyaume&(8) = _SNDOPEN("collinv.wav", "sync,vol")
SonsDuRoyaume&(9) = _SNDOPEN("explosion.wav", "sync,vol")
SonsDuRoyaume&(10) = _SNDOPEN("scream.wav", "sync,vol")
'Images
Temp1& = _LOADIMAGE("littleflame.png", 32)
Temp& = _NEWIMAGE(29, 40, 32)
_DEST Temp&
_PUTIMAGE (0, 0), Temp1&
Actions&(0) = HardwareImage&(Temp&)
Temp& = _NEWIMAGE(29, 40, 32)
_DEST Temp&
_PUTIMAGE (28, 0)-(0, 39), Temp1&
Actions&(1) = HardwareImage&(Temp&)
Actions&(2) = _LOADIMAGE("cage.png", 33)
Temp1& = _LOADIMAGE("explosion.png", 32)
FOR N%% = 0 TO 29
    Temp& = _NEWIMAGE(138, 184, 32)
    _DEST Temp&
    _PUTIMAGE (115 - (N%% + 1) * 115 / 30, 115 - (N%% + 1) * 115 / 30)-(115 + (N%% + 1) * 115 / 30, 115 + (N%% + 1) * 115 / 30), Temp1&
    Bang&(1, N%%) = HardwareImage&(Temp&)
NEXT N%%
FOR N%% = 0 TO 29
    Temp& = _NEWIMAGE(46, 46, 32)
    _DEST Temp&
    _PUTIMAGE (23 - (N%% + 1) * 23 / 30, 23 - (N%% + 1) * 23 / 30)-(23 + (N%% + 1) * 23 / 30, 23 + (N%% + 1) * 23 / 30), Temp1&
    Bang&(0, N%%) = HardwareImage&(Temp&)
NEXT N%%
Temp1& = _LOADIMAGE("bullet_hole.png", 32)
FOR N%% = 0 TO 29
    Temp& = _NEWIMAGE(46, 46, 32)
    _DEST Temp&
    _PUTIMAGE (23 - (N%% + 1) * 23 / 30, 23 - (N%% + 1) * 23 / 30)-(23 + (N%% + 1) * 23 / 30, 23 + (N%% + 1) * 23 / 30), Temp1&
    Bullet&(N%%) = HardwareImage&(Temp&)
NEXT N%%
Temp1& = _LOADIMAGE("lightning.png", 32)
Temp& = _NEWIMAGE(46, 46, 32)
_DEST Temp&
_PUTIMAGE (0, 0)-(45, 45), Temp1&
Usain&(0) = HardwareImage&(Temp&)
Temp& = _NEWIMAGE(46, 46, 32)
_DEST Temp&
_PUTIMAGE (45, 45)-(0, 0), Temp1&
Usain&(1) = HardwareImage&(Temp&)
Temp& = _NEWIMAGE(46, 46, 32)
_DEST Temp&
_PUTIMAGE (45, 0)-(0, 45), Temp1&
Usain&(2) = HardwareImage&(Temp&)
Temp& = _NEWIMAGE(46, 46, 32)
_DEST Temp&
_PUTIMAGE (0, 45)-(45, 0), Temp1&
Usain&(3) = HardwareImage&(Temp&)
_FREEIMAGE Temp1&

'Inventory/Dialogue
OPEN "dialogue.dat" FOR INPUT AS #1
FOR N%% = 1 TO 10
    LINE INPUT #1, Dummy$
    Text$ = ""
    FOR M%% = 1 TO LEN(Dummy$)
        Text$ = Text$ + CHR$(ASC(MID$(Dummy$, M%%, 1)) - 3)
    NEXT M%%
    Temp& = _NEWIMAGE(500, 18, 32)
    _DEST Temp&
    COLOR _RGB32(200, 200, 200)
    CLS
    _FONT _LOADFONT("arialbd.ttf", 16)
    _PRINTSTRING (0, 0), Text$
    Inventory&(2, N%%) = HardwareImage&(Temp&)
NEXT N%%
LINE INPUT #1, Dummy$
Text$ = ""
FOR MM% = 1 TO LEN(Dummy$)
    Text$ = Text$ + CHR$(ASC(MID$(Dummy$, MM%, 1)) - 3)
NEXT MM%
Temp& = _NEWIMAGE(820, 18, 32)
_DEST Temp&
COLOR _RGB32(200, 200, 200)
CLS
_FONT _LOADFONT("arialbd.ttf", 12)
_PRINTSTRING (0, 2), Text$
Dialogue&(0, 1) = HardwareImage&(Temp&)
FOR N%% = 2 TO 17
    LINE INPUT #1, Dummy$
    Text$ = ""
    FOR M%% = 1 TO LEN(Dummy$)
        Text$ = Text$ + CHR$(ASC(MID$(Dummy$, M%%, 1)) - 3)
    NEXT M%%
    Temp& = _NEWIMAGE(670, 18, 32)
    _DEST Temp&
    COLOR _RGB32(200, 200, 200)
    CLS
    _FONT _LOADFONT("arialbd.ttf", 16)
    _PRINTSTRING (0, 0), Text$
    Dialogue&(0, N%%) = HardwareImage&(Temp&)
NEXT N%%
CLOSE #1
DATA 0,8,8,4,6,6,0,2,2,2,0,3,0,2,2,2,2
FOR N%% = 1 TO 17
    READ Dialogue&(1, N%%)
NEXT N%%
'Background
Temp& = _NEWIMAGE(Roger%, John%, 32)
_DEST Temp&
CLS
LINE (0, 50)-(1114, 755), _RGB32(15, 60, 0), BF
LINE (1115, 0)-(1120, 750), _RGB32(0, 200, 0), BF
LINE (1195, 0)-(1200, 750), _RGB32(0, 200, 0), BF
FOR N%% = 0 TO 10
    LINE (1115, N%% * 75)-(1200, N%% * 75 + 5), _RGB32(0, 200, 0), BF
NEXT N%%
LINE (0, 0)-(1114, 5), _RGB32(0, 0, 200), BF
LINE (0, 44)-(1114, 49), _RGB32(0, 0, 200), BF
LINE (0, 0)-(5, 49), _RGB32(0, 0, 200), BF
LINE (1109, 0)-(1114, 49), _RGB32(0, 0, 200), BF
LINE (90, 0)-(95, 49), _RGB32(0, 0, 200), BF
LINE (170, 0)-(175, 49), _RGB32(0, 0, 200), BF
'Louis
StadionDef%%(0, 15, 23) = 11
_PUTIMAGE (46 * (23 - 1) + 6, 46 * (15 - 1) + 58)-(46 * (23 - 1) + 6 + 45, 46 * (15 - 1) + 58 + 45), _LOADIMAGE("louis.png", 32)
'Laser
StadionDef%%(0, 14, 24) = 14
_PUTIMAGE (46 * (24 - 1) + 6, 46 * (14 - 1) + 58)-(46 * (24 - 1) + 6 + 45, 46 * (14 - 1) + 58 + 45), _LOADIMAGE("laser.png", 32)
'Ident
COLOR _RGBA32(40, 40, 40, 150), _RGBA32(0, 0, 0, 0)
_FONT _LOADFONT("arialbd.ttf", 20)
DATA 82,88,70,83,76,70,90
FOR N%% = 0 TO 6
    READ Dum1%%
    _PRINTSTRING (1176 - 9 * N%%, 206 + 75 * N%%), CHR$(Dum1%% - 1)
NEXT N%%
'Pillars
DATA 15,22
DATA 15,24
DATA 4,23
DATA 1,1
DATA 10,22
DATA 1,7
DATA 2,4
DATA 3,4
DATA 3,6
DATA 3,7
DATA 2,7
DATA 3,11
DATA 1,10
DATA 14,16
DATA 14,13
DATA 14,14
DATA 14,12
DATA 14,11
DATA 14,10
DATA 3,12
DATA 6,19
DATA 6,20
DATA 10,19
DATA 10,20
DATA 13,1
DATA 11,14
DATA 10,14
DATA 10,12
DATA 9,13
DATA 7,13
DATA 7,12
DATA 7,11
DATA 7,10
DATA 7,9
DATA 10,11
DATA 10,10
DATA 10,9
DATA 9,9
DATA 8,9
DATA 7,5
DATA 8,5
DATA 9,5
FOR N%% = 0 TO 41
    READ Vert%%, Horiz%%
    StadionDef%%(0, Vert%%, Horiz%%) = 15
    _PUTIMAGE (46 * (Horiz%% - 1) + 6, 46 * (Vert%% - 1) + 58), _LOADIMAGE("dot3.png", 32)
NEXT N%%
Background& = HardwareImage&(Temp&)
'Haystacks
DATA 2,16
DATA 2,18
DATA 5,23
DATA 6,22
DATA 1,5
DATA 2,17
DATA 11,23
DATA 2,13
DATA 8,19
DATA 9,19
DATA 9,20
DATA 2,15
DATA 3,5
DATA 12,14
DATA 8,13
DATA 12,7
DATA 12,8
DATA 12,9
DATA 9,3
DATA 10,3
DATA 12,12
DATA 2,19
FOR N%% = 0 TO 21
    READ Vert%%, Horiz%%
    StadionDef%%(0, Vert%%, Horiz%%) = 13
NEXT N%%
Temp& = _NEWIMAGE(46, 46, 32)
_DEST Temp&
_PUTIMAGE (0, 0)-(45, 45), _LOADIMAGE("hay.png", 32)
Obstacle&(0) = HardwareImage&(Temp&)
'Logs
DATA 3,22
DATA 3,24
DATA 4,24
DATA 2,2
DATA 1,2
DATA 1,12
DATA 2,10
DATA 2,11
DATA 2,12
DATA 14,2
DATA 13,2
DATA 7,19
DATA 7,20
DATA 13,12
DATA 13,13
DATA 13,14
DATA 11,12
DATA 11,13
DATA 8,12
FOR N%% = 0 TO 18
    READ Vert%%, Horiz%%
    StadionDef%%(0, Vert%%, Horiz%%) = 16
NEXT N%%
Temp& = _NEWIMAGE(46, 46, 32)
_DEST Temp&
_PUTIMAGE (0, 0)-(45, 45), _LOADIMAGE("logs2.png", 32)
Obstacle&(1) = HardwareImage&(Temp&)
'Mirrors (11 means can never manoeuvre)
DATA 14,21,0,11
DATA 13,20,1,9
DATA 12,20,0,0
DATA 13,24,2,11
DATA 12,24,3,11
DATA 1,24,2,11
DATA 1,21,1,0
DATA 4,18,1,11
DATA 4,21,2,11
DATA 2,23,3,11
DATA 9,23,2,11
DATA 5,1,3,0
DATA 2,1,1,11
DATA 13,16,3,11
DATA 2,8,0,4
DATA 2,14,1,4
DATA 15,15,3,11
DATA 15,7,3,4
DATA 15,2,0,11
DATA 5,22,3,11
DATA 15,5,2,6
DATA 13,3,0,11
DATA 6,16,2,11
DATA 12,3,1,11
DATA 11,5,2,6
DATA 13,17,0,10
DATA 6,17,0,10
DATA 3,3,3,11
DATA 6,2,1,8
DATA 7,22,0,10
FOR N%% = 0 TO 29
    READ Vert%%, Horiz%%, Dum1%%, Dum2%%
    StadionDef%%(0, Vert%%, Horiz%%) = 12
    StadionDef%%(1, Vert%%, Horiz%%) = Dum1%%
    StadionDef%%(2, Vert%%, Horiz%%) = Dum2%%
NEXT N%%
FOR N%% = 0 TO 3
    Temp& = _NEWIMAGE(46, 46, 32)
    _DEST Temp&
    CALL Spiegel(N%%)
    Miroir&(N%%) = HardwareImage&(Temp&)
NEXT N%%
'Indicators
Temp& = _NEWIMAGE(54, 20, 32)
_DEST Temp&
COLOR _RGB32(255, 255, 255)
CLS
_FONT _LOADFONT("arialbd.ttf", 16)
_PRINTSTRING (0, 0), CHR$(27) + CHR$(24) + CHR$(25) + CHR$(26)
Indicators&(0) = HardwareImage&(Temp&)
Temp& = _NEWIMAGE(54, 20, 32)
_DEST Temp&
COLOR _RGB32(255, 255, 255)
CLS
_FONT _LOADFONT("arialbd.ttf", 16)
_PRINTSTRING (0, 0), CHR$(17) + CHR$(18) + CHR$(16)
Indicators&(1) = HardwareImage&(Temp&)
'Saved Games
FOR N%% = 1 TO 9
    Temp& = _NEWIMAGE(74, 69, 32)
    _DEST Temp&
    COLOR _RGB32(50, 50, 240), _RGB32(120, 120, 120)
    CLS
    _FONT _LOADFONT("arialbd.ttf", 20)
    _PRINTSTRING (1, 25), "Game" + STR$(N%%)
    SaveGame&(N%%) = HardwareImage&(Temp&)
NEXT N%%
Temp& = _NEWIMAGE(74, 69, 32)
_DEST Temp&
COLOR _RGB32(50, 50, 240), _RGB32(120, 120, 120)
CLS
_FONT _LOADFONT("arialbd.ttf", 18)
_PRINTSTRING (1, 25), "Game10"
SaveGame&(10) = HardwareImage&(Temp&)
Temp& = _NEWIMAGE(85, 81, 32)
_DEST Temp&
COLOR _RGB32(200, 255, 200)
LINE (0, 0)-(84, 5), , BF
LINE (0, 75)-(84, 80), , BF
LINE (0, 0)-(5, 80), , BF
LINE (79, 0)-(84, 80), , BF
SaveGame&(0) = HardwareImage&(Temp&)
'Laser Beam
Temp& = _NEWIMAGE(46, 46, 32)
_DEST Temp&
LINE (0, 20)-(45, 25), _RGB32(255, 255, 0), BF
Beam&(0, 0) = HardwareImage&(Temp&)
Temp& = _NEWIMAGE(46, 46, 32)
_DEST Temp&
LINE (20, 0)-(25, 45), _RGB32(255, 255, 0), BF
Beam&(0, 1) = HardwareImage&(Temp&)
Temp& = _NEWIMAGE(46, 46, 32)
_DEST Temp&
LINE (0, 20)-(45, 25), _RGB32(255, 255, 0), BF
LINE (20, 0)-(25, 45), _RGB32(255, 255, 0), BF
Beam&(0, 2) = HardwareImage&(Temp&)
Temp& = _NEWIMAGE(46, 46, 32)
Horiz%% = 23: Vert%% = 23
_DEST Temp&
FOR M%% = -3 TO 2
    LINE (Horiz%% + M%%, Vert%% - 23)-(Horiz%% + M%%, Vert%% + M%%), _RGB32(255, 255, 0)
    LINE (Horiz%% + M%%, Vert%% + M%%)-(Horiz%% + 23, Vert%% + M%%), _RGB32(255, 255, 0)
NEXT M%%
Beam&(1, 0) = HardwareImage&(Temp&)
Temp& = _NEWIMAGE(46, 46, 32)
_DEST Temp&
FOR M%% = -3 TO 2
    LINE (Horiz%% + 23, Vert%% + M%%)-(Horiz%% - M%%, Vert%% + M%%), _RGB32(255, 255, 0)
NEXT M%%
FOR M%% = -2 TO 3
    LINE (Horiz%% - M%%, Vert%% + M%%)-(Horiz%% - M%%, Vert%% + 23), _RGB32(255, 255, 0)
NEXT M%%
Beam&(1, 1) = HardwareImage&(Temp&)
Temp& = _NEWIMAGE(46, 46, 32)
_DEST Temp&
FOR M%% = -2 TO 3
    LINE (Horiz%% - M%%, Vert%% + 23)-(Horiz%% - M%%, Vert%% - M%%), _RGB32(255, 255, 0)
    LINE (Horiz%% - M%%, Vert%% - M%%)-(Horiz%% - 23, Vert%% - M%%), _RGB32(255, 255, 0)
NEXT M%%
Beam&(1, 2) = HardwareImage&(Temp&)
Temp& = _NEWIMAGE(46, 46, 32)
_DEST Temp&
FOR M%% = -3 TO 2
    LINE (Horiz%% + M%%, Vert%% - 23)-(Horiz%% + M%%, Vert%% - M%%), _RGB32(255, 255, 0)
    LINE (Horiz%% - M%%, Vert%% + M%%)-(Horiz%% - 23, Vert%% + M%%), _RGB32(255, 255, 0)
NEXT M%%
Beam&(1, 3) = HardwareImage&(Temp&)
Temp& = _NEWIMAGE(46, 46, 32)
_DEST Temp&
FOR M%% = -3 TO 2
    LINE (Horiz%%, Vert%% + M%%)-(Horiz%% + 23, Vert%% + M%%), _RGB32(255, 255, 0)
NEXT M%%
Beam&(2, 0) = HardwareImage&(Temp&)
Temp& = _NEWIMAGE(46, 46, 32)
_DEST Temp&
FOR M%% = -3 TO 2
    LINE (Horiz%% + M%%, Vert%%)-(Horiz%% + M%%, Vert%% + 23), _RGB32(255, 255, 0)
NEXT M%%
Beam&(2, 1) = HardwareImage&(Temp&)
Temp& = _NEWIMAGE(46, 46, 32)
_DEST Temp&
FOR M%% = -3 TO 2
    LINE (Horiz%% - 23, Vert%% + M%%)-(Horiz%%, Vert%% + M%%), _RGB32(255, 255, 0)
NEXT M%%
Beam&(2, 2) = HardwareImage&(Temp&)
Temp& = _NEWIMAGE(46, 46, 32)
_DEST Temp&
FOR M%% = -3 TO 2
    LINE (Horiz%% + M%%, Vert%% - 23)-(Horiz%% + M%%, Vert%%), _RGB32(255, 255, 0)
NEXT M%%
Beam&(2, 3) = HardwareImage&(Temp&)
'Marie_Antoinette
Temp& = _NEWIMAGE(46, 46, 32)
_DEST Temp&
_PUTIMAGE (0, 0)-(45, 45), _LOADIMAGE("Marie_Antoinette.png", 32)
Marie& = HardwareImage&(Temp&)

SCREEN _NEWIMAGE(Roger%, John%, 32)
_SCREENMOVE 20, 20
_DEST 0
CLS
_DISPLAYORDER _HARDWARE
AnotherGame%% = True
WHILE AnotherGame%%
    Smokin%% = True
    NextInventory%% = 1 'Always start at starting position
    LeRoiEstMort%% = 0
    ViveLeRoi%% = 0
    LaserOn%% = True
    NextBeam%% = True
    Ignition%% = False
    SetFire%% = False
    SetFlame%% = False
    DispFlame%% = False
    StopFlame%% = False
    EnFlammes%% = False
    MarieCanMove%% = True
    CanPush%% = True
    Tapped%% = False
    NoTenIsReady%% = False
    Lightning%% = False
    KaBoom%% = 0
    Explode%% = False
    Exploded%% = False
    DispDialog%% = 0
    DispInv%% = 0
    Count0% = 0
    Count1% = 0
    Count2% = 0
    Count3% = 0
    Count4% = 0
    Count5% = 0
    Count6% = 0
    InvOld%% = 0
    ften%% = False
    MAPosVert%% = 15
    MAPosHoriz%% = 21
    CALL REDDIM(BeamGrid%%())
    FOR K%% = 0 TO 2
        FOR N%% = 1 TO 15
            FOR M%% = 1 TO 24
                Stadion%%(K%%, N%%, M%%) = StadionDef%%(K%%, N%%, M%%)
            NEXT M%%
        NEXT N%%
    NEXT K%%

    WHILE Smokin%%
        'Set timings based upon fraction of Brian%%
        _LIMIT Brian%%

        'Timed Events
        'Restrict Marie Movement
        IF Tapped%% THEN
            Count0% = Count0% + 1
            IF Count0% >= 0.17 * Brian%% THEN
                Count0% = 0
                Tapped%% = False
                'Use up stray inkey presses
                WHILE INKEY$ <> ""
                    KK$ = INKEY$
                WEND
            END IF
        END IF
        'Flame
        IF SetFire%% THEN
            _SNDPLAY SonsDuRoyaume&(3)
            SetFire%% = False
            Ignition%% = True
        ELSEIF SetFlame%% THEN
            DispFlame%% = True
            IF LeRoiEstMort%% = 4 THEN
                BEEP
                DispDialog%% = 4
            END IF
            _SNDPLAY SonsDuRoyaume&(7)
            SetFlame%% = False
        END IF
        IF LeRoiEstMort%% = 1 OR LeRoiEstMort%% = 2 THEN 'Death Scenes
            Count1% = Count1% + 1
            IF Count1% = 3 THEN
                Count1% = 0
                KaBoom%% = KaBoom%% + 1
                IF KaBoom%% = 6 THEN
                    _SNDPLAY SonsDuRoyaume&(10)
                    IF LeRoiEstMort%% = 1 THEN
                        DispDialog%% = 2
                    ELSE
                        DispDialog%% = 3
                    END IF
                ELSEIF KaBoom%% = 12 THEN
                    _SNDPLAY SonsDuRoyaume&(1)
                ELSEIF KaBoom%% > 29 THEN
                    KaBoom%% = 29
                END IF
            END IF
        ELSEIF Ignition%% THEN
            Count1% = Count1% + 1
            IF Count1% >= Brian%% THEN
                Count1% = 0
                Ignition%% = False
                SetFlame%% = True
            END IF
        ELSEIF Lightning%% THEN 'Laser Zapping
            Count1% = Count1% + 1
            IF Count1% >= 5 * Brian%% THEN
                Count1% = 0
                Lightning%% = False
                Explode%% = True
                _SNDPLAY SonsDuRoyaume&(9)
                LaserOn%% = False
                CALL REDDIM(BeamGrid%%())
                LaserSearch%% = False
            END IF
        ELSEIF Explode%% THEN
            Count1% = Count1% + 1
            IF Count1% >= 1.9 * Brian%% THEN
                Count1% = 0
                Explode%% = False
                Exploded%% = True
                'Set dialogs
                IF LeRoiEstMort%% = 0 THEN
                    DispDialog%% = 5
                ELSE
                    _SNDPLAY SonsDuRoyaume&(1)
                    DispDialog%% = 3
                END IF
            END IF
        ELSEIF DispFlame%% THEN
            Count6% = Count6% + 1
            IF LeRoiEstMort%% = 0 THEN
                'Flame Time Level Dependent
                IF Count6% >= FlameTime%%(NextInventory%% - 1) * Brian%% THEN
                    Count6% = 0
                    DispFlame%% = False
                    EnFlammes%% = False
                    Stadion%%(0, BeamPosVert%%, BeamPosHoriz%%) = 0
                    CALL REDDIM(BeamGrid%%())
                    CanPush%% = True
                END IF
            ELSE
                'For burnt inventory, fixed flame time.  Don't redraw laserbeam
                IF Count6% >= 4 * Brian%% THEN
                    Count6% = 0
                    DispFlame%% = False
                    Stadion%%(0, BeamPosVert%%, BeamPosHoriz%%) = 0
                END IF
            END IF
        END IF
        'Dialogues
        IF ften%% THEN 'F10
            Count2% = Count2% + 1
            InvNo%% = INT((Count2% - 0.5 * Brian%%) / (5 * Brian%%)) + 1
            IF InvNo%% <> InvOld%% THEN
                InvOld%% = InvNo%%
                IF Freddie%% AND InvNo%% <= 10 THEN _SNDPLAY InvSound&(InvNo%%)
            END IF
            IF InvNo%% > 10 THEN
                ften%% = False
                InvOld%% = 0
                Count2% = 0
            END IF
        ELSEIF DispDialog%% > 0 THEN 'Dialogues
            IF Dialogue&(1, DispDialog%%) > 0 THEN
                Count2% = Count2% + 1
                IF Count2% >= Dialogue&(1, DispDialog%%) * Brian%% THEN
                    Count2% = 0
                    SELECT CASE DispDialog%%
                        CASE 2, 3, 12
                            DispDialog%% = 13
                        CASE 4
                            DispDialog%% = 12
                        CASE ELSE
                            DispDialog%% = 0
                    END SELECT
                END IF
            END IF
        ELSEIF DispInv%% > 0 THEN 'Inventory Dialogues
            Count4% = Count4% + 1
            IF Count4% >= 4 * Brian%% THEN
                Count4% = 0
                DispInv%% = 0
                DispDialog%% = 9
            END IF
        END IF
        'Laser delay
        IF LazyBeam%% AND MoreBeams%% THEN
            Count3% = Count3% + 1
            IF Count3% >= 0.06 * Brian%% THEN
                Count3% = 0
                NextBeam%% = True
            END IF
        END IF

        'Images
        'Backgrond
        _PUTIMAGE (0, 0), Background&
        'Inventory / Saved Games
        IF DispDialog%% = 7 THEN
            FOR N%% = 1 TO NoGames%%
                _PUTIMAGE (1121, (N%% - 1) * 75 + 6), SaveGame&(N%%)
            NEXT N%%
            _PUTIMAGE (1115, (GameNo%% - 1) * 75), SaveGame&(0)
        ELSEIF ften%% AND InvNo%% >= 1 THEN
            FOR N%% = 1 TO InvNo%%
                _PUTIMAGE (190, 18), Inventory&(2, N%%)
                _PUTIMAGE (1121, (N%% - 1) * 75 + 6), Inventory&(1, N%%)
            NEXT N%%
        ELSE
            FOR N%% = 1 TO 10
                IF N%% < NextInventory%% THEN _PUTIMAGE (1121, (N%% - 1) * 75 + 6), Inventory&(1, N%%)
            NEXT N%%
        END IF
        'Dialogue/Inventory Dialogue
        IF DispDialog%% > 0 THEN
            _PUTIMAGE (190, 18), Dialogue&(0, DispDialog%%)
        ELSEIF DispInv%% > 0 THEN
            _PUTIMAGE (190, 18), Inventory&(2, DispInv%%)
        END IF
        'Indicators
        IF MarieCanMove%% THEN
            _PUTIMAGE (22, 16), Indicators&(0)
            IF CanPush%% THEN _PUTIMAGE (114, 16), Indicators&(1)
        END IF
        'Objects
        FOR N%% = 1 TO 15
            FOR M%% = 1 TO 24
                SELECT CASE Stadion%%(0, N%%, M%%)
                    CASE 1 TO 10
                        'Inventory Baskets
                        _PUTIMAGE ((M%% - 1) * 46 + 6, (N%% - 1) * 46 + 58), Inventory&(0, Stadion%%(0, N%%, M%%))
                    CASE 12
                        'Mirrors
                        _PUTIMAGE ((M%% - 1) * 46 + 6, (N%% - 1) * 46 + 58), Miroir&(Stadion%%(1, N%%, M%%))
                    CASE 13
                        'Haystacks
                        _PUTIMAGE ((M%% - 1) * 46 + 6, (N%% - 1) * 46 + 58), Obstacle&(0)
                    CASE 16
                        'Logs
                        _PUTIMAGE ((M%% - 1) * 46 + 6, (N%% - 1) * 46 + 58), Obstacle&(1)
                END SELECT
            NEXT M%%
        NEXT N%%
        'Marie_Antoinette
        _PUTIMAGE (46 * (MAPosHoriz%% - 1) + 6, 46 * (MAPosVert%% - 1) + 58), Marie&
        'Laser Beam
        FOR N%% = 1 TO 15
            FOR M%% = 1 TO 24
                IF BeamGrid%%(N%%, M%%) <> 0 THEN
                    IF Stadion%%(0, N%%, M%%) = 12 THEN
                        'Beam refection on top of mirror image
                        _PUTIMAGE ((M%% - 1) * 46 + 6, (N%% - 1) * 46 + 58), Beam&(1, Stadion%%(1, N%%, M%%))
                    ELSE
                        _PUTIMAGE ((M%% - 1) * 46 + 6, (N%% - 1) * 46 + 58), Beam&(0, BeamGrid%%(N%%, M%%) - 1)
                    END IF
                END IF
            NEXT M%%
        NEXT N%%
        'For laser beam ignition (only burning items)
        IF LaserOn%% THEN
            IF BeamPosHoriz%% >= 1 AND BeamPosHoriz%% <= 24 AND BeamPosVert%% >= 1 AND BeamPosVert%% <= 15 THEN
                IF Stadion%%(0, BeamPosVert%%, BeamPosHoriz%%) = 12 OR Stadion%%(0, BeamPosVert%%, BeamPosHoriz%%) = 15 THEN
                    'Non-burn items
                ELSE
                    _PUTIMAGE ((BeamPosHoriz%% - 1) * 46 + 6, (BeamPosVert%% - 1) * 46 + 58), Beam&(2, LaserDir%%)
                END IF
            END IF
        END IF
        'Flame/Lightning & Explosion/Bullet Hole
        IF LeRoiEstMort%% = 1 OR LeRoiEstMort%% = 2 THEN
            IF LeRoiEstMort%% = 1 THEN
                _PUTIMAGE (46 * (MAPosHoriz%% - 1) + 6, 46 * (MAPosVert%% - 1) + 58), Bullet&(KaBoom%%)
            ELSE
                _PUTIMAGE (46 * (23 - 1) + 6, 46 * (15 - 1) + 58), Bullet&(KaBoom%%)
            END IF
        ELSEIF Lightning%% THEN
            IF Count5% <= 8 THEN _PUTIMAGE (46 * (24 - 1) + 6, 46 * (14 - 1) + 58), Usain&(KaBoom%%)
            Count5% = Count5% + 1
            IF Count5% = 10 THEN
                Count5% = 0
                KaBoom%% = INT(RND * 4)
            END IF
        ELSEIF Explode%% THEN
            IF LeRoiEstMort%% = 0 THEN
                _PUTIMAGE (46 * (24 - 1) + 6, 46 * (14 - 1) + 58), Bang&(0, Count1%)
            ELSE
                _PUTIMAGE (46 * (22 - 1) + 6, 46 * (12 - 1) + 58), Bang&(1, Count1%)
            END IF
        ELSEIF Exploded%% THEN
            IF LeRoiEstMort%% = 0 THEN
                _PUTIMAGE (46 * (24 - 1) + 6, 46 * (14 - 1) + 58), Bang&(0, 29)
            ELSE
                _PUTIMAGE (46 * (22 - 1) + 6, 46 * (12 - 1) + 58), Bang&(1, 29)
            END IF
        ELSEIF DispFlame%% THEN
            IF Count5% < 7 THEN
                _PUTIMAGE ((BeamPosHoriz%% - 1) * 46 + 6 + 10, (BeamPosVert%% - 1) * 46 + 58), Actions&(0)
            ELSE
                _PUTIMAGE ((BeamPosHoriz%% - 1) * 46 + 6 + 10, (BeamPosVert%% - 1) * 46 + 58), Actions&(1)
            END IF
            Count5% = Count5% + 1
            IF Count5% = 14 THEN Count5% = 0
        END IF
        'Safety Cage over Laser
        IF NextInventory%% = 11 THEN _PUTIMAGE (46 * (24 - 1) + 6, 46 * (14 - 1) + 58), Actions&(2)

        'Laser Beam Search
        IF LaserOn%% THEN
            WHILE LaserSearch%% AND NextBeam%%
                IF BeamPosVert%% = MAPosVert%% AND BeamPosHoriz%% = MAPosHoriz%% THEN
                    'La Reine Est Morte
                    _SNDPLAY SonsDuRoyaume&(3)
                    EnFlammes%% = True
                    LaserSearch%% = False
                    MarieCanMove%% = False
                    LeRoiEstMort%% = 1
                ELSEIF Stadion%%(0, BeamPosVert%%, BeamPosHoriz%%) = 11 THEN
                    'Le Roi Est Mort
                    _SNDPLAY SonsDuRoyaume&(3)
                    EnFlammes%% = True
                    LaserSearch%% = False
                    MarieCanMove%% = False
                    LeRoiEstMort%% = 2
                ELSEIF Stadion%%(0, BeamPosVert%%, BeamPosHoriz%%) = 14 THEN
                    'Zap Laser
                    IF NextInventory%% <= 10 THEN
                        LeRoiEstMort%% = 3
                        MarieCanMove%% = False
                    END IF
                    _SNDPLAY SonsDuRoyaume&(0)
                    EnFlammes%% = True
                    Lightning%% = True
                    LaserSearch%% = False
                ELSEIF Stadion%%(0, BeamPosVert%%, BeamPosHoriz%%) >= 1 AND Stadion%%(0, BeamPosVert%%, BeamPosHoriz%%) <= 10 THEN
                    'Zap Inventory
                    LaserSearch%% = False
                    MarieCanMove%% = False
                    SetFire%% = True
                    EnFlammes%% = True
                    LeRoiEstMort%% = 4
                ELSEIF Stadion%%(0, BeamPosVert%%, BeamPosHoriz%%) = 16 OR Stadion%%(0, BeamPosVert%%, BeamPosHoriz%%) = 13 THEN
                    'Set Fire to Logs/Hay
                    LaserSearch%% = False
                    CanPush%% = False
                    EnFlammes%% = True
                    SetFire%% = True
                ELSEIF Stadion%%(0, BeamPosVert%%, BeamPosHoriz%%) = 12 THEN
                    'Reflect in Mirror
                    IF LaserDir%% = 0 OR LaserDir%% = 2 THEN
                        'Laserbeam 0 or 2
                        'Check for mirror orientation
                        IF LaserDir%% = 0 AND (Stadion%%(1, BeamPosVert%%, BeamPosHoriz%%) = 0 OR Stadion%%(1, BeamPosVert%%, BeamPosHoriz%%) = 1) THEN
                            IF Stadion%%(1, BeamPosVert%%, BeamPosHoriz%%) = 0 THEN
                                LaserDir%% = 1
                            ELSE
                                LaserDir%% = 3
                            END IF
                            BeamGrid%%(BeamPosVert%%, BeamPosHoriz%%) = 1 '(Any value will do in a mirror position)
                            BeamPosVert%% = BeamPosVert%% - 2 + LaserDir%%
                        ELSEIF LaserDir%% = 2 AND (Stadion%%(1, BeamPosVert%%, BeamPosHoriz%%) = 2 OR Stadion%%(1, BeamPosVert%%, BeamPosHoriz%%) = 3) THEN
                            'Draw laser beam in mirror position
                            IF Stadion%%(1, BeamPosVert%%, BeamPosHoriz%%) = 2 THEN
                                LaserDir%% = 3
                            ELSE
                                LaserDir%% = 1
                            END IF
                            BeamGrid%%(BeamPosVert%%, BeamPosHoriz%%) = 1 '(Any value will do in a mirror position)
                            BeamPosVert%% = BeamPosVert%% - 2 + LaserDir%%
                        ELSE
                            LaserSearch%% = False
                        END IF
                    ELSE
                        'Laserbeam 1 or 3
                        'Check for mirror orientation
                        IF LaserDir%% = 1 AND (Stadion%%(1, BeamPosVert%%, BeamPosHoriz%%) = 1 OR Stadion%%(1, BeamPosVert%%, BeamPosHoriz%%) = 2) THEN
                            IF Stadion%%(1, BeamPosVert%%, BeamPosHoriz%%) = 1 THEN
                                LaserDir%% = 2
                            ELSE
                                LaserDir%% = 0
                            END IF
                            BeamGrid%%(BeamPosVert%%, BeamPosHoriz%%) = 1 '(Any value will do in a mirror position)
                            BeamPosHoriz%% = BeamPosHoriz%% - 1 + LaserDir%%
                        ELSEIF LaserDir%% = 3 AND (Stadion%%(1, BeamPosVert%%, BeamPosHoriz%%) = 3 OR Stadion%%(1, BeamPosVert%%, BeamPosHoriz%%) = 0) THEN
                            'Draw laser beam in mirror position
                            IF Stadion%%(1, BeamPosVert%%, BeamPosHoriz%%) = 3 THEN
                                LaserDir%% = 0
                            ELSE
                                LaserDir%% = 2
                            END IF
                            BeamGrid%%(BeamPosVert%%, BeamPosHoriz%%) = 1 '(Any value will do in a mirror position)
                            BeamPosHoriz%% = BeamPosHoriz%% - 1 + LaserDir%%
                        ELSE
                            LaserSearch%% = False
                        END IF
                    END IF
                ELSEIF (Stadion%%(0, BeamPosVert%%, BeamPosHoriz%%) = 0) AND (BeamPosHoriz%% >= 1 AND BeamPosHoriz%% <= 24) AND (BeamPosVert%% >= 1 AND BeamPosVert%% <= 15) THEN
                    'Draw Next Beam
                    IF LaserDir%% = 0 OR LaserDir%% = 2 THEN
                        IF BeamGrid%%(BeamPosVert%%, BeamPosHoriz%%) = 0 THEN
                            BeamGrid%%(BeamPosVert%%, BeamPosHoriz%%) = 1
                        ELSE
                            BeamGrid%%(BeamPosVert%%, BeamPosHoriz%%) = 3
                        END IF
                        BeamPosHoriz%% = BeamPosHoriz%% - 1 + LaserDir%%
                    ELSE
                        IF BeamGrid%%(BeamPosVert%%, BeamPosHoriz%%) = 0 THEN
                            BeamGrid%%(BeamPosVert%%, BeamPosHoriz%%) = 2
                        ELSE
                            BeamGrid%%(BeamPosVert%%, BeamPosHoriz%%) = 3
                        END IF
                        BeamPosVert%% = BeamPosVert%% - 2 + LaserDir%%
                    END IF
                ELSE
                    LaserSearch%% = False
                END IF
                IF LazyBeam%% THEN NextBeam%% = False
            WEND
            IF NOT LaserSearch%% AND LazyBeam%% THEN MoreBeams%% = False
        END IF

        'Key Input
        KK$ = INKEY$
        IF KK$ <> "" THEN
            IF DispDialog%% = 13 THEN
                'Quit
                IF UCASE$(KK$) <> "Y" THEN AnotherGame%% = False
                Smokin%% = False
            ELSE
                IF ASC(KK$) = 27 THEN
                    'Esc - Quit Game
                    DispDialog%% = 13
                ELSEIF NOT ften%% THEN
                    SELECT CASE DispDialog%%
                        CASE 1
                            'Any key quits F1
                            DispDialog%% = 0
                            MarieCanMove%% = True
                            CanPush%% = True
                        CASE 11
                            'Successful mission - press any key
                            DispDialog%% = 13
                        CASE 7
                            'Load Game
                            IF fkey%%(KK$) = 2 THEN
                                'Quit from loading menu
                                DispDialog%% = 0
                                MarieCanMove%% = True
                            ELSEIF KK$ = CHR$(13) THEN
                                OPEN "game" + LTRIM$(STR$(GameNo%%)) + ".dat" FOR INPUT AS #2
                                FOR K%% = 0 TO 2
                                    FOR N%% = 1 TO 15
                                        FOR M%% = 1 TO 24
                                            INPUT #2, Stadion%%(K%%, N%%, M%%)
                                        NEXT M%%
                                    NEXT N%%
                                NEXT K%%
                                INPUT #2, MAPosVert%%
                                INPUT #2, MAPosHoriz%%
                                CLOSE #2
                                NextInventory%% = GameNo%% + 1
                                CALL REDDIM(BeamGrid%%())
                                DispDialog%% = 8
                                MarieCanMove%% = True
                            ELSEIF fkey%%(KK$) = 22 AND GameNo%% < NoGames%% THEN
                                'Down Key
                                GameNo%% = GameNo%% + 1
                            ELSEIF fkey%%(KK$) = 14 AND GameNo%% > 1 THEN
                                'Up Key
                                GameNo%% = GameNo%% - 1
                            END IF
                        CASE ELSE
                            IF NOT LaserSearch%% AND MarieCanMove%% THEN
                                'No key except Esc allowed when the laser beam is proceeding or when Marie can't move
                                IF fkey%%(KK$) = 1 AND NOT EnFlammes%% THEN
                                    'F1 Help On and Off
                                    DispDialog%% = 1
                                    MarieCanMove%% = False
                                ELSEIF fkey%%(KK$) = 2 AND NOT EnFlammes%% THEN
                                    'F2 Load A Saved Game (First look for saved games)
                                    NoGames%% = 0
                                    MoreGames%% = True
                                    WHILE MoreGames%%
                                        IF _FILEEXISTS("game" + LTRIM$(STR$(NoGames%% + 1)) + ".dat") THEN
                                            NoGames%% = NoGames%% + 1
                                        ELSE
                                            MoreGames%% = False
                                        END IF
                                    WEND
                                    IF NoGames%% >= 1 THEN
                                        GameNo%% = NextInventory%% - 1
                                        IF GameNo%% <= 1 THEN GameNo%% = 1
                                        DispDialog%% = 7
                                        MarieCanMove%% = False
                                    END IF
                                ELSEIF fkey%%(KK$) = 3 AND NextInventory%% > 1 AND NOT EnFlammes%% THEN
                                    'F3 Load Pre-saved Game (known to be successful)
                                    OPEN "set" + LTRIM$(STR$(NextInventory%% - 1)) + ".dat" FOR INPUT AS #2
                                    FOR K%% = 0 TO 2
                                        FOR N%% = 1 TO 15
                                            FOR M%% = 1 TO 24
                                                INPUT #2, Stadion%%(K%%, N%%, M%%)
                                            NEXT M%%
                                        NEXT N%%
                                    NEXT K%%
                                    INPUT #2, MAPosVert%%
                                    INPUT #2, MAPosHoriz%%
                                    CLOSE #2
                                    CALL REDDIM(BeamGrid%%())
                                    DispDialog%% = 10
                                ELSEIF fkey%%(KK$) = 4 THEN
                                    'F4 Laser delay On/Off
                                    IF LazyBeam%% THEN
                                        LazyBeam%% = False
                                        DispDialog%% = 16
                                    ELSE
                                        LazyBeam%% = True
                                        DispDialog%% = 17
                                    END IF
                                    NextBeam%% = True
                                ELSEIF fkey%%(KK$) = 5 THEN
                                    'F5 Sounds On/Off
                                    IF MoveSounds%% THEN
                                        MoveSounds%% = False
                                        DispDialog%% = 14
                                    ELSE
                                        MoveSounds%% = True
                                        DispDialog%% = 15
                                    END IF
                                ELSEIF fkey%%(KK$) = 10 AND NOT EnFlammes%% THEN
                                    'F10 Display Inventory
                                    ften%% = True
                                    InvNo%% = 0
                                ELSEIF ((fkey%%(KK$) = 14 AND MAPosVert%% >= 2) OR (fkey%%(KK$) = 22 AND MAPosVert%% <= 14) OR (fkey%%(KK$) = 17 AND MAPosHoriz%% >= 2) OR (fkey%%(KK$) = 19 AND MAPosHoriz%% <= 23)) AND NOT Tapped%% THEN
                                    'Arrow Keys with time delay to restrict movement speed
                                    Tapped%% = True
                                    IF fkey%%(KK$) = 14 AND Stadion%%(0, MAPosVert%% - 1, MAPosHoriz%%) <= 11 THEN
                                        SELECT CASE Stadion%%(0, MAPosVert%% - 1, MAPosHoriz%%)
                                            CASE 11
                                                'Success - Move over Louis & play fanfare
                                                CALL MoveMarie(1, MAPosVert%%, MAPosHoriz%%)
                                                DispDialog%% = 11
                                                _SNDPLAY SonsDuRoyaume&(2)
                                            CASE NextInventory%%
                                                IF NextInventory%% <= 9 OR (NextInventory%% = 10 AND NoTenIsReady%%) THEN
                                                    DispInv%% = NextInventory%%
                                                    CALL MoveMarie(1, MAPosVert%%, MAPosHoriz%%)
                                                    GameNo%% = NextInventory%%
                                                    CALL NextInv
                                                ELSE
                                                    'Inventory 10 not ready
                                                    BEEP
                                                    DispDialog%% = 6
                                                END IF
                                            CASE 0
                                                IF BeamGrid%%(MAPosVert%% - 1, MAPosHoriz%%) <> 0 THEN CALL REDDIM(BeamGrid%%())
                                                CALL MoveMarie(1, MAPosVert%%, MAPosHoriz%%)
                                            CASE ELSE
                                                'Wrong Inventory
                                                BEEP
                                                DispDialog%% = 6
                                        END SELECT
                                    ELSEIF fkey%%(KK$) = 22 AND Stadion%%(0, MAPosVert%% + 1, MAPosHoriz%%) <= 11 THEN
                                        SELECT CASE Stadion%%(0, MAPosVert%% + 1, MAPosHoriz%%)
                                            CASE 11
                                                'Success - Move over Louis & play fanfare
                                                CALL MoveMarie(3, MAPosVert%%, MAPosHoriz%%)
                                                DispDialog%% = 11
                                                _SNDPLAY SonsDuRoyaume&(2)
                                            CASE NextInventory%%
                                                IF NextInventory%% <= 9 OR (NextInventory%% = 10 AND NoTenIsReady%%) THEN
                                                    DispInv%% = NextInventory%%
                                                    CALL MoveMarie(3, MAPosVert%%, MAPosHoriz%%)
                                                    GameNo%% = NextInventory%%
                                                    CALL NextInv
                                                ELSE
                                                    'Inventory 10 not ready
                                                    BEEP
                                                    DispDialog%% = 6
                                                END IF
                                            CASE 0
                                                IF BeamGrid%%(MAPosVert%% + 1, MAPosHoriz%%) <> 0 THEN CALL REDDIM(BeamGrid%%())
                                                CALL MoveMarie(3, MAPosVert%%, MAPosHoriz%%)
                                            CASE ELSE
                                                'Wrong Inventory
                                                BEEP
                                                DispDialog%% = 6
                                        END SELECT
                                    ELSEIF fkey%%(KK$) = 17 AND Stadion%%(0, MAPosVert%%, MAPosHoriz%% - 1) <= 11 THEN
                                        SELECT CASE Stadion%%(0, MAPosVert%%, MAPosHoriz%% - 1)
                                            CASE 11
                                                'Success - Move over Louis & play fanfare
                                                CALL MoveMarie(0, MAPosVert%%, MAPosHoriz%%)
                                                DispDialog%% = 11
                                                _SNDPLAY SonsDuRoyaume&(2)
                                            CASE NextInventory%%
                                                IF NextInventory%% <= 9 OR (NextInventory%% = 10 AND NoTenIsReady%%) THEN
                                                    DispInv%% = NextInventory%%
                                                    CALL MoveMarie(0, MAPosVert%%, MAPosHoriz%%)
                                                    GameNo%% = NextInventory%%
                                                    CALL NextInv
                                                ELSE
                                                    'Inventory 10 not ready
                                                    BEEP
                                                    DispDialog%% = 6
                                                END IF
                                            CASE 0
                                                IF BeamGrid%%(MAPosVert%%, MAPosHoriz%% - 1) <> 0 THEN CALL REDDIM(BeamGrid%%())
                                                CALL MoveMarie(0, MAPosVert%%, MAPosHoriz%%)
                                            CASE ELSE
                                                'Wrong Inventory
                                                BEEP
                                                DispDialog%% = 6
                                        END SELECT
                                    ELSEIF fkey%%(KK$) = 19 AND Stadion%%(0, MAPosVert%%, MAPosHoriz%% + 1) <= 11 THEN
                                        SELECT CASE Stadion%%(0, MAPosVert%%, MAPosHoriz%% + 1)
                                            CASE 11
                                                'Success - Move over Louis & play fanfare
                                                CALL MoveMarie(2, MAPosVert%%, MAPosHoriz%%)
                                                DispDialog%% = 11
                                                _SNDPLAY SonsDuRoyaume&(2)
                                            CASE NextInventory%%
                                                IF NextInventory%% <= 9 OR (NextInventory%% = 10 AND NoTenIsReady%%) THEN
                                                    DispInv%% = NextInventory%%
                                                    CALL MoveMarie(2, MAPosVert%%, MAPosHoriz%%)
                                                    GameNo%% = NextInventory%%
                                                    CALL NextInv
                                                ELSE
                                                    'Inventory 10 not ready
                                                    BEEP
                                                    DispDialog%% = 6
                                                END IF
                                            CASE 0
                                                IF BeamGrid%%(MAPosVert%%, MAPosHoriz%% + 1) <> 0 THEN CALL REDDIM(BeamGrid%%())
                                                CALL MoveMarie(2, MAPosVert%%, MAPosHoriz%%)
                                            CASE ELSE
                                                'Wrong Inventory
                                                BEEP
                                                DispDialog%% = 6
                                        END SELECT
                                    ELSEIF fkey%%(KK$) = 14 AND Stadion%%(0, MAPosVert%% - 1, MAPosHoriz%%) = 12 AND CanPush%% THEN
                                        'Mirrors
                                        IF Stadion%%(2, MAPosVert%% - 1, MAPosHoriz%%) <= NextInventory%% THEN
                                            IF Stadion%%(1, MAPosVert%% - 1, MAPosHoriz%%) = 1 OR Stadion%%(1, MAPosVert%% - 1, MAPosHoriz%%) = 2 THEN
                                                IF MoveSounds%% THEN _SNDPLAY SonsDuRoyaume&(4)
                                                Stadion%%(1, MAPosVert%% - 1, MAPosHoriz%%) = Stadion%%(1, MAPosVert%% - 1, MAPosHoriz%%) + 1
                                            ELSEIF MAPosVert%% >= 3 THEN
                                                IF Stadion%%(0, MAPosVert%% - 2, MAPosHoriz%%) = 0 THEN
                                                    CALL MoveMirror(1, MAPosVert%%, MAPosHoriz%%)
                                                    IF MoveSounds%% THEN _SNDPLAY SonsDuRoyaume&(6)
                                                END IF
                                            END IF
                                            CALL REDDIM(BeamGrid%%())
                                        END IF
                                    ELSEIF fkey%%(KK$) = 22 AND Stadion%%(0, MAPosVert%% + 1, MAPosHoriz%%) = 12 AND CanPush%% THEN
                                        'Mirrors
                                        IF Stadion%%(2, MAPosVert%% + 1, MAPosHoriz%%) <= NextInventory%% THEN
                                            IF Stadion%%(1, MAPosVert%% + 1, MAPosHoriz%%) = 3 OR Stadion%%(1, MAPosVert%% + 1, MAPosHoriz%%) = 0 THEN
                                                IF MoveSounds%% THEN _SNDPLAY SonsDuRoyaume&(4)
                                                Stadion%%(1, MAPosVert%% + 1, MAPosHoriz%%) = Stadion%%(1, MAPosVert%% + 1, MAPosHoriz%%) + 1
                                                IF Stadion%%(1, MAPosVert%% + 1, MAPosHoriz%%) > 3 THEN Stadion%%(1, MAPosVert%% + 1, MAPosHoriz%%) = 0
                                            ELSEIF MAPosVert%% <= 13 THEN
                                                IF Stadion%%(0, MAPosVert%% + 2, MAPosHoriz%%) = 0 THEN
                                                    CALL MoveMirror(3, MAPosVert%%, MAPosHoriz%%)
                                                    IF MoveSounds%% THEN _SNDPLAY SonsDuRoyaume&(6)
                                                END IF
                                            END IF
                                            CALL REDDIM(BeamGrid%%())
                                        END IF
                                    ELSEIF fkey%%(KK$) = 17 AND Stadion%%(0, MAPosVert%%, MAPosHoriz%% - 1) = 12 AND CanPush%% THEN
                                        'Mirrors
                                        IF Stadion%%(2, MAPosVert%%, MAPosHoriz%% - 1) <= NextInventory%% THEN
                                            IF Stadion%%(1, MAPosVert%%, MAPosHoriz%% - 1) = 0 OR Stadion%%(1, MAPosVert%%, MAPosHoriz%% - 1) = 1 THEN
                                                IF MoveSounds%% THEN _SNDPLAY SonsDuRoyaume&(4)
                                                Stadion%%(1, MAPosVert%%, MAPosHoriz%% - 1) = Stadion%%(1, MAPosVert%%, MAPosHoriz%% - 1) + 1
                                            ELSEIF MAPosHoriz%% >= 3 THEN
                                                IF Stadion%%(0, MAPosVert%%, MAPosHoriz%% - 2) = 0 THEN
                                                    CALL MoveMirror(0, MAPosVert%%, MAPosHoriz%%)
                                                    IF MoveSounds%% THEN _SNDPLAY SonsDuRoyaume&(6)
                                                END IF
                                            END IF
                                            CALL REDDIM(BeamGrid%%())
                                        END IF
                                    ELSEIF fkey%%(KK$) = 19 AND Stadion%%(0, MAPosVert%%, MAPosHoriz%% + 1) = 12 AND CanPush%% THEN
                                        'Mirrors
                                        IF Stadion%%(2, MAPosVert%%, MAPosHoriz%% + 1) <= NextInventory%% THEN
                                            IF Stadion%%(1, MAPosVert%%, MAPosHoriz%% + 1) = 2 OR Stadion%%(1, MAPosVert%%, MAPosHoriz%% + 1) = 3 THEN
                                                IF MoveSounds%% THEN _SNDPLAY SonsDuRoyaume&(4)
                                                Stadion%%(1, MAPosVert%%, MAPosHoriz%% + 1) = Stadion%%(1, MAPosVert%%, MAPosHoriz%% + 1) + 1
                                                IF Stadion%%(1, MAPosVert%%, MAPosHoriz%% + 1) > 3 THEN Stadion%%(1, MAPosVert%%, MAPosHoriz%% + 1) = 0
                                            ELSEIF MAPosHoriz%% <= 22 THEN
                                                IF Stadion%%(0, MAPosVert%%, MAPosHoriz%% + 2) = 0 THEN
                                                    CALL MoveMirror(2, MAPosVert%%, MAPosHoriz%%)
                                                    IF MoveSounds%% THEN _SNDPLAY SonsDuRoyaume&(6)
                                                END IF
                                            END IF
                                            CALL REDDIM(BeamGrid%%())
                                        END IF
                                    ELSEIF fkey%%(KK$) = 14 AND MAPosVert%% >= 3 AND Stadion%%(0, MAPosVert%% - 1, MAPosHoriz%%) = 13 AND CanPush%% THEN
                                        'Haystacks
                                        IF Stadion%%(0, MAPosVert%% - 2, MAPosHoriz%%) = 0 THEN
                                            IF BeamGrid%%(MAPosVert%% - 2, MAPosHoriz%%) <> 0 THEN CALL REDDIM(BeamGrid%%())
                                            CALL MoveHaystack(1, MAPosVert%%, MAPosHoriz%%)
                                            IF MoveSounds%% THEN _SNDPLAY SonsDuRoyaume&(5)
                                        END IF
                                    ELSEIF fkey%%(KK$) = 22 AND MAPosVert%% <= 13 AND Stadion%%(0, MAPosVert%% + 1, MAPosHoriz%%) = 13 AND CanPush%% THEN
                                        'Haystacks
                                        IF Stadion%%(0, MAPosVert%% + 2, MAPosHoriz%%) = 0 THEN
                                            IF BeamGrid%%(MAPosVert%% + 2, MAPosHoriz%%) <> 0 THEN CALL REDDIM(BeamGrid%%())
                                            CALL MoveHaystack(3, MAPosVert%%, MAPosHoriz%%)
                                            IF MoveSounds%% THEN _SNDPLAY SonsDuRoyaume&(5)
                                        END IF
                                    ELSEIF fkey%%(KK$) = 17 AND MAPosHoriz%% >= 3 AND Stadion%%(0, MAPosVert%%, MAPosHoriz%% - 1) = 13 AND CanPush%% THEN
                                        'Haystacks
                                        IF Stadion%%(0, MAPosVert%%, MAPosHoriz%% - 2) = 0 THEN
                                            IF BeamGrid%%(MAPosVert%%, MAPosHoriz%% - 2) <> 0 THEN CALL REDDIM(BeamGrid%%())
                                            CALL MoveHaystack(0, MAPosVert%%, MAPosHoriz%%)
                                            IF MoveSounds%% THEN _SNDPLAY SonsDuRoyaume&(5)
                                        END IF
                                    ELSEIF fkey%%(KK$) = 19 AND MAPosHoriz%% <= 22 AND Stadion%%(0, MAPosVert%%, MAPosHoriz%% + 1) = 13 AND CanPush%% THEN
                                        'Haystacks
                                        IF Stadion%%(0, MAPosVert%%, MAPosHoriz%% + 2) = 0 THEN
                                            IF BeamGrid%%(MAPosVert%%, MAPosHoriz%% + 2) <> 0 THEN CALL REDDIM(BeamGrid%%())
                                            CALL MoveHaystack(2, MAPosVert%%, MAPosHoriz%%)
                                            IF MoveSounds%% THEN _SNDPLAY SonsDuRoyaume&(5)
                                        END IF
                                    END IF
                                END IF
                            END IF
                    END SELECT
                END IF
            END IF
        END IF
        IF Stadion%%(0, 7, 20) = 0 AND Stadion%%(0, 8, 19) = 0 AND Stadion%%(0, 8, 21) = 0 AND Stadion%%(0, 9, 20) = 0 THEN NoTenIsReady%% = True

        _DISPLAY

    WEND
WEND

'Default
'NextInventory%% = 1
'MoveSounds%% = True
'LazyBeam%% = False

OPEN "smokesdat.dat" FOR OUTPUT AS #1
PRINT #1, MoveSounds%%
PRINT #1, LazyBeam%%
CLOSE #1

SYSTEM

FUNCTION fkey%% (strKey$)
    IF ASC(strKey$) <> 0 THEN
        fkey%% = 0
    ELSE
        fkey%% = ASC(RIGHT$(strKey$, 1)) - 58
    END IF
END FUNCTION

SUB NextInv
    IF Freddie%% THEN
        _SNDPLAY InvSound&(NextInventory%%)
    ELSE
        _SNDPLAY SonsDuRoyaume&(8)
    END IF
    'Save Game
    OPEN "game" + LTRIM$(STR$(NextInventory%%)) + ".dat" FOR OUTPUT AS #2
    FOR K%% = 0 TO 2
        FOR N%% = 1 TO 15
            FOR M%% = 1 TO 24
                PRINT #2, Stadion%%(K%%, N%%, M%%);
            NEXT M%%
            PRINT #2, ""
        NEXT N%%
    NEXT K%%
    PRINT #2, MAPosVert%%
    PRINT #2, MAPosHoriz%%
    CLOSE #2
    NextInventory%% = NextInventory%% + 1
END SUB

SUB MoveMarie (Finger%%, Vert%%, Horiz%%)
    Vert%% = Vert%% + Orient%%(0, Finger%%)
    Horiz%% = Horiz%% + Orient%%(1, Finger%%)
    Stadion%%(0, Vert%%, Horiz%%) = 0
    'Above is required to zero cells when inventory is taken
END SUB

SUB MoveHaystack (Finger%%, Vert%%, Horiz%%)
    Vert%% = Vert%% + Orient%%(0, Finger%%)
    Horiz%% = Horiz%% + Orient%%(1, Finger%%)
    Stadion%%(0, Vert%% + Orient%%(0, Finger%%), Horiz%% + Orient%%(1, Finger%%)) = 13
    Stadion%%(0, Vert%%, Horiz%%) = 0
END SUB

SUB MoveMirror (Finger%%, Vert%%, Horiz%%)
    Vert%% = Vert%% + Orient%%(0, Finger%%)
    Horiz%% = Horiz%% + Orient%%(1, Finger%%)
    FOR M%% = 0 TO 2
        Stadion%%(M%%, Vert%% + Orient%%(0, Finger%%), Horiz%% + Orient%%(1, Finger%%)) = Stadion%%(M%%, Vert%%, Horiz%%)
    NEXT M%%
    Stadion%%(0, Vert%%, Horiz%%) = 0
END SUB

FUNCTION HardwareImage& (ImageName&)
    HardwareImage& = _COPYIMAGE(ImageName&, 33)
    _FREEIMAGE ImageName&
END FUNCTION

SUB Spiegel (Kappa%%)
    X1%% = 23: Y1%% = 23
    FOR K%% = 0 TO 2
        IF Kappa%% = 0 THEN
            LINE (X1%% - 16 - K%%, Y1%% - 15)-(X1%% + 15, Y1%% + 16 + K%%), _RGB32(100, 255, 255)
            LINE (X1%% - 21 - K%%, Y1%% - 17)-(X1%% + 17, Y1%% + 21 + K%%), _RGB32(169, 169, 169)
        ELSEIF Kappa%% = 1 THEN
            LINE (X1%% + 15, Y1%% - 16 - K%%)-(X1%% - 16 - K%%, Y1%% + 15), _RGB32(100, 255, 255)
            LINE (X1%% + 17, Y1%% - 21 - K%%)-(X1%% - 21 - K%%, Y1%% + 17), _RGB32(169, 169, 169)
        ELSEIF Kappa%% = 2 THEN
            LINE (X1%% + 16 + K%%, Y1%% + 15)-(X1%% - 15, Y1%% - 16 - K%%), _RGB32(100, 255, 255)
            LINE (X1%% + 21 + K%%, Y1%% + 17)-(X1%% - 17, Y1%% - 21 - K%%), _RGB32(169, 169, 169)
        ELSE
            LINE (X1%% - 15, Y1%% + 16 + K%%)-(X1%% + 16 + K%%, Y1%% - 15), _RGB32(100, 255, 255)
            LINE (X1%% - 17, Y1%% + 21 + K%%)-(X1%% + 21 + K%%, Y1%% - 17), _RGB32(169, 169, 169)
        END IF
    NEXT K%%
    IF Kappa%% = 0 THEN
        LINE (X1%% - 23, Y1%% + 3)-(X1%% - 3, Y1%% + 23), _RGB32(169, 169, 169), BF
    ELSEIF Kappa%% = 1 THEN
        LINE (X1%% - 3, Y1%% - 23)-(X1%% - 23, Y1%% - 3), _RGB32(169, 169, 169), BF
    ELSEIF Kappa%% = 2 THEN
        LINE (X1%% + 23, Y1%% - 3)-(X1%% + 3, Y1%% - 23), _RGB32(169, 169, 169), BF
    ELSE
        LINE (X1%% + 3, Y1%% + 23)-(X1%% + 23, Y1%% + 3), _RGB32(169, 169, 169), BF
    END IF
    FOR K%% = 0 TO 18
        IF Kappa%% = 0 THEN
            LINE (X1%% - 23, Y1%% - 16 + K%%)-(X1%% + 16 - K%%, Y1%% + 23), _RGB32(169, 169, 169)
        ELSEIF Kappa%% = 1 THEN
            LINE (X1%% + 16 - K%%, Y1%% - 23)-(X1%% - 23, Y1%% + 16 - K%%), _RGB32(169, 169, 169)
        ELSEIF Kappa%% = 2 THEN
            LINE (X1%% + 23, Y1%% + 16 - K%%)-(X1%% - 16 + K%%, Y1%% - 23), _RGB32(169, 169, 169)
        ELSE
            LINE (X1%% - 16 + K%%, Y1%% + 23)-(X1%% + 23, Y1%% - 16 + K%%), _RGB32(169, 169, 169)
        END IF
    NEXT K%%
END SUB

SUB REDDIM (Arr%%())
    FOR N%% = 1 TO 15
        FOR M%% = 1 TO 24
            Arr%%(N%%, M%%) = 0
        NEXT M%%
    NEXT N%%
    BeamPosVert%% = 14
    BeamPosHoriz%% = 23
    LaserDir%% = 0
    LaserSearch%% = True
    MoreBeams%% = True
END SUB
Reply


Forum Jump:


Users browsing this thread: