home *** CD-ROM | disk | FTP | other *** search
- Safegame:
- local NoOfPlayers 0
- local QuestionNo 0
- local QuestionList "Wgame\Questions.flc"
- Local CurrPlayerNo 1
- Local QuestionAnswer A
- Local DiceNo 0
- Local PlayerMaskLoaded @FALSE
- Local PlayerPieceDirection R
-
- mark 1 4
- local PlayerPos$chr(@Loop) 1
- loop
-
- Local CurrPlayerPos 1
- Local NoOfSquares 35
- Local ExitWaterGame @FALSE
-
- set ResetMemDisplay @TRUE
-
- cload Wgame\Play1$@PlayerPieceDirection$.pcx playerPiece 1
- Local PieceX PlayerPiece->Xsize PieceY Playerpiece->YSize
- cfree Playerpiece
-
- pfade 0 "wgame\safegame.pcx"
- spread @blackpic "wgame\safegame.pcx" 15
- pfree "wgame\safegame.pcx"
- pfree @Blackpic
- Tran on 2
-
- ;DataBegin GameGrid
- ; mark 1 35
- ; set x1 @ y1 @ t1 @ t2 @
- ; box @x1 @y1 @t1 @t2
- ; pgetbuf ans @x1 @y1 @t1 @t2 1
- ; psave Square$@loop$.pic ans
- ; putup @x1-3 @y1-3 PlayerPiece
- ; cfree ans
- ; loop
- ;waitkey
-
-
- gosub SelectNoOfPlayers
- gosub PlayerGo 1
-
- SafeGameLoop:
- if @DisplayMemoryOn==@TRUE
- call MemDisp MemoryDisplay
- endif
-
- getmouse MBut Mx1 My1 0
-
- if @ExitWaterGame==@TRUE
- goto ExitGame
- endif
-
- ifkey ESC ExitGame
- if @Mbut==1&&@Mx1>=5&&@My1>=3&&@Mx1<=120&&@My1<=46
- goto ExitGame
- endif
-
- if @Mbut==1&&@Mx1>=192&&@Mx1<=449&&@My1>=37&&@My1<=102
- if @PlayerMaskLoaded==@TRUE
- Putup 192 37 PlayerGoMask
- cfree PlayerGoMask
- set PlayerMaskLoaded @FALSE
-
- Set QuestionNo random(1,70)
-
- cgetbuf QuestionMask 92 199 387 390 1
- Position QuestionMask 0 0
-
- dload @QuestionList, , 1
- putdff @QuestionList 1,0,@QuestionNo-1, 92 199
- dfree @QuestionList
-
- Databegin GameAnswers
- DataSkip (@QuestionNo*2)-2
- Set QuestionNo @
- Set QuestionAnswer @
- endif
- endif
-
- if @Mbut==1&&@Mx1>=117&&@Mx1<=360&&@My1>=282&&@My1<=303
- if @PlayerMaskLoaded==@FALSE
- If @QuestionAnswer==A
- gosub CorrectAnswer
- else
- gosub WrongAnswer
- endif
- endif
- endif
- if @Mbut==1&&@Mx1>=117&&@Mx1<=360&&@My1>=249&&@My1<=270
- if @PlayerMaskLoaded==@FALSE
- If @QuestionAnswer==B
- gosub CorrectAnswer
- else
- gosub WrongAnswer
- endif
- endif
- endif
- if @Mbut==1&&@Mx1>=117&&@Mx1<=360&&@My1>=216&&@My1<=235
- If @QuestionAnswer==C
- gosub CorrectAnswer
- else
- gosub WrongAnswer
- endif
- endif
- if @CurrPlayerPos==@NoOfSquares
- gosub Finished
- endif
- if @ExitWaterGame==@TRUE
- goto ExitGame
- endif
- goto SafeGameLoop
- return
-
- SelectNoOfPlayers:
- cload index\select NumPlayers 1
- putup 92 199 NumPlayers
- cfree NumPlayers
-
- Selectloop:
- GetMouse Mbut Mx1 My1 0
- if @Mbut==1&&@Mx1>=5&&@My1>=3&&@Mx1<=120&&@My1<=46
- set ExitWaterGame @TRUE
- goto ExitNoOfPlayers
- endif
- ifkey ESC
- set ExitWaterGame @TRUE
- goto ExitNoOfPlayers
- endif
- if @Mbut==1&&@Mx1>=132&&@Mx1<=173&&@My1>=248&&@My1<=283
- Set NoOfPlayers 1
- goto ExitNoOfPlayers
- endif
- if @Mbut==1&&@Mx1>=185&&@Mx1<=227&&@My1>=248&&@My1<=283
- Set NoOfPlayers 2
- goto ExitNoOfPlayers
- endif
- if @Mbut==1&&@Mx1>=243&&@Mx1<=284&&@My1>=248&&@My1<=283
- Set NoOfPlayers 3
- goto ExitNoOfPlayers
- endif
- if @Mbut==1&&@Mx1>=298&&@Mx1<=338&&@My1>=248&&@My1<=283
- Set NoOfPlayers 4
- goto ExitNoOfPlayers
- endif
-
-
-
- goto SelectLoop
-
- ExitNoOfPlayers:
- Pfade 0 wgame\safegame.pcx
- pfree wgame\safegame.pcx
- return
-
- ExitGame:
- if @PlayerMaskLoaded==@TRUE
- cfree PlayerGoMask
- endif
-
- spread "wgame\safegame.pcx" @blackpic 15
- exit
-
- Nextplayer:
- set PlayerPos$chr(@CurrPlayerNo) @CurrPlayerPos
-
- if @CurrPlayerNo<@NoOfPlayers
- set CurrPlayerNo @CurrPlayerNo+1
- else
- set CurrPlayerNo 1
- endif
- return
-
- WrongAnswer:
- Putup 92 199 QuestionMask
- Cfree QuestionMask
- If @AudioSupport=="SoundBlaster"
- @Sbdisk Play "Wave\no.voc"
- endif
- gosub NextPlayer
- gosub PlayerGo @CurrPlayerNo
- return
-
- CorrectAnswer:
- local DiceFrames 0
- local OldPos 0
- local Sx1 0 Sy1 0 Sx2 0 Sy2 0 Ex1 0 Ey1 0 Ex2 0 Ey2 0
-
- If @AudioSupport=="SoundBlaster"
- @Sbdisk Play "Wave\weldonef.voc"
- endif
-
- Putup 92 199 QuestionMask
- Cfree QuestionMask
-
- dload "index\diceanti.flc" dice 1
- set DiceNo random(1,6)
- ; set DiceNo 35
- putdff Dice 5,0,36, 456 305
-
- if @DiceNo==1
- set diceFrames 1
- endif
- if @DiceNo==2
- set diceFrames 7
- endif
- if @DiceNo==3
- set diceFrames 13
- endif
- if @DiceNo==4
- set diceFrames 31
- endif
- if @DiceNo==5
- set diceFrames 25
- endif
- if @DiceNo==6
- set diceFrames 19
- endif
- putdff Dice 5,0,@DiceFrames, 456 305
- Dfree Dice
-
- databegin GameGrid
- dataSkip ((@CurrPlayerPos*5)-5)
- Set Sx1 @-3 Sy1 @-3 Sx2 @ Sy2 @
- Set PlayerPieceDirection @
-
- set OldPos @CurrPlayerPos
-
- Set CurrPlayerPos (@CurrPlayerPos+@DiceNo)
- if @CurrPlayerPos>@NoOfSquares
- set CurrPlayerPos @NoOfSquares
- endif
-
- gosub FreeSquare
-
- mark @oldpos @CurrPlayerPos-1
- Set Ex1 @-3 Ey1 @-3 Ex2 @ Ey2 @
- Set PlayerPieceDirection @
- if @Loop==@OldPos
- mark 1 @NoOfPlayers
- if @OldPos==@(PlayerPos$chr(@Loop))&&@CurrPlayerNo<>@Loop
- cload wgame\play$@loop$@PlayerPieceDirection$.pcx tpiece 1
- Putup @Sx1 @Sy1 tpiece
- cfree tpiece
- break Found
- endif
- loop
- found:
- endif
-
- timer
- cload wgame\play$@CurrPlayerNo$@PlayerPieceDirection$.pcx PlayerPiece 1
- float @Sx1 @Sy1 @Ex1 @Ey1 4 5 PlayerPiece
- EndFloat
- Set Sx1 @Ex1 Sy1 @Ey1
- loop
- timer
- PutUp @Ex1 @Ey1 PlayerPiece
- cfree PlayerPiece
- waitkey 50
-
- if @CurrPlayerPos<@NoOfSquares
- gosub NextPlayer
- gosub PlayerGo @CurrPlayerNo
- endif
-
- Return
-
-
-
- PlayerGo:
- local Sx1 0 Sy1 0 Sx2 0 Sy2 0
-
- cload wgame\play$@CurrPlayerNo$go.pcx Play 1
- cgetBuf PlayerGoMask 192 37 (Play->xsize+192) (Play->ysize+37)
- Position PlayerGoMask 0 0
- set PlayerMaskLoaded @TRUE
-
- putup 192 37 Play
- cfree Play
-
- set CurrPlayerPos @(PlayerPos$chr(@CurrPlayerNo))
-
-
- databegin GameGrid
- dataSkip ((@CurrPlayerPos*5)-5)
- Set Sx1 @-3 Sy1 @-3 Sx2 @ Sy2 @
- Set PlayerPieceDirection @
-
- cload wgame\play$@1$@PlayerPieceDirection$.pcx PlayerPiece 1
- PutUp @Sx1 @Sy1 PlayerPiece
- cfree PlayerPiece
- return
-
-
-
- FreeSquare:
- local Sx1 0 Sy1 0 Sx2 0 Sy2 0
- databegin GameGrid
-
- dataSkip ((@OldPos*5)-5)
- Set Sx1 @ Sy1 @ Sx2 @ Sy2 @
- Set PlayerPieceDirection @
-
- cload wgame\$Square$@OldPos$.pic SqMask 1
- position SqMask 0 0
- Putup @Sx1 @Sy1 SqMask
- cfree SqMask
- return
-
- Finished:
- local StartSub 0
- MOUSE POSITION 182 224
- If @AudioSupport=="SoundBlaster"
- @Sbdisk Play "Wave\cheer.voc"
- endif
- if @CurrPlayerNo==1
- dload "wgame\BlueSub.flc" ,Sub, 1
- local EndSub Sub->frames-1
- endif
- if @CurrPlayerNo==2
- dload "wgame\yeloSub.flc" ,Sub, 1
- local EndSub Sub->frames-1
- endif
- if @CurrPlayerNo==3
- dload "wgame\RedSub.flc" ,Sub, 1
- local EndSub Sub->frames-1
- endif
- if @CurrPlayerNo==4
- dload "wgame\GreenSub.flc" ,Sub, 1
- local EndSub Sub->frames-1
- endif
- Timer
- set Mbut 0 Mx1 0 My1 0
- Finishloop:
-
- ifkey ESC FinishExit
- if @Mbut==1&&@Mx1>=5&&@My1>=3&&@Mx1<=120&&@My1<=46
- goto FinishExit
- endif
-
- if @Mbut==1&&@Mx1>=132&&@Mx1<=390&&@My1>=224&&@My1<=265
- gosub ResetGame
- goto FinishContinue
- endif
-
- if @elapsed>50
- putdff Sub 0,@StartSub,@StartSub, 92 199
- Timer
- endif
-
- if @StartSub>@EndSub
- set StartSub 0
- else
- Set StartSub @StartSub+1
- endif
- getmouse Mbut Mx1 My1 0
- goto FinishLoop
-
- FinishExit:
- set ExitWaterGame @TRUE
- return
- FinishContinue:
- return
-
- ResetGame:
- mark 1 4
- set PlayerPos$chr(@Loop) 1
- loop
- set CurrPlayerPos 1
-
- Pfade 0 "wgame\safegame.pcx"
- pfree "wgame\safegame.pcx"
-
- gosub SelectNoOfPlayers
- gosub PlayerGo 1
- return
-
- GameAnswers:
- 1 B 2 C 3 A 4 B 5 A 6 B 7 C 8 A 9 B 10 A 11 A 12 B 13 C 14 B 15 A 16 A 17 A
- 18 B 19 A 20 C 21 C 22 B 23 A 24 B 25 C 26 A 27 B 28 C 29 B 30 A 31 C 32 B
- 33 C 34 B 35 B 36 C 37 A 38 B 39 B 40 C 41 B 42 A 43 A 44 B 45 C 46 A 47 B
- 48 C 49 B 50 A 51 C 52 C 53 A 54 B 55 C 56 B 57 B 58 C 59 A 60 C 61 B 62 C
- 63 B 64 A 65 C 66 B 67 C 68 B 69 B 70 A
- Dataend
-
- GameGrid:
- 501 19 570 78 R
- 570 19 626 78 R
- 570 79 626 129 R
- 570 130 626 187 L
- 515 130 570 187 L
- 460 130 515 187 L
- 404 130 460 187 L
- 349 130 404 187 L
- 294 130 349 187 L
- 239 130 294 187 L
-
- 184 130 238 187 L
- 127 130 183 187 L
- 72 130 125 187 L
- 15 130 71 187 L
- 15 188 71 237 L
- 15 238 71 293 L
- 15 294 71 350 L
- 15 351 71 400 L
- 15 401 71 460 R
- 72 401 126 460 R
-
- 126 401 181 460 R
- 181 401 236 460 R
- 236 401 291 460 R
- 291 401 346 460 R
- 346 401 400 460 R
- 400 401 456 460 R
- 400 345 456 400 R
- 400 293 456 344 R
- 400 238 454 293 R
- 455 238 509 293 R
-
- 509 238 564 293 R
- 564 238 619 293 R
- 563 294 619 346 R
- 563 347 619 401 R
- 500 403 619 455 L
- dataend