• Post Reply Bookmark Topic Watch Topic
  • New Topic

Really have trouble understanding the problem with this code  RSS feed

 
Angel Baeza
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator




I am trying to take Stanford's free programming methodology courses online, and one of the
assignments is to make a small brick breaker game. Currently I am just trying to center a
round rectangle( the paddle ), but I'm instead finding a plus shape in its place. I don't quite understand
where the problem is and would appreciate the help
 
Piet Souris
Master Rancher
Posts: 2044
75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Angel,

welcome!

I don't know how a GRoundRect is defined, nor do you supply any paint-routine,
but what strikes me is that when I compare the definitions of the walls and the paddle,
then in the padle your third and fourth arguments are 0. As far as I can tell, that
means a width and a height of 0. Is that correct?

I don't know what consequences that has, but I doubt if that gives you a plus
sign...

So, first of all: check your parameters of your paddle. If you still see the same problem,
then show us the GRoundRect class, and the routine that paints the game board.

O, and if you do so, use codetags. That means: if you paste your code into the answer
panel, select that code and press the 'Code' button (located above the answer panel).
That will make your code much more readable.

Greetz,
Piet
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!