Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualHappyCoder

Posted 26 June 2013 - 10:35 AM

Is there a specific error you are having?

I don't see any major issues in the code, although I did just a quick glance over it.

I think you made a good move by making a single draw paddle function then passing parameters to it. I also like how you declared constants at the top of the file for the width and height of the paddle.

Something I would recommend on your next project is learning how to use javascript prototypes to use a more object oriented programming style. Pong and snake are simple enough that they are easily manageable without good object oriented design practice, but when you attempt to take on a larger game project it will be really hard to manage if you don't have a good object oriented design.

Good work so far, and if you are experiencing a bug at the time please post what it is so I can look at that code in more detail.

EDIT:

I just noticed that you have inconsistent capitalization on your variable names.
When you declare paddleWidth and paddleHeight you have the first letter lower case, but when you use them in drawPaddle half of them are capitalized to be PaddleWidth or PaddleHeight. JavaScript is case sensitive so you will need to make the capitalization consistent.

#1HappyCoder

Posted 26 June 2013 - 10:32 AM

Is there a specific error you are having?

I don't see any major issues in the code, although I did just a quick glance over it.

I think you made a good move by making a single draw paddle function then passing parameters to it. I also like how you declared constants at the top of the file for the width and height of the paddle.

Something I would recommend on your next project is learning how to use javascript prototypes to use a more object oriented programming style. Pong and snake are simple enough that they are easily manageable without good object oriented design practice, but when you attempt to take on a larger game project it will be really hard to manage if you don't have a good object oriented design.

Good work so far, and if you are experiencing a bug at the time please post what it is so I can look at that code in more detail.

PARTNERS