Help with encapsulation on lecture 12.
Help with encapsulation on lecture 12.
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.
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.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.
(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)
I have a feeling there might be something wrong with how you initialized the Poo objects. Are you constructing them in the constructor?Every time I run it the poo goes back to that same place.
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.
here is my solution in a rar file. Thanks for any help.
- Attachments
-
- poogame with classes and encapulation, constructors, adding more poos to game.rar
- (7.11 MiB) Downloaded 151 times
Re: Help with encapsulation on lecture 12.
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.
Thought I'd said that?
Nonetheless good job on fixing that yourself!
Nonetheless good job on fixing that yourself!