TGC Codebase Backup



Game selector! by Madkiller Max

5th Feb 2009 19:55
Summary

It can select a game you want plus you can add to it!if you would like to use this code please say something that make me connected to this part of the program!



Description

Hey do this for a little fun.It can select a game you want plus you can add to it!Make it your best fun program since you started your programing!Hey and all you cheapo Darkbasic pro writers.BACK OFF.Im too awsome for YOU!



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    REMSTART
property of www.thegameruler.us and the creator Madkiller Max
can always find me on steam as [MK] Madkiller Max (GOOGLE ME)
if you would like to use this code please say something that makes me connected to this part of the program
REMEND

REM Project: Game Select
REM Created: 2/2/2009 4:50:42 PM
REM Author Madkiller Max
REM ***** Main Source File *****
REM IM AWSOME PEOLPE
Anyone as string
Hello as string
Play as string
Admin as string
Game as integer

cls rgb (100,0,0)
set cursor 130,200
print "Just say Quit any time and you will quit the program"
wait 2000

cls rgb (0,150,200)

text 215,200, "Is"
wait 1500
text 215,215, "anyone"
wait 1500
set cursor 215,230,
Input "there? ", Anyone

IF Anyone = "Quit" or Hello = "Quit" or Play = "Quit" or Admin = "Quit"
   cls rgb (100,0,0)
   Text 200,200,"Very well come back later if you want! "
   Text 200,215,"Hit any key to Terminate Program. "
   wait key
   end
ENDIF

remstart
here is a command for them to talk
remend
If anyone = "Yes" or anyone = "yes" or anyone = "yeah" or anyone = "Yeah"
   cls rgb (100,150,200)
   set cursor 200,200,
   Input "Hello ", Hello
else
   cls rgb (255,0,0)
   text 200,200, "Im sorry but we are going to have to terminate you. "
   text 200,215,"Hit any key to Terminate Program. "
   wait key
   end
endif

IF Anyone = "Quit" or Hello = "Quit" or Play = "Quit" or Admin = "Quit"
   cls rgb (100,0,0)
   Text 200,200,"Very well come back later if you want! "
   Text 200,215,"Hit any key to Terminate Program. "
   wait key
   end
ENDIF

remstart
here is a command for them to talk
remend
If hello = "Hello" or hello = "hello" or hello = "Hi" or hello = "hi"
   wait 300
   set cursor 200,215,
   Input "Would you like to play a game? ", Play
else
   cls rgb (255,0,0)
   text 200,200, "Im sorry but we are going to have to terminate you. "
   text 200,215,"Hit any key to Terminate Program. "
   wait key
   end
endif

IF Anyone = "Quit" or Hello = "Quit" or Play = "Quit" or Admin = "Quit"
   cls rgb (100,0,0)
   Text 200,200,"Very well come back later if you want! "
   Text 200,215,"Hit any key to Terminate Program. "
   wait key
   end
ENDIF

remstart
here is a command for them to talk
remend
If Play = "Yes" or Play = "yes" or Play = "Yeah" or Play = "yeah"
   set cursor 200,230,
   Input "Are you Administrator? ", Admin
else
   cls rgb (255,0,0)
   text 200,200, "Im sorry but we are going to have to terminate you. "
   text 200,215,"Hit any key to Terminate Program. "
   wait key
   end
endif

IF Anyone = "Quit" or Hello = "Quit" or Play = "Quit" or Admin = "Quit"
   cls rgb (100,0,0)
   Text 200,200,"Very well come back later if you want! "
   Text 200,215,"Hit any key to Terminate Program. "
   wait key
   end
ENDIF

remstart
here is a command for them to talk
remend
cls rgb (100,150,200)
if Admin = "Yes" or admin = "yes" or admin = "yeah" or admin = "Yeah"
   `edit this and put in other games!!!`
   Text 100,100,"0) Exit Program"
   text 100,115,"1) Slot Machine"
   text 100,130,"2) Rock, Paper, Scissors!"
   set cursor 100,160,
   input "Select Game Number: ", game
else
   cls rgb (255,0,0)
   text 200,200, "Im sorry but we are going to have to terminate you. "
   text 200,215,"Hit any key to Terminate Program. "
   wait key
   end
endif
cls rgb (100,150,200)

If Game = 0
   cls rgb (100,0,0)
   Text 200,200,"Very well come back later if you want! "
   Text 200,215,"Hit any key to Terminate Program. "
   wait key
   end
endif
If Game = 1
   text 200,200, "Welcome to Slot Machine!"
   text 200,215, "Press any key to continue."
   wait key `this is where slot machine starts

`Assign ten dollars to the player's account
AccountBalance = 10

CLS RGB(255, 255, 255)  `Set background color to white

SET TEXT FONT "Arial"  `Set the font type to Arial
SET TEXT SIZE 48  `Set the font size to 48 points

ForegroundColor = RGB(0, 0, 160)      `Set foreground color to blue
BackgroundColor = RGB(255, 255, 255)  `Set background color to white
INK ForegroundColor, BackgroundColor  `Apply color settings

CENTER TEXT 320, 150, "Welcome to The"  `Display welcome message
CENTER TEXT 320, 220, "Slot Machine Game"
SET TEXT SIZE 18  `Set the font size to 18 points
CENTER TEXT 320, 380, "Press any key to continue."  `Display instructions

WAIT KEY  `Pause game play until the player presses a keyboard key

CLS RGB(255, 255, 255)  `Set background color to white

SET TEXT SIZE 24  `Set the font size to 24 points
TEXT 100, 120, "Instructions:"
TEXT 100, 160, "Press any key to place a bet."
TEXT 100, 190, "3 of a kind adds 2 dollars to your account"
TEXT 100, 220, "2 of a kind adds 1 dollar to your account"
TEXT 100, 250, "No matches subtracts 3 dollars from your account"
SET TEXT SIZE 18 `Set the font size to 18 points
CENTER TEXT 320, 380, "Press any key to continue"  `Display instructions

WAIT KEY  `Pause game play until the player presses a keyboard key

DO  `Loop forever

  FOR i = 1 TO 19  `Iterate nineteen times

    ForegroundColor = RGB(0, 0, 160)      `Set foreground color to blue
    BackgroundColor = RGB(255, 255, 255)  `Set background color to white
    INK ForegroundColor, BackgroundColor  `Apply color settings

    CLS RGB(255, 255, 255)  `Set background color to white

    SET TEXT SIZE 36  `Set the font size to 36 points
    CENTER TEXT 320, 90, "___________________________"
    SET TEXT SIZE 72  `Set the font size to 72 points

    `Display random numbers representing slot machines dials
    CENTER TEXT 320, 150, STR$(RND(2) + 1) + "       " + STR$(RND(2) + 1) + "       " + STR$(RND(2) + 1)

    SET TEXT SIZE 36  `Set the font size to 36 points
    CENTER TEXT 320, 210, "___________________________"
    SLEEP 200  `Pause game executed for a fifth of a second

  NEXT

  SET TEXT SIZE 72  `Set the font size to 72 points
  CLS RGB(255, 255, 255)  `Set background color to white

  `Generate the final set of numbers representing dial values
  DialOne = RND(2) + 1
  DialTwo = RND(2) + 1
  DialThree = RND(2) + 1

  SET TEXT SIZE 36  `Set the font size to 36 points
  CENTER TEXT 320, 90, "___________________________"
  SET TEXT SIZE 72  `Set the font size to 72 points

  `Display random numbers representing slot machines dials
  CENTER TEXT 320, 150, STR$(DialOne) + "       " +  STR$(DialTwo)   + "       " + STR$(DialThree)

  SET TEXT SIZE 36  `Set the font size to 36 points
  CENTER TEXT 320, 210, "___________________________"


  `Add up the final result for each dial
  Result = DialOne + DialTwo + DialThree

  SET TEXT SIZE 36  `Set the font size to 36 points

  `Look for a jackpot made up of 3 ones or 3 threes
  IF (Result = 3) OR (Result = 9)
    CENTER TEXT 320, 260, "Three of a kind - Jackpot!"
    'Add 2 dollars to the player's account
    AccountBalance = AccountBalance + 2
  ENDIF

  IF Result = 6  `Look for a jackpot made up of 3 twos
    IF DialOne = DialTwo 'There are 3 twos
      CENTER TEXT 320, 260, "Three of a kind - Jackpot!"
      `Add 2 dollars to the player's account
      AccountBalance = AccountBalance + 2
    ELSE  `Look to see if a one, two and three were generated
      CENTER TEXT 320, 260, "No matches - You Lose!"
      `Subtract 3 dollars from the player's account
      AccountBalance = AccountBalance - 3
    ENDIF
  ENDIF

  `Anything other than 3, 6, or 9 means a pair was generated
  IF (Result <> 3) AND (Result <> 6) AND (Result <> 9)
    CENTER TEXT 320, 260, "Two of a kind - Winner!"
    `Add 1 dollar to the player's account
    AccountBalance = AccountBalance + 1
  ENDIF

  SET TEXT SIZE 24  `Set the font size to 24 points
  `Display the player account balance
  TEXT 75, 30, "Account Balance: " + STR$(AccountBalance)
  SET TEXT SIZE 18  `Set the font size to 18 points
  `Display instructions for continuing
  CENTER TEXT 320, 420, "Press Escape to quit or any other to continue."

  `End game play of the player has gone broke
  IF AccountBalance <= 0

    SET TEXT SIZE 24  `Set the font size to 36 points

    ForegroundColor = RGB(255, 0, 0)      `Set foreground color to blue
    BackgroundColor = RGB(255, 255, 255)  `Set background color to white
    INK ForegroundColor, BackgroundColor  `Apply color settings

    `Notify the player that the game is over
    CENTER TEXT 320, 310, "G A M E   O V E R"
    CENTER TEXT 320, 350, "You have gone broke!"

    WAIT KEY  `Pause game play until the player presses a keyboard key

    EXIT  `Terminate the loop

  ENDIF

  WAIT KEY  `Pause game play until the player presses a keyboard key

LOOP

CLS RGB(255, 255, 255)  `Set background color to white

ForegroundColor = RGB(0, 0, 160)      `Set foreground color to blue
INK ForegroundColor, BackgroundColor  `Apply color settings

SET TEXT SIZE 24  `Set the font size to 24 points

`Display the game's closing message
CENTER TEXT 320, 150, "Thanks for playing the Slot Machine Game!"
SET TEXT SIZE 16  `Set the font size to 24 points
CENTER TEXT 320, 240, "Developed by Jerry Lee Ford, Jr."
CENTER TEXT 320, 260, "Copyright 2008"
CENTER TEXT 320, 280, "http://www.tech-publshing.com"

SET TEXT SIZE 18  `Set the font size to 16 points
CENTER TEXT 320, 380, "Press any key to end game."

WAIT KEY  `Pause game play until the player presses a keyboard key
end `this is where slot machine ends
endif
If Game = 2
   Text 200,200, "Welcome to Rock, Paper, Scissors!"
   SET TEXT SIZE 18
   CENTER TEXT 340,215, "Press any key to continue."
   WAIT KEY
CLS RGB(255, 255, 255)

ForegroundColor = RGB(0, 0, 160)      `Set foreground color to blue
BackgroundColor = RGB(255, 255, 255)  `Set background color to white
INK ForegroundColor, BackgroundColor  `Apply color settings

SET TEXT FONT "Arial"  `Set the font type to Arial
SET TEXT SIZE 48  `Set the font size to 48 points
CENTER TEXT 300, 150, "Welcome to The"  `Display welcome message
CENTER TEXT 300, 220, "Rock, Paper, Scissors Game"
SET TEXT SIZE 18  `Set the font size to 18 points
CENTER TEXT 400, 380, "Press any key to continue."  `Display instructions
WAIT KEY  `Wait until the player presses a keyboard key

DO  `Loop forever

  SET TEXT SIZE 24  `Set the font size to 24 points

  CLS RGB(255, 255, 255)  `Set background color to white

  PRINT : PRINT : PRINT : PRINT : PRINT : PRINT  `Write six blank lines

  `Prompt the player to make a guess
  INPUT "          Enter a move (Rock, Paper, Scissors): ", Move$

  PlayerM$ = UPPER$(Move$)  `Convert player move to uppercase characters

  `Only accept valid moves
  IF PlayerM$ = "ROCK" OR PlayerM$ = "PAPER" OR PlayerM$ = "SCISSORS"

    `Generate a set and use it to retrieve a random number from 1 to 3
    seed = TIMER() :  RANDOMIZE seed :  RandomNo = RND(3)

    `Equate the random number to a computer move
    IF RandomNo = 1 THEN ComputerM$ = "ROCK"
    IF RandomNo = 2 THEN ComputerM$ = "PAPER"
    IF RandomNo = 3 THEN ComputerM$ = "SCISSORS"

    `Analyze the player and computert's moves and determine results
    IF PlayerM$ = "ROCK"
      IF ComputerM$ = "ROCK" THEN Result$ = "Tie!"
      IF ComputerM$ = "PAPER" THEN Result$ = "Computer wins!"
      IF ComputerM$ = "SCISSORS" THEN Result$ = "Player wins!"
    ENDIF

    IF PlayerM$ = "PAPER"
      IF ComputerM$ = "ROCK" THEN Result$ = "Player wins!"
      IF ComputerM$ = "PAPER" THEN Result$ = "Tie!"
      IF ComputerM$ = "SCISSORS" THEN Result$ = "Computer wins!"
    ENDIF

    IF PlayerM$ = "SCISSORS"
      IF ComputerM$ = "ROCK" THEN Result$ = "Computer wins!"
      IF ComputerM$ = "PAPER" THEN Result$ = "Player wins!"
      IF ComputerM$ = "SCISSORS" THEN Result$ = "Tie!"
    ENDIF

    CLS RGB(255, 255, 255)  `Set background color to white

    SET TEXT SIZE 36  `Set the font size to 36 points
    TEXT 270, 130, "Game Results:"
    TEXT 270, 160, "---------------------------"
    SET TEXT SIZE 24  `Set the font size to 24 points
    TEXT 270, 200, "Player move:      " + PlayerM$
    TEXT 270, 230, "Computer move: " + ComputerM$
    TEXT 270, 260, "Result:                " + Result$
    SET TEXT SIZE 18  `Set the font size to 18 points
    TEXT 270, 420, "Press Escape to quit or any other to play again."

    WAIT KEY  `Wait until the player presses a keyboard key

  ENDIF

loop
endif

wait key
end