Page 1 of 1

Help with encapsulation on lecture 12.

Posted: August 8th, 2017, 5:46 am
by jamir
Whenever I run the program it works but their is only one poo in the top left corner when there are supposed to be three on the screen. Every time I run it the poo goes back to that same place.

Re: Help with encapsulation on lecture 12.

Posted: August 8th, 2017, 8:36 am
by Zedtho
Whenever I run the program it works but their is only one poo in the top left corner when there are supposed to be three on the screen.
Do your 3 Poos have different coordinates? It seems they've all defaulted to 0, 0. Maybe that's why it seems to only be one? I can't give you any more help as long as we can't see the source code, though.
(Either by github.com or by sending it through an attachment like Chili tells you to in one of the "Sticky" topics in the forum)
Every time I run it the poo goes back to that same place.
I have a feeling there might be something wrong with how you initialized the Poo objects. Are you constructing them in the constructor?

Anyways, it'd be nice if you could send the source code so that we could have a look at it.

Re: Help with encapsulation on lecture 12.

Posted: August 8th, 2017, 9:17 pm
by jamir
here is my solution in a rar file. Thanks for any help.

Re: Help with encapsulation on lecture 12.

Posted: August 9th, 2017, 3:08 am
by jamir
never mind thanks @zadtho I figured it out. They were all equaling (0,0) for x and y. It was a simple expression mix up in my constructor.

Re: Help with encapsulation on lecture 12.

Posted: August 9th, 2017, 7:53 am
by Zedtho
Thought I'd said that? :?:

Nonetheless good job on fixing that yourself!