Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. public Brick()
  2. {
  3. x = 1;
  4. y = 1;
  5. width = 60;
  6. height = 20;
  7.  
  8.  
  9. brickImage = Breakout.Properties.Resources.brick_fw;
  10.  
  11. brickRec = new Rectangle(x, y, width, height);
  12.  
  13. MyBrick[] brickRecs =
  14. {
  15. new MyBrick()
  16. {
  17. Locations = new[]
  18. {
  19. new Point(60, 20),
  20. new Point(10, 10),
  21. },
  22. Image = Breakout.Properties.Resources.brick_fw,
  23. },
  24.  
  25. new MyBrick()
  26. {
  27. Locations = new[]
  28. {
  29. new Point(90, 90),
  30. new Point(10, 10),
  31. },
  32. Image = Breakout.Properties.Resources.brick_fw,
  33. },
  34. };
  35. }
  36.  
  37. public void drawBrick(Graphics paper)
  38. {
  39. //paper.DrawImage(MyBrick, brickRecs);
  40.  
  41. //paper.DrawImage(brickImage, brickRecs);
  42. }
  43.  
  44. public class MyBrick
  45. {
  46. public Image Image { get; set; }
  47. public Point[] Locations { get; set; }
  48. }
  49.  
  50. public partial class Form1 : Form
  51. {
  52. Graphics paper;
  53. Paddle paddle = new Paddle();
  54. Ball ball = new Ball();
  55. Brick brick = new Brick();
  56.  
  57. public Form1()
  58. {
  59. InitializeComponent();
  60. }
  61.  
  62. private void Form1_Paint(object sender, PaintEventArgs e)
  63. {
  64. paper = e.Graphics;
  65. paddle.drawPaddle(paper);
  66. ball.drawBall(paper);
  67. brick.drawBrick(paper);
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement