Sign in to follow this  
phil67rpg

pool game and c#

Recommended Posts

I am programming a simple pool game I am trying to animate the cue ball but I need some help, here is some code, if you need more info please ask private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { this.BackColor=Color.Black; Graphics g=e.Graphics; SolidBrush greenBrush=new SolidBrush(Color.Green); SolidBrush redBrush= new SolidBrush(Color.Red); Pen brownPen = new Pen (Color.Brown,20); Rectangle rect=new Rectangle(225,10,300,550); g.DrawRectangle(brownPen,rect); g.FillRectangle(greenBrush,rect); g.FillEllipse(Brushes.Red,400,50,20,20); g.FillEllipse(Brushes.Blue,380,50,20,20); g.FillEllipse(Brushes.Pink,360,50,20,20); g.FillEllipse(Brushes.Orange,340,50,20,20); g.FillEllipse(Brushes.Plum,390,70,20,20); g.FillEllipse(Brushes.Black,370,70,20,20); g.FillEllipse(Brushes.Purple,350,70,20,20); g.FillEllipse(Brushes.MistyRose,380,90,20,20); g.FillEllipse(Brushes.LightYellow,360,90,20,20); g.FillEllipse(Brushes.SkyBlue,370,110,20,20); for (int i=500;i>=130;i--) { g.FillEllipse(Brushes.White,370,i,20,20); } }

Share this post


Link to post
Share on other sites
What specifically are you having troubles with? Is the cue not animating correctly? Is it's motion on the screen incorrect? Is the program simply not compiling? Try to be as specific as possible - it will encourage the knowledgeable folks to answer your question in an expedient manner.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this