Advertisement
robiytrav

Untitled

Jan 17th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 42.94 KB | None | 0 0
  1. using Microsoft.Xna.Framework;
  2. using Microsoft.Xna.Framework.Graphics;
  3. using Microsoft.Xna.Framework.Input;
  4. using System;
  5.  
  6. namespace Final_Project
  7. {
  8. /// <summary>
  9. /// This is the main type
  10. /// your game.
  11. /// </summary>
  12. public class Game1 : Game
  13. {
  14. GraphicsDeviceManager graphics;
  15. SpriteBatch spriteBatch;
  16. //Declaring all of the different screens
  17. Texture2D HomeScreen;
  18. Rectangle HomeScreenR;
  19. Texture2D Instructions;
  20. Rectangle InstructionsR;
  21. Texture2D BettingScreen;
  22. Rectangle BettingScreenR;
  23. Texture2D WheelScreen;
  24. Rectangle WheelScreenR;
  25. Texture2D FinalScreen;
  26. Rectangle FinalScreenR;
  27. SpriteFont Arial;
  28. Vector2 ArialV;
  29. Texture2D SpriteTexture;
  30. Vector2 origin;
  31. Vector2 screenpos;
  32. Vector2 DrawnV;
  33. //Rectangles for click Areas on Betting screen
  34. /* Might as well ignore this section. Just kept it as a backup
  35. Rectangle Click0;
  36. Rectangle Click1;
  37. Rectangle Click2;
  38. Rectangle Click3;
  39. Rectangle Click4;
  40. Rectangle Click5;
  41. Rectangle Click6;
  42. Rectangle Click7;
  43. Rectangle Click8;
  44. Rectangle Click9;
  45. Rectangle Click10;
  46. Rectangle Click11;
  47. Rectangle Click12;
  48. Rectangle Click13;
  49. Rectangle Click14;
  50. Rectangle Click16;
  51. Rectangle Click15;
  52. Rectangle Click17;
  53. Rectangle Click18;
  54. Rectangle Click19;
  55. Rectangle Click20;
  56. Rectangle Click21;
  57. Rectangle Click22;
  58. Rectangle Click23;
  59. Rectangle Click24;
  60. Rectangle Click25;
  61. Rectangle Click26;
  62. Rectangle Click27;
  63. Rectangle Click28;
  64. Rectangle Click29;
  65. Rectangle Click30;
  66. Rectangle Click31;
  67. Rectangle Click32;
  68. Rectangle Click33;
  69. Rectangle Click34;
  70. Rectangle Click35;
  71. Rectangle Click36;
  72. Rectangle ClickRed;
  73. Rectangle ClickBlack;
  74. Rectangle ClickEven;
  75. Rectangle ClickOdd;
  76. Rectangle Click118;
  77. Rectangle Click1936;
  78. Rectangle ClickRow1;
  79. Rectangle ClickRow2;
  80. Rectangle ClickRow3;
  81. Rectangle Click112;
  82. Rectangle Click1324;
  83. Rectangle Click2536;
  84. */
  85. MouseState prevMouseState;
  86. MouseState mouseState = Mouse.GetState();
  87. int AfterSpin;
  88. //Displays which number was drawn
  89. int DisplayNumber;
  90. //Set to realize when to reset bet amounts
  91. int SpinFinish;
  92. //Stops from choosing random number
  93. int SpinLock;
  94. int RandLock = 0;
  95. int CountSpin;
  96. //Displaying Current money
  97. int Balance = 500;
  98. //Chooses screen to switch too
  99. int Screen = 1;
  100. //Holds the number that was randomly chosen.
  101. int Drawn;
  102. //Saves Bet Amounts
  103. int Bet0;
  104. int Bet1;
  105. int Bet2;
  106. int Bet3;
  107. int Bet4;
  108. int Bet5;
  109. int Bet6;
  110. int Bet7;
  111. int Bet8;
  112. int Bet9;
  113. int Bet10;
  114. int Bet11;
  115. int Bet12;
  116. int Bet13;
  117. int Bet14;
  118. int Bet15;
  119. int Bet16;
  120. int Bet17;
  121. int Bet18;
  122. int Bet19;
  123. int Bet20;
  124. int Bet21;
  125. int Bet22;
  126. int Bet23;
  127. int Bet24;
  128. int Bet25;
  129. int Bet26;
  130. int Bet27;
  131. int Bet28;
  132. int Bet29;
  133. int Bet30;
  134. int Bet31;
  135. int Bet32;
  136. int Bet33;
  137. int Bet34;
  138. int Bet35;
  139. int Bet36;
  140. int BetRed;
  141. int BetBlack;
  142. int BetEven;
  143. int BetOdd;
  144. int Bet118;
  145. int Bet1936;
  146. int Bet112;
  147. int Bet1324;
  148. int Bet2536;
  149. int BetRow1;
  150. int BetRow2;
  151. int BetRow3;
  152. int Spin = 1;
  153.  
  154. Rectangle Click0 = new Rectangle(5, 80, 62, 212);
  155. Rectangle Click1 = new Rectangle(65, 218, 54, 68);
  156. Rectangle Click2 = new Rectangle(65, 160, 54, 68);
  157. Rectangle Click3 = new Rectangle(65, 81, 54, 68);
  158. Rectangle Click4 = new Rectangle(122, 218, 54, 68);
  159. Rectangle Click5 = new Rectangle(122, 160, 54, 68);
  160. Rectangle Click6 = new Rectangle(122, 81, 54, 68);
  161. Rectangle Click7 = new Rectangle(179, 218, 54, 68);
  162. Rectangle Click8 = new Rectangle(179, 160, 54, 68);
  163. Rectangle Click9 = new Rectangle(179, 81, 54, 68);
  164. Rectangle Click10 = new Rectangle(236, 218, 54, 68);
  165. Rectangle Click11 = new Rectangle(236, 160, 54, 68);
  166. Rectangle Click12 = new Rectangle(236, 81, 54, 68);
  167. Rectangle Click13 = new Rectangle(293, 218, 54, 68);
  168. Rectangle Click14 = new Rectangle(293, 160, 54, 68);
  169. Rectangle Click15 = new Rectangle(293, 81, 54, 68);
  170. Rectangle Click16 = new Rectangle(350, 218, 54, 68);
  171. Rectangle Click17 = new Rectangle(350, 160, 54, 68);
  172. Rectangle Click18 = new Rectangle(350, 81, 54, 68);
  173. Rectangle Click19 = new Rectangle(407, 218, 54, 68);
  174. Rectangle Click20 = new Rectangle(407, 160, 54, 68);
  175. Rectangle Click21 = new Rectangle(407, 81, 54, 68);
  176. Rectangle Click22 = new Rectangle(464, 218, 54, 68);
  177. Rectangle Click23 = new Rectangle(464, 160, 54, 68);
  178. Rectangle Click24 = new Rectangle(464, 81, 54, 68);
  179. Rectangle Click25 = new Rectangle(521, 218, 54, 68);
  180. Rectangle Click26 = new Rectangle(521, 160, 54, 68);
  181. Rectangle Click27 = new Rectangle(521, 81, 54, 68);
  182. Rectangle Click28 = new Rectangle(578, 218, 54, 68);
  183. Rectangle Click29 = new Rectangle(578, 160, 54, 68);
  184. Rectangle Click30 = new Rectangle(578, 81, 54, 68);
  185. Rectangle Click31 = new Rectangle(635, 218, 54, 68);
  186. Rectangle Click32 = new Rectangle(635, 160, 54, 68);
  187. Rectangle Click33 = new Rectangle(635, 81, 54, 68);
  188. Rectangle Click34 = new Rectangle(692, 218, 54, 68);
  189. Rectangle Click35 = new Rectangle(692, 160, 54, 68);
  190. Rectangle Click36 = new Rectangle(692, 81, 54, 68);
  191. Rectangle ClickRed = new Rectangle(293, 330, 107, 36);
  192. Rectangle ClickBlack = new Rectangle(407, 330, 107, 36);
  193. Rectangle Click118 = new Rectangle(66, 330, 107, 36);
  194. Rectangle Click1936 = new Rectangle(620, 330, 107, 36);
  195. Rectangle Click112 = new Rectangle(65, 289, 219, 37);
  196. Rectangle Click1324 = new Rectangle(293, 289, 219, 37);
  197. Rectangle Click2536 = new Rectangle(521, 289, 219, 37);
  198. Rectangle ClickOdd = new Rectangle(510, 330, 107, 36);
  199. Rectangle ClickEven = new Rectangle(178, 330, 107, 36);
  200. Rectangle ClickRow1 = new Rectangle(733, 81, 54, 68);
  201. Rectangle ClickRow2 = new Rectangle(733, 160, 54, 68);
  202. Rectangle ClickRow3 = new Rectangle(733, 218, 54, 68);
  203. Rectangle Cashout = new Rectangle(0, 420, 210, 60);
  204. Rectangle NextScreen = new Rectangle(690, 420, 210, 60);
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211. //Declaring Random Number
  212. Random rand = new Random();
  213.  
  214. public Game1()
  215. {
  216.  
  217. graphics = new GraphicsDeviceManager(this);
  218. Content.RootDirectory = "Content";
  219. }
  220.  
  221. /// <summary>
  222. /// Allows the game to perform any initialization it needs to before starting to run.
  223. /// This is where it can query for any required services and load any non-graphic
  224. /// related content. Calling base.Initialize will enumerate through any components
  225. /// and initialize them as well.
  226. /// </summary>
  227. protected override void Initialize()
  228. {
  229. // TODO: Add your initialization logic here
  230. // BackgroundR = new Rectangle(0, 0, 800, 480);
  231. HomeScreenR = new Rectangle(0, 0, 800, 480);
  232. InstructionsR = new Rectangle(0, 0, 800, 480);
  233. BettingScreenR = new Rectangle(0, 0, 800, 480);
  234. FinalScreenR = new Rectangle(0, 0, 800, 480);
  235. this.IsMouseVisible = true;
  236. base.Initialize();
  237.  
  238. }
  239.  
  240. /// <summary>
  241. /// LoadContent will be called once per game and is the place to load
  242. /// all of your content.
  243. /// </summary>
  244. protected override void LoadContent()
  245. {
  246. // Create a new SpriteBatch, which can be used to draw textures.
  247. spriteBatch = new SpriteBatch(GraphicsDevice);
  248. // Background = this.Content.Load<Texture2D>("main2_1.jpg");
  249. HomeScreen = this.Content.Load<Texture2D>("title.jpg");
  250. Instructions = this.Content.Load<Texture2D>("Rules.png");
  251. BettingScreen = this.Content.Load<Texture2D>("Board.png");
  252. Arial = this.Content.Load<SpriteFont>("Arial");
  253. FinalScreen = this.Content.Load<Texture2D>("GameOver.png");
  254. SpriteTexture = Content.Load<Texture2D>("americanroulette");
  255. Viewport viewport = graphics.GraphicsDevice.Viewport;
  256. origin.X = SpriteTexture.Width / 2;
  257. origin.Y = SpriteTexture.Height / 2;
  258. screenpos.X = viewport.Width / 2;
  259. screenpos.Y = viewport.Height / 2;
  260.  
  261. // TODO: use this.Content to load your game content here
  262. }
  263.  
  264. /// <summary>
  265. /// UnloadContent will be called once per game and is the place to unload
  266. /// game-specific content.
  267. /// </summary>
  268. protected override void UnloadContent()
  269. {
  270. // TODO: Unload any non ContentManager content here
  271. }
  272.  
  273. /// <summary>
  274. /// Allows the game to run logic such as updating the world,
  275. /// checking for collisions, gathering input, and playing audio.
  276. /// </summary>
  277. /// <param name="gameTime">Provides a snapshot of timing values.</param>
  278. private float RotationAngle;
  279. protected override void Update(GameTime gameTime)
  280. {
  281. float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds * 2;
  282.  
  283. //WheelSpin
  284. RotationAngle += elapsed;
  285. float circle = MathHelper.Pi * 2;
  286. RotationAngle = (RotationAngle % circle);
  287. Point mousePos = new Point(mouseState.X, mouseState.Y);
  288. prevMouseState = mouseState;
  289. mouseState = Mouse.GetState();
  290. // prevMouseState = mouseState;
  291. KeyboardState keys = Keyboard.GetState();
  292. // if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
  293. if (Spin == 1)
  294. {
  295. // Drawn = rand.Next(0, 37);
  296. Spin = 0;
  297. }
  298. // Exit();
  299. // if (Screen == 1 && keys.IsKeyDown(Keys.Enter) == true)
  300. // {
  301. // Screen = 2;
  302. // }
  303. if(mouseState.LeftButton == ButtonState.Pressed && prevMouseState.LeftButton == ButtonState.Released)
  304. {
  305. if(NextScreen.Contains(mousePos))
  306. {
  307. Screen = Screen + 1;
  308.  
  309.  
  310. }
  311. }
  312. if (Screen == 3)
  313. {
  314. SpinLock = 0;
  315.  
  316. if (mouseState.LeftButton == ButtonState.Pressed && prevMouseState.LeftButton == ButtonState.Released)
  317. {
  318.  
  319.  
  320.  
  321.  
  322. if (Click0.Contains(mousePos) && Balance > 0)
  323. {
  324. Bet0 = Bet0 + 50;
  325. Balance = Balance - 50;
  326. }
  327. if (Click1.Contains(mousePos) && Balance > 0)
  328. {
  329. Bet1 = Bet1 + 50;
  330. Balance = Balance - 50;
  331. }
  332. if (Click2.Contains(mousePos) && Balance > 0)
  333. {
  334. Balance = Balance - 50;
  335. Bet2 = Bet2 + 50;
  336. }
  337. if (Click3.Contains(mousePos) && Balance > 0)
  338. {
  339. Bet3 = Bet3 + 50;
  340. Balance = Balance - 50;
  341. }
  342. if (Click4.Contains(mousePos) && Balance > 0)
  343. {
  344. Bet4 = Bet4 + 50;
  345. Balance = Balance - 50;
  346. }
  347. if (Click5.Contains(mousePos) && Balance > 0)
  348. {
  349. Bet5 = Bet5 + 50;
  350. Balance = Balance - 50;
  351. }
  352. if (Click6.Contains(mousePos) && Balance > 0)
  353. {
  354. Bet6 = Bet6 + 50;
  355. Balance = Balance - 50;
  356. }
  357. if (Click7.Contains(mousePos) && Balance > 0)
  358. {
  359. Bet7 = Bet7 + 50;
  360. Balance = Balance - 50;
  361. }
  362. if (Click8.Contains(mousePos) && Balance > 0)
  363. {
  364. Bet8 = Bet8 + 50;
  365. Balance = Balance - 50;
  366. }
  367. if (Click9.Contains(mousePos) && Balance > 0)
  368. {
  369. Bet9 = Bet9 + 50;
  370. Balance = Balance - 50;
  371. }
  372.  
  373. if (Click10.Contains(mousePos) && Balance > 0)
  374. {
  375. Bet10 = Bet10 + 50;
  376. Balance = Balance - 50;
  377. }
  378. if (Click11.Contains(mousePos) && Balance > 0)
  379. {
  380. Bet11 = Bet11 + 50;
  381. Balance = Balance - 50;
  382. }
  383. if (Click12.Contains(mousePos) && Balance > 0)
  384. {
  385. Bet12 = Bet12 + 50;
  386. Balance = Balance - 50;
  387. }
  388. if (Click13.Contains(mousePos) && Balance > 0)
  389. {
  390. Bet13 = Bet13 + 50;
  391. Balance = Balance - 50;
  392. }
  393. if (Click14.Contains(mousePos) && Balance > 0)
  394. {
  395. Bet14 = Bet14 + 50;
  396. Balance = Balance - 50;
  397. }
  398. if (Click15.Contains(mousePos) && Balance > 0)
  399. {
  400. Bet15 = Bet15 + 50;
  401. Balance = Balance - 50;
  402. }
  403. if (Click16.Contains(mousePos) && Balance > 0)
  404. {
  405. Bet16 = Bet16 + 50;
  406. Balance = Balance - 50;
  407. }
  408. if (Click17.Contains(mousePos) && Balance > 0)
  409. {
  410. Bet17 = Bet17 + 50;
  411. Balance = Balance - 50;
  412. }
  413. if (Click18.Contains(mousePos) && Balance > 0)
  414. {
  415. Bet18 = Bet18 + 50;
  416. Balance = Balance - 50;
  417. }
  418. if (Click19.Contains(mousePos) && Balance > 0)
  419. {
  420. Bet19 = Bet19 + 50;
  421. Balance = Balance - 50;
  422. }
  423. if (Click20.Contains(mousePos) && Balance > 0)
  424. {
  425. Bet20 = Bet20 + 50;
  426. Balance = Balance - 50;
  427. }
  428. if (Click21.Contains(mousePos) && Balance > 0)
  429. {
  430. Bet21 = Bet21 + 50;
  431. Balance = Balance - 50;
  432. }
  433. if (Click22.Contains(mousePos) && Balance > 0)
  434. {
  435. Bet22 = Bet22 + 50;
  436. Balance = Balance - 50;
  437. }
  438. if (Click23.Contains(mousePos) && Balance > 0)
  439. {
  440. Bet23 = Bet23 + 50;
  441. Balance = Balance - 50;
  442. }
  443. if (Click24.Contains(mousePos) && Balance > 0)
  444. {
  445. Bet24 = Bet24 + 50;
  446. Balance = Balance - 50;
  447. }
  448. if (Click25.Contains(mousePos) && Balance > 0)
  449. {
  450. Bet25 = Bet25 + 50;
  451. Balance = Balance - 50;
  452. }
  453. if (Click26.Contains(mousePos) && Balance > 0)
  454. {
  455. Bet26 = Bet26 + 50;
  456. Balance = Balance - 50;
  457. }
  458. if (Click27.Contains(mousePos) && Balance > 0)
  459. {
  460. Bet27 = Bet27 + 50;
  461. Balance = Balance - 50;
  462. }
  463. if (Click28.Contains(mousePos) && Balance > 0)
  464. {
  465. Bet28 = Bet28 + 50;
  466. Balance = Balance - 50;
  467. }
  468. if (Click29.Contains(mousePos) && Balance > 0)
  469. {
  470. Bet29 = Bet29 + 50;
  471. Balance = Balance - 50;
  472. }
  473. if (Click30.Contains(mousePos) && Balance > 0)
  474. {
  475. Bet30 = Bet30 + 50;
  476. Balance = Balance - 50;
  477. }
  478. if (Click31.Contains(mousePos) && Balance > 0)
  479. {
  480. Bet31 = Bet31 + 50;
  481. Balance = Balance - 50;
  482. }
  483. if (Click32.Contains(mousePos) && Balance > 0)
  484. {
  485. Bet32 = Bet32 + 50;
  486. Balance = Balance - 50;
  487. }
  488. if (Click33.Contains(mousePos) && Balance > 0)
  489. {
  490. Bet33 = Bet33 + 50;
  491. Balance = Balance - 50;
  492. }
  493. if (Click34.Contains(mousePos) && Balance > 0)
  494. {
  495. Bet34 = Bet34 + 50;
  496. Balance = Balance - 50;
  497. }
  498. if (Click35.Contains(mousePos) && Balance > 0)
  499. {
  500. Balance = Balance - 50;
  501. Bet35 = Bet35 + 50;
  502. }
  503. if (Click36.Contains(mousePos) && Balance > 0)
  504. {
  505. Bet36 = Bet36 + 50;
  506. Balance = Balance - 50;
  507. }
  508. if (ClickRed.Contains(mousePos) && Balance > 0)
  509. {
  510. BetRed = BetRed + 50;
  511. Balance = Balance - 50;
  512. }
  513. if (ClickBlack.Contains(mousePos) && Balance > 0)
  514. {
  515. BetBlack = BetBlack + 50;
  516. Balance = Balance - 50;
  517. }
  518. if (ClickRow1.Contains(mousePos) && Balance > 0)
  519. {
  520. BetRow1 = BetRow1 + 50;
  521. Balance = Balance - 50;
  522. }
  523. if (ClickRow2.Contains(mousePos) && Balance > 0)
  524. {
  525. BetRow2 = BetRow2 + 50;
  526. Balance = Balance - 50;
  527. }
  528. if (ClickRow3.Contains(mousePos) && Balance > 0)
  529. {
  530. BetRow3 = BetRow3 + 50;
  531. Balance = Balance - 50;
  532. }
  533. if (Click112.Contains(mousePos) && Balance > 0)
  534. {
  535. Bet112 = Bet112 + 50;
  536. Balance = Balance - 50;
  537. }
  538. if (Click1324.Contains(mousePos) && Balance > 0)
  539. {
  540. Bet1324 = Bet1324 + 50;
  541. Balance = Balance - 50;
  542. }
  543. if (Click2536.Contains(mousePos) && Balance > 0)
  544. {
  545. Bet2536 = Bet2536 + 50;
  546. Balance = Balance - 50;
  547.  
  548. }
  549. if (ClickEven.Contains(mousePos) && Balance > 0)
  550. {
  551. BetEven = BetEven + 50;
  552. Balance = Balance - 50;
  553. }
  554. if (ClickOdd.Contains(mousePos) && Balance > 0)
  555. {
  556. BetOdd = BetOdd + 50;
  557. Balance = Balance - 50;
  558. }
  559. if(Click118.Contains(mousePos) && Balance > 0)
  560. {
  561. Bet118 = Bet118 + 50;
  562. Balance = Balance - 50;
  563. }
  564. if(Click1936.Contains(mousePos) && Balance > 0)
  565. {
  566. Bet1936 = Bet1936 + 50;
  567. Balance = Balance - 50;
  568. }
  569.  
  570.  
  571. if (Cashout.Contains(mousePos))
  572. {
  573. Screen = 5;
  574. }
  575.  
  576. }
  577.  
  578.  
  579.  
  580. // if (Screen == 4)
  581. // {
  582. if (SpinFinish == 1)
  583. {
  584. if (Drawn == 0)
  585. {
  586. if (Bet0 > 0)
  587. {
  588. Balance = Balance + (Bet0 * 35);
  589. DisplayNumber = 0;
  590. }
  591. }
  592. if (Drawn == 1)
  593. {
  594. Balance = Balance + (Bet1 * 35);
  595. DisplayNumber = 1;
  596. Balance = Balance + (Bet112 * 3);
  597. Balance = Balance + (BetRed * 2);
  598. Balance = Balance + (Bet118 * 2);
  599. Balance = Balance + (BetRow1 * 3);
  600. }
  601. if (Drawn == 2)
  602. {
  603. Balance = Balance + (Bet2 * 35);
  604. DisplayNumber = 2;
  605. Balance = Balance + (Bet112 * 3);
  606. Balance = Balance + (BetBlack * 2);
  607. Balance = Balance + (Bet118 * 2);
  608. Balance = Balance + (BetRow2 * 3);
  609.  
  610. }
  611. if (Drawn == 3)
  612. {
  613. Balance = Balance + (Bet3 * 35);
  614. DisplayNumber = 3;
  615. Balance = Balance + (Bet112 * 3);
  616. Balance = Balance + (BetRed * 2);
  617. Balance = Balance + (Bet118 * 2);
  618. Balance = Balance + (BetRow3 * 3);
  619. }
  620. if (Drawn == 4)
  621. {
  622. Balance = Balance + (Bet4 * 35);
  623. DisplayNumber = 4;
  624. Balance = Balance + (Bet112 * 3);
  625. Balance = Balance + (BetBlack * 2);
  626. Balance = Balance + (Bet118 * 2);
  627. Balance = Balance + (BetRow1 * 3);
  628. }
  629. if (Drawn == 5)
  630. {
  631. Balance = Balance + (Bet5 * 35);
  632. DisplayNumber = 5;
  633. Balance = Balance + (Bet112 * 3);
  634. Balance = Balance + (BetRed * 2);
  635. Balance = Balance + (Bet118 * 2);
  636. Balance = Balance + (BetRow2 * 3);
  637. }
  638. if (Drawn == 6)
  639. {
  640. Balance = Balance + (Bet6 * 35);
  641. DisplayNumber = 6;
  642. Balance = Balance + (Bet112 * 3);
  643. Balance = Balance + (BetBlack * 2);
  644. Balance = Balance + (Bet118 * 2);
  645. Balance = Balance + (BetRow3 * 3);
  646. }
  647. if (Drawn == 7)
  648. {
  649. Balance = Balance + (Bet7 * 35);
  650. DisplayNumber = 7;
  651. Balance = Balance + (Bet112 * 3);
  652. Balance = Balance + (BetRed * 2);
  653. Balance = Balance + (Bet118 * 2);
  654. Balance = Balance + (BetRow1 * 3);
  655. }
  656. if (Drawn == 8)
  657. {
  658. Balance = Balance + (Bet8 * 35);
  659. DisplayNumber = 8;
  660. Balance = Balance + (Bet112 * 3);
  661. Balance = Balance + (BetBlack * 2);
  662. Balance = Balance + (Bet118 * 2);
  663. Balance = Balance + (BetRow2 * 3);
  664. }
  665. if (Drawn == 9)
  666. {
  667. Balance = Balance + (Bet9 * 35);
  668. DisplayNumber = 9;
  669. Balance = Balance + (Bet112 * 3);
  670. Balance = Balance + (BetRed * 2);
  671. Balance = Balance + (Bet118 * 2);
  672. Balance = Balance + (BetRow3 * 3);
  673. }
  674. if (Drawn == 10)
  675. {
  676. Balance = Balance + (Bet10 * 35);
  677. DisplayNumber = 10;
  678. Balance = Balance + (BetBlack * 2);
  679. Balance = Balance + (Bet112 * 3);
  680. Balance = Balance + (Bet118 * 2);
  681. Balance = Balance + (BetRow1 * 3);
  682. }
  683. if (Drawn == 11)
  684. {
  685. Balance = Balance + (Bet11 * 35);
  686. DisplayNumber = 11;
  687. Balance = Balance + (Bet112 * 3);
  688. Balance = Balance + (BetBlack * 2);
  689. Balance = Balance + (Bet118 * 2);
  690. Balance = Balance + (BetRow2 * 3);
  691. }
  692. if (Drawn == 12)
  693. {
  694. Balance = Balance + (Bet12 * 35);
  695. DisplayNumber = 12;
  696. Balance = Balance + (Bet112 * 3);
  697. Balance = Balance + (BetRed * 2);
  698. Balance = Balance + (Bet118 * 2);
  699. Balance = Balance + (BetRow3 * 3);
  700. }
  701. if (Drawn == 13)
  702. {
  703. Balance = Balance + (Bet13 * 35);
  704. DisplayNumber = 13;
  705. Balance = Balance + (Bet1324 * 3);
  706. Balance = Balance + (BetBlack * 2);
  707. Balance = Balance + (Bet118 * 2);
  708. Balance = Balance + (BetRow1 * 3);
  709.  
  710. }
  711. if (Drawn == 14)
  712. {
  713. Balance = Balance + (Bet14 * 35);
  714. DisplayNumber = 14;
  715. Balance = Balance + (Bet1324 * 3);
  716. Balance = Balance + (BetRed * 2);
  717. Balance = Balance + (Bet118 * 2);
  718. Balance = Balance + (BetRow2 * 3);
  719. }
  720. if (Drawn == 15)
  721. {
  722. Balance = Balance + (Bet15 * 35);
  723. DisplayNumber = 15;
  724. Balance = Balance + (Bet1324 * 3);
  725. Balance = Balance + (BetBlack * 2);
  726. Balance = Balance + (Bet118 * 2);
  727. Balance = Balance + (BetRow3 * 3);
  728. }
  729. if (Drawn == 16)
  730. {
  731. Balance = Balance + (Bet16 * 35);
  732. DisplayNumber = 16;
  733. Balance = Balance + (Bet1324 * 3);
  734. Balance = Balance + (BetRed * 2);
  735. Balance = Balance + (Bet118 * 2);
  736. Balance = Balance + (BetRow1 * 3);
  737. }
  738. if (Drawn == 17)
  739. {
  740. Balance = Balance + (Bet17 * 35);
  741. DisplayNumber = 17;
  742. Balance = Balance + (Bet1324 * 3);
  743. Balance = Balance + (BetBlack * 2);
  744. Balance = Balance + (Bet118 * 2);
  745. Balance = Balance + (BetRow2 * 3);
  746. }
  747. if (Drawn == 18)
  748. {
  749. Balance = Balance + (Bet18 * 35);
  750. DisplayNumber = 18;
  751. Balance = Balance + (Bet1324 * 3);
  752. Balance = Balance + (BetRed * 2);
  753. Balance = Balance + (Bet118 * 2);
  754. Balance = Balance + (BetRow3 * 3);
  755. }
  756. if (Drawn == 19)
  757. {
  758. Balance = Balance + (Bet19 * 35);
  759. DisplayNumber = 19;
  760. Balance = Balance + (Bet1324 * 3);
  761. Balance = Balance + (BetRed * 2);
  762. Balance = Balance + (Bet1936 * 2);
  763. Balance = Balance + (BetRow1 * 3);
  764. }
  765. if (Drawn == 20)
  766. {
  767. Balance = Balance + (Bet20 * 35);
  768. DisplayNumber = 20;
  769. Balance = Balance + (Bet1324 * 3);
  770. Balance = Balance + (BetBlack * 2);
  771. Balance = Balance + (Bet1936 * 2);
  772. Balance = Balance + (BetRow2 * 3);
  773. }
  774. if (Drawn == 21)
  775. {
  776. Balance = Balance + (Bet21 * 35);
  777. DisplayNumber = 21;
  778. Balance = Balance + (Bet1324 * 3);
  779. Balance = Balance + (BetRed * 2);
  780. Balance = Balance + (Bet1936 * 2);
  781. Balance = Balance + (BetRow3 * 3);
  782. }
  783. if (Drawn == 22)
  784. {
  785. Balance = Balance + (Bet22 * 35);
  786. DisplayNumber = 22;
  787. Balance = Balance + (Bet1324 * 3);
  788. Balance = Balance + (BetBlack * 2);
  789. Balance = Balance + (Bet1936 * 2);
  790. Balance = Balance + (BetRow1 * 3);
  791. }
  792. if (Drawn == 23)
  793. {
  794. Balance = Balance + (Bet23 * 35);
  795. DisplayNumber = 23;
  796. Balance = Balance + (Bet1324 * 3);
  797. Balance = Balance + (BetRed * 2);
  798. Balance = Balance + (Bet1936 * 2);
  799. Balance = Balance + (BetRow2 * 3);
  800. }
  801. if (Drawn == 24)
  802. {
  803. Balance = Balance + (Bet24 * 35);
  804. DisplayNumber = 24;
  805. Balance = Balance + (Bet1324 * 3);
  806. Balance = Balance + (BetBlack * 2);
  807. Balance = Balance + (Bet1936 * 2);
  808. Balance = Balance + (BetRow3 * 3);
  809. }
  810. if (Drawn == 25)
  811. {
  812. Balance = Balance + (Bet25 * 35);
  813. DisplayNumber = 25;
  814. Balance = Balance + (Bet2536 * 3);
  815. Balance = Balance + (BetRed * 2);
  816. Balance = Balance + (Bet1936 * 2);
  817. Balance = Balance + (BetRow1 * 3);
  818. }
  819. if (Drawn == 26)
  820. {
  821. Balance = Balance + (Bet26 * 35);
  822. DisplayNumber = 26;
  823. Balance = Balance + (Bet2536 * 3);
  824. Balance = Balance + (BetBlack * 2);
  825. Balance = Balance + (Bet1936 * 2);
  826. Balance = Balance + (BetRow2 * 3);
  827. }
  828.  
  829. if (Drawn == 27)
  830. {
  831. Balance = Balance + (Bet27 * 35);
  832. DisplayNumber = 27;
  833. Balance = Balance + (Bet2536 * 3);
  834. Balance = Balance + (BetRed * 2);
  835. Balance = Balance + (Bet1936 * 2);
  836. Balance = Balance + (BetRow3 * 3);
  837. }
  838. if (Drawn == 28)
  839. {
  840. Balance = Balance + (Bet28 * 35);
  841. DisplayNumber = 28;
  842. Balance = Balance + (Bet2536 * 3);
  843. Balance = Balance + (BetBlack * 2);
  844. Balance = Balance + (Bet1936 * 2);
  845. Balance = Balance + (BetRow1 * 3);
  846. }
  847. if (Drawn == 29)
  848. {
  849. Balance = Balance + (Bet29 * 35);
  850. DisplayNumber = 29;
  851. Balance = Balance + (Bet2536 * 3);
  852. Balance = Balance + (BetBlack * 2);
  853. Balance = Balance + (Bet1936 * 2);
  854. Balance = Balance + (BetRow2 * 3);
  855. }
  856. if (Drawn == 30)
  857. {
  858. Balance = Balance + (Bet30 * 35);
  859. DisplayNumber = 30;
  860. Balance = Balance + (Bet2536 * 3);
  861. Balance = Balance + (BetRed * 2);
  862. Balance = Balance + (Bet1936 * 2);
  863. Balance = Balance + (BetRow3 * 3);
  864. }
  865. if (Drawn == 31)
  866. {
  867. Balance = Balance + (Bet31 * 35);
  868. DisplayNumber = 31;
  869. Balance = Balance + (Bet2536 * 3);
  870. Balance = Balance + (BetBlack * 2);
  871. Balance = Balance + (Bet1936 * 2);
  872. Balance = Balance + (BetRow1 * 3);
  873. }
  874. if (Drawn == 32)
  875. {
  876. Balance = Balance + (Bet32 * 35);
  877. DisplayNumber = 32;
  878. Balance = Balance + (Bet2536 * 3);
  879. Balance = Balance + (BetRed * 2);
  880. Balance = Balance + (Bet1936 * 2);
  881. Balance = Balance + (BetRow2 * 3);
  882. }
  883. if (Drawn == 33)
  884. {
  885. Balance = Balance + (Bet33 * 35);
  886. DisplayNumber = 33;
  887. Balance = Balance + (Bet2536 * 3);
  888. Balance = Balance + (BetBlack * 2);
  889. Balance = Balance + (Bet1936 * 2);
  890. Balance = Balance + (BetRow3 * 3);
  891. }
  892. if (Drawn == 34)
  893. {
  894. Balance = Balance + (Bet34 * 35);
  895. DisplayNumber = 34;
  896. Balance = Balance + (Bet2536 * 3);
  897. Balance = Balance + (BetRed * 2);
  898. Balance = Balance + (Bet1936 * 2);
  899. Balance = Balance + (BetRow1 * 3);
  900. }
  901. if (Drawn == 35)
  902. {
  903. Balance = Balance + (Bet35 * 35);
  904. DisplayNumber = 35;
  905. Balance = Balance + (Bet2536 * 3);
  906. Balance = Balance + (BetBlack * 2);
  907. Balance = Balance + (Bet1936 * 2);
  908. Balance = Balance + (BetRow2 * 3);
  909. }
  910. if (Drawn == 36)
  911. {
  912. Balance = Balance + (Bet36 * 35);
  913. DisplayNumber = 36;
  914. Balance = Balance + (Bet2536 * 3);
  915. Balance = Balance + (BetRed * 2);
  916. Balance = Balance + (Bet1936 * 2);
  917. Balance = Balance + (BetRow3 * 3);
  918. }
  919. }
  920.  
  921.  
  922.  
  923. if (SpinFinish == 1)
  924. {
  925. Bet0 = 0;
  926. Bet1 = 0;
  927. Bet2 = 0;
  928. Bet3 = 0;
  929. Bet4 = 0;
  930. Bet5 = 0;
  931. Bet6 = 0;
  932. Bet7 = 0;
  933. Bet8 = 0;
  934. Bet9 = 0;
  935. Bet10 = 0;
  936. Bet11 = 0;
  937. Bet12 = 0;
  938. Bet13 = 0;
  939. Bet14 = 0;
  940. Bet15 = 0;
  941. Bet16 = 0;
  942. Bet17 = 0;
  943. Bet18 = 0;
  944. Bet19 = 0;
  945. Bet20 = 0;
  946. Bet21 = 0;
  947. Bet22 = 0;
  948. Bet23 = 0;
  949. Bet24 = 0;
  950. Bet25 = 0;
  951. Bet26 = 0;
  952. Bet27 = 0;
  953. Bet28 = 0;
  954. Bet29 = 0;
  955. Bet30 = 0;
  956. Bet31 = 0;
  957. Bet32 = 0;
  958. Bet33 = 0;
  959. Bet34 = 0;
  960. Bet35 = 0;
  961. Bet36 = 0;
  962. BetRed = 0;
  963. BetBlack = 0;
  964. BetEven = 0;
  965. BetOdd = 0;
  966. BetRow1 = 0;
  967. BetRow2 = 0;
  968. BetRow3 = 0;
  969. Bet112 = 0;
  970. Bet118 = 0;
  971. Bet1324 = 0;
  972. Bet1936 = 0;
  973. Bet2536 = 0;
  974. SpinFinish = 0;
  975. Spin = 0;
  976. RandLock = 0;
  977. Screen = 3;
  978.  
  979. }
  980. //}
  981. //}
  982. }
  983. if (Screen == 4 )
  984. {
  985.  
  986. if (RandLock == 0)
  987. {
  988. Drawn = rand.Next(0, 37);
  989. }
  990. CountSpin++;
  991. AfterSpin++;
  992. if (CountSpin == 900)
  993. {
  994. Drawn = rand.Next(0, 37);
  995. RandLock = 1;
  996. CountSpin = 0;
  997. }
  998. if(AfterSpin == 1200)
  999. {
  1000. SpinFinish = 1;
  1001. Screen = 3;
  1002. AfterSpin = 0;
  1003.  
  1004. }
  1005. }
  1006.  
  1007. if (keys.IsKeyDown(Keys.N) == true)
  1008. {
  1009. Screen = 3;
  1010. }
  1011. if(keys.IsKeyDown(Keys.M) == true && Screen == 3)
  1012.  
  1013. {
  1014. Screen = 4;
  1015. }
  1016. // TODO: Add your update logic here
  1017.  
  1018. base.Update(gameTime);
  1019.  
  1020.  
  1021. }
  1022.  
  1023.  
  1024.  
  1025.  
  1026. /// <summary>
  1027. /// This is called when the game should draw itself.
  1028. /// </summary>
  1029. /// <param name="gameTime">Provides a snapshot of timing values.</param>
  1030. protected override void Draw(GameTime gameTime)
  1031. {
  1032. GraphicsDevice.Clear(Color.CornflowerBlue);
  1033. if (Screen == 1)
  1034. {
  1035. spriteBatch.Begin();
  1036. spriteBatch.Draw(HomeScreen, HomeScreenR, Color.White);
  1037. spriteBatch.DrawString(Arial, "Next", new Vector2(690, 420), Color.White);
  1038. spriteBatch.End();
  1039. }
  1040.  
  1041. if (Screen == 2)
  1042. {
  1043. spriteBatch.Begin();
  1044. spriteBatch.Draw(Instructions, InstructionsR, Color.White);
  1045. spriteBatch.DrawString(Arial, "Next", new Vector2(690, 420), Color.White);
  1046. spriteBatch.End();
  1047. }
  1048. if (Screen == 3)
  1049. {
  1050. spriteBatch.Begin();
  1051. spriteBatch.Draw(BettingScreen, BettingScreenR, Color.White);
  1052. spriteBatch.DrawString(Arial, "Balance:" + Balance, new Vector2(50, 0), Color.White);
  1053. spriteBatch.DrawString(Arial, "Leave Table", new Vector2(0, 420), Color.White);
  1054. spriteBatch.DrawString(Arial, "Next", new Vector2(690, 420), Color.White);
  1055. spriteBatch.End();
  1056. }
  1057. if (Screen == 4)
  1058. {
  1059. spriteBatch.Begin();
  1060. spriteBatch.Draw(SpriteTexture, screenpos, null, Color.White, RotationAngle, origin, 1.0f, SpriteEffects.None, 0f);
  1061. spriteBatch.DrawString(Arial, "" + Drawn, new Vector2(375, 228), Color.White);
  1062.  
  1063. spriteBatch.End();
  1064. }
  1065. if (Screen == 5)
  1066. {
  1067. spriteBatch.Begin();
  1068. spriteBatch.Draw(FinalScreen, FinalScreenR, Color.White);
  1069. spriteBatch.DrawString(Arial, "$" + Balance, new Vector2(340, 160), Color.Red);
  1070. spriteBatch.End();
  1071. }
  1072.  
  1073.  
  1074. // spriteBatch.Begin();
  1075. // spriteBatch.Draw(Background, BackgroundR, Color.White);
  1076. // spriteBatch.End();
  1077. // TODO: Add your drawing code here
  1078.  
  1079. base.Draw(gameTime);
  1080. }
  1081. }
  1082. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement