Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Graphics;
- using Microsoft.Xna.Framework.Input;
- using System;
- namespace Final_Project
- {
- /// <summary>
- /// This is the main type
- /// your game.
- /// </summary>
- public class Game1 : Game
- {
- GraphicsDeviceManager graphics;
- SpriteBatch spriteBatch;
- //Declaring all of the different screens
- Texture2D HomeScreen;
- Rectangle HomeScreenR;
- Texture2D Instructions;
- Rectangle InstructionsR;
- Texture2D BettingScreen;
- Rectangle BettingScreenR;
- Texture2D WheelScreen;
- Rectangle WheelScreenR;
- Texture2D FinalScreen;
- Rectangle FinalScreenR;
- SpriteFont Arial;
- Vector2 ArialV;
- Texture2D SpriteTexture;
- Vector2 origin;
- Vector2 screenpos;
- Vector2 DrawnV;
- //Rectangles for click Areas on Betting screen
- /* Might as well ignore this section. Just kept it as a backup
- Rectangle Click0;
- Rectangle Click1;
- Rectangle Click2;
- Rectangle Click3;
- Rectangle Click4;
- Rectangle Click5;
- Rectangle Click6;
- Rectangle Click7;
- Rectangle Click8;
- Rectangle Click9;
- Rectangle Click10;
- Rectangle Click11;
- Rectangle Click12;
- Rectangle Click13;
- Rectangle Click14;
- Rectangle Click16;
- Rectangle Click15;
- Rectangle Click17;
- Rectangle Click18;
- Rectangle Click19;
- Rectangle Click20;
- Rectangle Click21;
- Rectangle Click22;
- Rectangle Click23;
- Rectangle Click24;
- Rectangle Click25;
- Rectangle Click26;
- Rectangle Click27;
- Rectangle Click28;
- Rectangle Click29;
- Rectangle Click30;
- Rectangle Click31;
- Rectangle Click32;
- Rectangle Click33;
- Rectangle Click34;
- Rectangle Click35;
- Rectangle Click36;
- Rectangle ClickRed;
- Rectangle ClickBlack;
- Rectangle ClickEven;
- Rectangle ClickOdd;
- Rectangle Click118;
- Rectangle Click1936;
- Rectangle ClickRow1;
- Rectangle ClickRow2;
- Rectangle ClickRow3;
- Rectangle Click112;
- Rectangle Click1324;
- Rectangle Click2536;
- */
- MouseState prevMouseState;
- MouseState mouseState = Mouse.GetState();
- int AfterSpin;
- //Displays which number was drawn
- int DisplayNumber;
- //Set to realize when to reset bet amounts
- int SpinFinish;
- //Stops from choosing random number
- int SpinLock;
- int RandLock = 0;
- int CountSpin;
- //Displaying Current money
- int Balance = 500;
- //Chooses screen to switch too
- int Screen = 1;
- //Holds the number that was randomly chosen.
- int Drawn;
- //Saves Bet Amounts
- int Bet0;
- int Bet1;
- int Bet2;
- int Bet3;
- int Bet4;
- int Bet5;
- int Bet6;
- int Bet7;
- int Bet8;
- int Bet9;
- int Bet10;
- int Bet11;
- int Bet12;
- int Bet13;
- int Bet14;
- int Bet15;
- int Bet16;
- int Bet17;
- int Bet18;
- int Bet19;
- int Bet20;
- int Bet21;
- int Bet22;
- int Bet23;
- int Bet24;
- int Bet25;
- int Bet26;
- int Bet27;
- int Bet28;
- int Bet29;
- int Bet30;
- int Bet31;
- int Bet32;
- int Bet33;
- int Bet34;
- int Bet35;
- int Bet36;
- int BetRed;
- int BetBlack;
- int BetEven;
- int BetOdd;
- int Bet118;
- int Bet1936;
- int Bet112;
- int Bet1324;
- int Bet2536;
- int BetRow1;
- int BetRow2;
- int BetRow3;
- int Spin = 1;
- Rectangle Click0 = new Rectangle(5, 80, 62, 212);
- Rectangle Click1 = new Rectangle(65, 218, 54, 68);
- Rectangle Click2 = new Rectangle(65, 160, 54, 68);
- Rectangle Click3 = new Rectangle(65, 81, 54, 68);
- Rectangle Click4 = new Rectangle(122, 218, 54, 68);
- Rectangle Click5 = new Rectangle(122, 160, 54, 68);
- Rectangle Click6 = new Rectangle(122, 81, 54, 68);
- Rectangle Click7 = new Rectangle(179, 218, 54, 68);
- Rectangle Click8 = new Rectangle(179, 160, 54, 68);
- Rectangle Click9 = new Rectangle(179, 81, 54, 68);
- Rectangle Click10 = new Rectangle(236, 218, 54, 68);
- Rectangle Click11 = new Rectangle(236, 160, 54, 68);
- Rectangle Click12 = new Rectangle(236, 81, 54, 68);
- Rectangle Click13 = new Rectangle(293, 218, 54, 68);
- Rectangle Click14 = new Rectangle(293, 160, 54, 68);
- Rectangle Click15 = new Rectangle(293, 81, 54, 68);
- Rectangle Click16 = new Rectangle(350, 218, 54, 68);
- Rectangle Click17 = new Rectangle(350, 160, 54, 68);
- Rectangle Click18 = new Rectangle(350, 81, 54, 68);
- Rectangle Click19 = new Rectangle(407, 218, 54, 68);
- Rectangle Click20 = new Rectangle(407, 160, 54, 68);
- Rectangle Click21 = new Rectangle(407, 81, 54, 68);
- Rectangle Click22 = new Rectangle(464, 218, 54, 68);
- Rectangle Click23 = new Rectangle(464, 160, 54, 68);
- Rectangle Click24 = new Rectangle(464, 81, 54, 68);
- Rectangle Click25 = new Rectangle(521, 218, 54, 68);
- Rectangle Click26 = new Rectangle(521, 160, 54, 68);
- Rectangle Click27 = new Rectangle(521, 81, 54, 68);
- Rectangle Click28 = new Rectangle(578, 218, 54, 68);
- Rectangle Click29 = new Rectangle(578, 160, 54, 68);
- Rectangle Click30 = new Rectangle(578, 81, 54, 68);
- Rectangle Click31 = new Rectangle(635, 218, 54, 68);
- Rectangle Click32 = new Rectangle(635, 160, 54, 68);
- Rectangle Click33 = new Rectangle(635, 81, 54, 68);
- Rectangle Click34 = new Rectangle(692, 218, 54, 68);
- Rectangle Click35 = new Rectangle(692, 160, 54, 68);
- Rectangle Click36 = new Rectangle(692, 81, 54, 68);
- Rectangle ClickRed = new Rectangle(293, 330, 107, 36);
- Rectangle ClickBlack = new Rectangle(407, 330, 107, 36);
- Rectangle Click118 = new Rectangle(66, 330, 107, 36);
- Rectangle Click1936 = new Rectangle(620, 330, 107, 36);
- Rectangle Click112 = new Rectangle(65, 289, 219, 37);
- Rectangle Click1324 = new Rectangle(293, 289, 219, 37);
- Rectangle Click2536 = new Rectangle(521, 289, 219, 37);
- Rectangle ClickOdd = new Rectangle(510, 330, 107, 36);
- Rectangle ClickEven = new Rectangle(178, 330, 107, 36);
- Rectangle ClickRow1 = new Rectangle(733, 81, 54, 68);
- Rectangle ClickRow2 = new Rectangle(733, 160, 54, 68);
- Rectangle ClickRow3 = new Rectangle(733, 218, 54, 68);
- Rectangle Cashout = new Rectangle(0, 420, 210, 60);
- Rectangle NextScreen = new Rectangle(690, 420, 210, 60);
- //Declaring Random Number
- Random rand = new Random();
- public Game1()
- {
- graphics = new GraphicsDeviceManager(this);
- Content.RootDirectory = "Content";
- }
- /// <summary>
- /// Allows the game to perform any initialization it needs to before starting to run.
- /// This is where it can query for any required services and load any non-graphic
- /// related content. Calling base.Initialize will enumerate through any components
- /// and initialize them as well.
- /// </summary>
- protected override void Initialize()
- {
- // TODO: Add your initialization logic here
- // BackgroundR = new Rectangle(0, 0, 800, 480);
- HomeScreenR = new Rectangle(0, 0, 800, 480);
- InstructionsR = new Rectangle(0, 0, 800, 480);
- BettingScreenR = new Rectangle(0, 0, 800, 480);
- FinalScreenR = new Rectangle(0, 0, 800, 480);
- this.IsMouseVisible = true;
- base.Initialize();
- }
- /// <summary>
- /// LoadContent will be called once per game and is the place to load
- /// all of your content.
- /// </summary>
- protected override void LoadContent()
- {
- // Create a new SpriteBatch, which can be used to draw textures.
- spriteBatch = new SpriteBatch(GraphicsDevice);
- // Background = this.Content.Load<Texture2D>("main2_1.jpg");
- HomeScreen = this.Content.Load<Texture2D>("title.jpg");
- Instructions = this.Content.Load<Texture2D>("Rules.png");
- BettingScreen = this.Content.Load<Texture2D>("Board.png");
- Arial = this.Content.Load<SpriteFont>("Arial");
- FinalScreen = this.Content.Load<Texture2D>("GameOver.png");
- SpriteTexture = Content.Load<Texture2D>("americanroulette");
- Viewport viewport = graphics.GraphicsDevice.Viewport;
- origin.X = SpriteTexture.Width / 2;
- origin.Y = SpriteTexture.Height / 2;
- screenpos.X = viewport.Width / 2;
- screenpos.Y = viewport.Height / 2;
- // TODO: use this.Content to load your game content here
- }
- /// <summary>
- /// UnloadContent will be called once per game and is the place to unload
- /// game-specific content.
- /// </summary>
- protected override void UnloadContent()
- {
- // TODO: Unload any non ContentManager content here
- }
- /// <summary>
- /// Allows the game to run logic such as updating the world,
- /// checking for collisions, gathering input, and playing audio.
- /// </summary>
- /// <param name="gameTime">Provides a snapshot of timing values.</param>
- private float RotationAngle;
- protected override void Update(GameTime gameTime)
- {
- float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds * 2;
- //WheelSpin
- RotationAngle += elapsed;
- float circle = MathHelper.Pi * 2;
- RotationAngle = (RotationAngle % circle);
- Point mousePos = new Point(mouseState.X, mouseState.Y);
- prevMouseState = mouseState;
- mouseState = Mouse.GetState();
- // prevMouseState = mouseState;
- KeyboardState keys = Keyboard.GetState();
- // if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
- if (Spin == 1)
- {
- // Drawn = rand.Next(0, 37);
- Spin = 0;
- }
- // Exit();
- // if (Screen == 1 && keys.IsKeyDown(Keys.Enter) == true)
- // {
- // Screen = 2;
- // }
- if(mouseState.LeftButton == ButtonState.Pressed && prevMouseState.LeftButton == ButtonState.Released)
- {
- if(NextScreen.Contains(mousePos))
- {
- Screen = Screen + 1;
- }
- }
- if (Screen == 3)
- {
- SpinLock = 0;
- if (mouseState.LeftButton == ButtonState.Pressed && prevMouseState.LeftButton == ButtonState.Released)
- {
- if (Click0.Contains(mousePos) && Balance > 0)
- {
- Bet0 = Bet0 + 50;
- Balance = Balance - 50;
- }
- if (Click1.Contains(mousePos) && Balance > 0)
- {
- Bet1 = Bet1 + 50;
- Balance = Balance - 50;
- }
- if (Click2.Contains(mousePos) && Balance > 0)
- {
- Balance = Balance - 50;
- Bet2 = Bet2 + 50;
- }
- if (Click3.Contains(mousePos) && Balance > 0)
- {
- Bet3 = Bet3 + 50;
- Balance = Balance - 50;
- }
- if (Click4.Contains(mousePos) && Balance > 0)
- {
- Bet4 = Bet4 + 50;
- Balance = Balance - 50;
- }
- if (Click5.Contains(mousePos) && Balance > 0)
- {
- Bet5 = Bet5 + 50;
- Balance = Balance - 50;
- }
- if (Click6.Contains(mousePos) && Balance > 0)
- {
- Bet6 = Bet6 + 50;
- Balance = Balance - 50;
- }
- if (Click7.Contains(mousePos) && Balance > 0)
- {
- Bet7 = Bet7 + 50;
- Balance = Balance - 50;
- }
- if (Click8.Contains(mousePos) && Balance > 0)
- {
- Bet8 = Bet8 + 50;
- Balance = Balance - 50;
- }
- if (Click9.Contains(mousePos) && Balance > 0)
- {
- Bet9 = Bet9 + 50;
- Balance = Balance - 50;
- }
- if (Click10.Contains(mousePos) && Balance > 0)
- {
- Bet10 = Bet10 + 50;
- Balance = Balance - 50;
- }
- if (Click11.Contains(mousePos) && Balance > 0)
- {
- Bet11 = Bet11 + 50;
- Balance = Balance - 50;
- }
- if (Click12.Contains(mousePos) && Balance > 0)
- {
- Bet12 = Bet12 + 50;
- Balance = Balance - 50;
- }
- if (Click13.Contains(mousePos) && Balance > 0)
- {
- Bet13 = Bet13 + 50;
- Balance = Balance - 50;
- }
- if (Click14.Contains(mousePos) && Balance > 0)
- {
- Bet14 = Bet14 + 50;
- Balance = Balance - 50;
- }
- if (Click15.Contains(mousePos) && Balance > 0)
- {
- Bet15 = Bet15 + 50;
- Balance = Balance - 50;
- }
- if (Click16.Contains(mousePos) && Balance > 0)
- {
- Bet16 = Bet16 + 50;
- Balance = Balance - 50;
- }
- if (Click17.Contains(mousePos) && Balance > 0)
- {
- Bet17 = Bet17 + 50;
- Balance = Balance - 50;
- }
- if (Click18.Contains(mousePos) && Balance > 0)
- {
- Bet18 = Bet18 + 50;
- Balance = Balance - 50;
- }
- if (Click19.Contains(mousePos) && Balance > 0)
- {
- Bet19 = Bet19 + 50;
- Balance = Balance - 50;
- }
- if (Click20.Contains(mousePos) && Balance > 0)
- {
- Bet20 = Bet20 + 50;
- Balance = Balance - 50;
- }
- if (Click21.Contains(mousePos) && Balance > 0)
- {
- Bet21 = Bet21 + 50;
- Balance = Balance - 50;
- }
- if (Click22.Contains(mousePos) && Balance > 0)
- {
- Bet22 = Bet22 + 50;
- Balance = Balance - 50;
- }
- if (Click23.Contains(mousePos) && Balance > 0)
- {
- Bet23 = Bet23 + 50;
- Balance = Balance - 50;
- }
- if (Click24.Contains(mousePos) && Balance > 0)
- {
- Bet24 = Bet24 + 50;
- Balance = Balance - 50;
- }
- if (Click25.Contains(mousePos) && Balance > 0)
- {
- Bet25 = Bet25 + 50;
- Balance = Balance - 50;
- }
- if (Click26.Contains(mousePos) && Balance > 0)
- {
- Bet26 = Bet26 + 50;
- Balance = Balance - 50;
- }
- if (Click27.Contains(mousePos) && Balance > 0)
- {
- Bet27 = Bet27 + 50;
- Balance = Balance - 50;
- }
- if (Click28.Contains(mousePos) && Balance > 0)
- {
- Bet28 = Bet28 + 50;
- Balance = Balance - 50;
- }
- if (Click29.Contains(mousePos) && Balance > 0)
- {
- Bet29 = Bet29 + 50;
- Balance = Balance - 50;
- }
- if (Click30.Contains(mousePos) && Balance > 0)
- {
- Bet30 = Bet30 + 50;
- Balance = Balance - 50;
- }
- if (Click31.Contains(mousePos) && Balance > 0)
- {
- Bet31 = Bet31 + 50;
- Balance = Balance - 50;
- }
- if (Click32.Contains(mousePos) && Balance > 0)
- {
- Bet32 = Bet32 + 50;
- Balance = Balance - 50;
- }
- if (Click33.Contains(mousePos) && Balance > 0)
- {
- Bet33 = Bet33 + 50;
- Balance = Balance - 50;
- }
- if (Click34.Contains(mousePos) && Balance > 0)
- {
- Bet34 = Bet34 + 50;
- Balance = Balance - 50;
- }
- if (Click35.Contains(mousePos) && Balance > 0)
- {
- Balance = Balance - 50;
- Bet35 = Bet35 + 50;
- }
- if (Click36.Contains(mousePos) && Balance > 0)
- {
- Bet36 = Bet36 + 50;
- Balance = Balance - 50;
- }
- if (ClickRed.Contains(mousePos) && Balance > 0)
- {
- BetRed = BetRed + 50;
- Balance = Balance - 50;
- }
- if (ClickBlack.Contains(mousePos) && Balance > 0)
- {
- BetBlack = BetBlack + 50;
- Balance = Balance - 50;
- }
- if (ClickRow1.Contains(mousePos) && Balance > 0)
- {
- BetRow1 = BetRow1 + 50;
- Balance = Balance - 50;
- }
- if (ClickRow2.Contains(mousePos) && Balance > 0)
- {
- BetRow2 = BetRow2 + 50;
- Balance = Balance - 50;
- }
- if (ClickRow3.Contains(mousePos) && Balance > 0)
- {
- BetRow3 = BetRow3 + 50;
- Balance = Balance - 50;
- }
- if (Click112.Contains(mousePos) && Balance > 0)
- {
- Bet112 = Bet112 + 50;
- Balance = Balance - 50;
- }
- if (Click1324.Contains(mousePos) && Balance > 0)
- {
- Bet1324 = Bet1324 + 50;
- Balance = Balance - 50;
- }
- if (Click2536.Contains(mousePos) && Balance > 0)
- {
- Bet2536 = Bet2536 + 50;
- Balance = Balance - 50;
- }
- if (ClickEven.Contains(mousePos) && Balance > 0)
- {
- BetEven = BetEven + 50;
- Balance = Balance - 50;
- }
- if (ClickOdd.Contains(mousePos) && Balance > 0)
- {
- BetOdd = BetOdd + 50;
- Balance = Balance - 50;
- }
- if(Click118.Contains(mousePos) && Balance > 0)
- {
- Bet118 = Bet118 + 50;
- Balance = Balance - 50;
- }
- if(Click1936.Contains(mousePos) && Balance > 0)
- {
- Bet1936 = Bet1936 + 50;
- Balance = Balance - 50;
- }
- if (Cashout.Contains(mousePos))
- {
- Screen = 5;
- }
- }
- // if (Screen == 4)
- // {
- if (SpinFinish == 1)
- {
- if (Drawn == 0)
- {
- if (Bet0 > 0)
- {
- Balance = Balance + (Bet0 * 35);
- DisplayNumber = 0;
- }
- }
- if (Drawn == 1)
- {
- Balance = Balance + (Bet1 * 35);
- DisplayNumber = 1;
- Balance = Balance + (Bet112 * 3);
- Balance = Balance + (BetRed * 2);
- Balance = Balance + (Bet118 * 2);
- Balance = Balance + (BetRow1 * 3);
- }
- if (Drawn == 2)
- {
- Balance = Balance + (Bet2 * 35);
- DisplayNumber = 2;
- Balance = Balance + (Bet112 * 3);
- Balance = Balance + (BetBlack * 2);
- Balance = Balance + (Bet118 * 2);
- Balance = Balance + (BetRow2 * 3);
- }
- if (Drawn == 3)
- {
- Balance = Balance + (Bet3 * 35);
- DisplayNumber = 3;
- Balance = Balance + (Bet112 * 3);
- Balance = Balance + (BetRed * 2);
- Balance = Balance + (Bet118 * 2);
- Balance = Balance + (BetRow3 * 3);
- }
- if (Drawn == 4)
- {
- Balance = Balance + (Bet4 * 35);
- DisplayNumber = 4;
- Balance = Balance + (Bet112 * 3);
- Balance = Balance + (BetBlack * 2);
- Balance = Balance + (Bet118 * 2);
- Balance = Balance + (BetRow1 * 3);
- }
- if (Drawn == 5)
- {
- Balance = Balance + (Bet5 * 35);
- DisplayNumber = 5;
- Balance = Balance + (Bet112 * 3);
- Balance = Balance + (BetRed * 2);
- Balance = Balance + (Bet118 * 2);
- Balance = Balance + (BetRow2 * 3);
- }
- if (Drawn == 6)
- {
- Balance = Balance + (Bet6 * 35);
- DisplayNumber = 6;
- Balance = Balance + (Bet112 * 3);
- Balance = Balance + (BetBlack * 2);
- Balance = Balance + (Bet118 * 2);
- Balance = Balance + (BetRow3 * 3);
- }
- if (Drawn == 7)
- {
- Balance = Balance + (Bet7 * 35);
- DisplayNumber = 7;
- Balance = Balance + (Bet112 * 3);
- Balance = Balance + (BetRed * 2);
- Balance = Balance + (Bet118 * 2);
- Balance = Balance + (BetRow1 * 3);
- }
- if (Drawn == 8)
- {
- Balance = Balance + (Bet8 * 35);
- DisplayNumber = 8;
- Balance = Balance + (Bet112 * 3);
- Balance = Balance + (BetBlack * 2);
- Balance = Balance + (Bet118 * 2);
- Balance = Balance + (BetRow2 * 3);
- }
- if (Drawn == 9)
- {
- Balance = Balance + (Bet9 * 35);
- DisplayNumber = 9;
- Balance = Balance + (Bet112 * 3);
- Balance = Balance + (BetRed * 2);
- Balance = Balance + (Bet118 * 2);
- Balance = Balance + (BetRow3 * 3);
- }
- if (Drawn == 10)
- {
- Balance = Balance + (Bet10 * 35);
- DisplayNumber = 10;
- Balance = Balance + (BetBlack * 2);
- Balance = Balance + (Bet112 * 3);
- Balance = Balance + (Bet118 * 2);
- Balance = Balance + (BetRow1 * 3);
- }
- if (Drawn == 11)
- {
- Balance = Balance + (Bet11 * 35);
- DisplayNumber = 11;
- Balance = Balance + (Bet112 * 3);
- Balance = Balance + (BetBlack * 2);
- Balance = Balance + (Bet118 * 2);
- Balance = Balance + (BetRow2 * 3);
- }
- if (Drawn == 12)
- {
- Balance = Balance + (Bet12 * 35);
- DisplayNumber = 12;
- Balance = Balance + (Bet112 * 3);
- Balance = Balance + (BetRed * 2);
- Balance = Balance + (Bet118 * 2);
- Balance = Balance + (BetRow3 * 3);
- }
- if (Drawn == 13)
- {
- Balance = Balance + (Bet13 * 35);
- DisplayNumber = 13;
- Balance = Balance + (Bet1324 * 3);
- Balance = Balance + (BetBlack * 2);
- Balance = Balance + (Bet118 * 2);
- Balance = Balance + (BetRow1 * 3);
- }
- if (Drawn == 14)
- {
- Balance = Balance + (Bet14 * 35);
- DisplayNumber = 14;
- Balance = Balance + (Bet1324 * 3);
- Balance = Balance + (BetRed * 2);
- Balance = Balance + (Bet118 * 2);
- Balance = Balance + (BetRow2 * 3);
- }
- if (Drawn == 15)
- {
- Balance = Balance + (Bet15 * 35);
- DisplayNumber = 15;
- Balance = Balance + (Bet1324 * 3);
- Balance = Balance + (BetBlack * 2);
- Balance = Balance + (Bet118 * 2);
- Balance = Balance + (BetRow3 * 3);
- }
- if (Drawn == 16)
- {
- Balance = Balance + (Bet16 * 35);
- DisplayNumber = 16;
- Balance = Balance + (Bet1324 * 3);
- Balance = Balance + (BetRed * 2);
- Balance = Balance + (Bet118 * 2);
- Balance = Balance + (BetRow1 * 3);
- }
- if (Drawn == 17)
- {
- Balance = Balance + (Bet17 * 35);
- DisplayNumber = 17;
- Balance = Balance + (Bet1324 * 3);
- Balance = Balance + (BetBlack * 2);
- Balance = Balance + (Bet118 * 2);
- Balance = Balance + (BetRow2 * 3);
- }
- if (Drawn == 18)
- {
- Balance = Balance + (Bet18 * 35);
- DisplayNumber = 18;
- Balance = Balance + (Bet1324 * 3);
- Balance = Balance + (BetRed * 2);
- Balance = Balance + (Bet118 * 2);
- Balance = Balance + (BetRow3 * 3);
- }
- if (Drawn == 19)
- {
- Balance = Balance + (Bet19 * 35);
- DisplayNumber = 19;
- Balance = Balance + (Bet1324 * 3);
- Balance = Balance + (BetRed * 2);
- Balance = Balance + (Bet1936 * 2);
- Balance = Balance + (BetRow1 * 3);
- }
- if (Drawn == 20)
- {
- Balance = Balance + (Bet20 * 35);
- DisplayNumber = 20;
- Balance = Balance + (Bet1324 * 3);
- Balance = Balance + (BetBlack * 2);
- Balance = Balance + (Bet1936 * 2);
- Balance = Balance + (BetRow2 * 3);
- }
- if (Drawn == 21)
- {
- Balance = Balance + (Bet21 * 35);
- DisplayNumber = 21;
- Balance = Balance + (Bet1324 * 3);
- Balance = Balance + (BetRed * 2);
- Balance = Balance + (Bet1936 * 2);
- Balance = Balance + (BetRow3 * 3);
- }
- if (Drawn == 22)
- {
- Balance = Balance + (Bet22 * 35);
- DisplayNumber = 22;
- Balance = Balance + (Bet1324 * 3);
- Balance = Balance + (BetBlack * 2);
- Balance = Balance + (Bet1936 * 2);
- Balance = Balance + (BetRow1 * 3);
- }
- if (Drawn == 23)
- {
- Balance = Balance + (Bet23 * 35);
- DisplayNumber = 23;
- Balance = Balance + (Bet1324 * 3);
- Balance = Balance + (BetRed * 2);
- Balance = Balance + (Bet1936 * 2);
- Balance = Balance + (BetRow2 * 3);
- }
- if (Drawn == 24)
- {
- Balance = Balance + (Bet24 * 35);
- DisplayNumber = 24;
- Balance = Balance + (Bet1324 * 3);
- Balance = Balance + (BetBlack * 2);
- Balance = Balance + (Bet1936 * 2);
- Balance = Balance + (BetRow3 * 3);
- }
- if (Drawn == 25)
- {
- Balance = Balance + (Bet25 * 35);
- DisplayNumber = 25;
- Balance = Balance + (Bet2536 * 3);
- Balance = Balance + (BetRed * 2);
- Balance = Balance + (Bet1936 * 2);
- Balance = Balance + (BetRow1 * 3);
- }
- if (Drawn == 26)
- {
- Balance = Balance + (Bet26 * 35);
- DisplayNumber = 26;
- Balance = Balance + (Bet2536 * 3);
- Balance = Balance + (BetBlack * 2);
- Balance = Balance + (Bet1936 * 2);
- Balance = Balance + (BetRow2 * 3);
- }
- if (Drawn == 27)
- {
- Balance = Balance + (Bet27 * 35);
- DisplayNumber = 27;
- Balance = Balance + (Bet2536 * 3);
- Balance = Balance + (BetRed * 2);
- Balance = Balance + (Bet1936 * 2);
- Balance = Balance + (BetRow3 * 3);
- }
- if (Drawn == 28)
- {
- Balance = Balance + (Bet28 * 35);
- DisplayNumber = 28;
- Balance = Balance + (Bet2536 * 3);
- Balance = Balance + (BetBlack * 2);
- Balance = Balance + (Bet1936 * 2);
- Balance = Balance + (BetRow1 * 3);
- }
- if (Drawn == 29)
- {
- Balance = Balance + (Bet29 * 35);
- DisplayNumber = 29;
- Balance = Balance + (Bet2536 * 3);
- Balance = Balance + (BetBlack * 2);
- Balance = Balance + (Bet1936 * 2);
- Balance = Balance + (BetRow2 * 3);
- }
- if (Drawn == 30)
- {
- Balance = Balance + (Bet30 * 35);
- DisplayNumber = 30;
- Balance = Balance + (Bet2536 * 3);
- Balance = Balance + (BetRed * 2);
- Balance = Balance + (Bet1936 * 2);
- Balance = Balance + (BetRow3 * 3);
- }
- if (Drawn == 31)
- {
- Balance = Balance + (Bet31 * 35);
- DisplayNumber = 31;
- Balance = Balance + (Bet2536 * 3);
- Balance = Balance + (BetBlack * 2);
- Balance = Balance + (Bet1936 * 2);
- Balance = Balance + (BetRow1 * 3);
- }
- if (Drawn == 32)
- {
- Balance = Balance + (Bet32 * 35);
- DisplayNumber = 32;
- Balance = Balance + (Bet2536 * 3);
- Balance = Balance + (BetRed * 2);
- Balance = Balance + (Bet1936 * 2);
- Balance = Balance + (BetRow2 * 3);
- }
- if (Drawn == 33)
- {
- Balance = Balance + (Bet33 * 35);
- DisplayNumber = 33;
- Balance = Balance + (Bet2536 * 3);
- Balance = Balance + (BetBlack * 2);
- Balance = Balance + (Bet1936 * 2);
- Balance = Balance + (BetRow3 * 3);
- }
- if (Drawn == 34)
- {
- Balance = Balance + (Bet34 * 35);
- DisplayNumber = 34;
- Balance = Balance + (Bet2536 * 3);
- Balance = Balance + (BetRed * 2);
- Balance = Balance + (Bet1936 * 2);
- Balance = Balance + (BetRow1 * 3);
- }
- if (Drawn == 35)
- {
- Balance = Balance + (Bet35 * 35);
- DisplayNumber = 35;
- Balance = Balance + (Bet2536 * 3);
- Balance = Balance + (BetBlack * 2);
- Balance = Balance + (Bet1936 * 2);
- Balance = Balance + (BetRow2 * 3);
- }
- if (Drawn == 36)
- {
- Balance = Balance + (Bet36 * 35);
- DisplayNumber = 36;
- Balance = Balance + (Bet2536 * 3);
- Balance = Balance + (BetRed * 2);
- Balance = Balance + (Bet1936 * 2);
- Balance = Balance + (BetRow3 * 3);
- }
- }
- if (SpinFinish == 1)
- {
- Bet0 = 0;
- Bet1 = 0;
- Bet2 = 0;
- Bet3 = 0;
- Bet4 = 0;
- Bet5 = 0;
- Bet6 = 0;
- Bet7 = 0;
- Bet8 = 0;
- Bet9 = 0;
- Bet10 = 0;
- Bet11 = 0;
- Bet12 = 0;
- Bet13 = 0;
- Bet14 = 0;
- Bet15 = 0;
- Bet16 = 0;
- Bet17 = 0;
- Bet18 = 0;
- Bet19 = 0;
- Bet20 = 0;
- Bet21 = 0;
- Bet22 = 0;
- Bet23 = 0;
- Bet24 = 0;
- Bet25 = 0;
- Bet26 = 0;
- Bet27 = 0;
- Bet28 = 0;
- Bet29 = 0;
- Bet30 = 0;
- Bet31 = 0;
- Bet32 = 0;
- Bet33 = 0;
- Bet34 = 0;
- Bet35 = 0;
- Bet36 = 0;
- BetRed = 0;
- BetBlack = 0;
- BetEven = 0;
- BetOdd = 0;
- BetRow1 = 0;
- BetRow2 = 0;
- BetRow3 = 0;
- Bet112 = 0;
- Bet118 = 0;
- Bet1324 = 0;
- Bet1936 = 0;
- Bet2536 = 0;
- SpinFinish = 0;
- Spin = 0;
- RandLock = 0;
- Screen = 3;
- }
- //}
- //}
- }
- if (Screen == 4 )
- {
- if (RandLock == 0)
- {
- Drawn = rand.Next(0, 37);
- }
- CountSpin++;
- AfterSpin++;
- if (CountSpin == 900)
- {
- Drawn = rand.Next(0, 37);
- RandLock = 1;
- CountSpin = 0;
- }
- if(AfterSpin == 1200)
- {
- SpinFinish = 1;
- Screen = 3;
- AfterSpin = 0;
- }
- }
- if (keys.IsKeyDown(Keys.N) == true)
- {
- Screen = 3;
- }
- if(keys.IsKeyDown(Keys.M) == true && Screen == 3)
- {
- Screen = 4;
- }
- // TODO: Add your update logic here
- base.Update(gameTime);
- }
- /// <summary>
- /// This is called when the game should draw itself.
- /// </summary>
- /// <param name="gameTime">Provides a snapshot of timing values.</param>
- protected override void Draw(GameTime gameTime)
- {
- GraphicsDevice.Clear(Color.CornflowerBlue);
- if (Screen == 1)
- {
- spriteBatch.Begin();
- spriteBatch.Draw(HomeScreen, HomeScreenR, Color.White);
- spriteBatch.DrawString(Arial, "Next", new Vector2(690, 420), Color.White);
- spriteBatch.End();
- }
- if (Screen == 2)
- {
- spriteBatch.Begin();
- spriteBatch.Draw(Instructions, InstructionsR, Color.White);
- spriteBatch.DrawString(Arial, "Next", new Vector2(690, 420), Color.White);
- spriteBatch.End();
- }
- if (Screen == 3)
- {
- spriteBatch.Begin();
- spriteBatch.Draw(BettingScreen, BettingScreenR, Color.White);
- spriteBatch.DrawString(Arial, "Balance:" + Balance, new Vector2(50, 0), Color.White);
- spriteBatch.DrawString(Arial, "Leave Table", new Vector2(0, 420), Color.White);
- spriteBatch.DrawString(Arial, "Next", new Vector2(690, 420), Color.White);
- spriteBatch.End();
- }
- if (Screen == 4)
- {
- spriteBatch.Begin();
- spriteBatch.Draw(SpriteTexture, screenpos, null, Color.White, RotationAngle, origin, 1.0f, SpriteEffects.None, 0f);
- spriteBatch.DrawString(Arial, "" + Drawn, new Vector2(375, 228), Color.White);
- spriteBatch.End();
- }
- if (Screen == 5)
- {
- spriteBatch.Begin();
- spriteBatch.Draw(FinalScreen, FinalScreenR, Color.White);
- spriteBatch.DrawString(Arial, "$" + Balance, new Vector2(340, 160), Color.Red);
- spriteBatch.End();
- }
- // spriteBatch.Begin();
- // spriteBatch.Draw(Background, BackgroundR, Color.White);
- // spriteBatch.End();
- // TODO: Add your drawing code here
- base.Draw(gameTime);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement