This site requires JavaScript, please enable it in your browser!
Greenfoot back

mjrb4's Comments

Back to mjrb4's profile

Very well done with that - works nicely!
Nice load / save mechanism :-)
mjrb4mjrb4

2009/6/3

I can see where you're coming from on the above points definitely - and if you've come from another language background then learning things differently just in terms of style will always seem a bit odd. Personally I'd say it pays to learn the fairly "set" conventions of another language if you want to deal with it seriously - but at the end of the day it's not unreadable at all, and as long as it makes sense to you and anyone else that needs to look at it you shouldn't run into many problems on that front :-)
mjrb4mjrb4

2009/6/2

If I was being picky, then I'd say it actually did make it harder to follow - when I see "this dot something" I generally expect it to be a global variable name that's been shadowed by a local variable or a similar situation. In the cases where the methods are actually in the same class, you could argue along the side that it's clearer and reinforces that you're calling the method in the same class. Similarly you could argue along the lines of using super to reinforce the fact that it's in a superclass and not in this one. Personally I wouldn't do either of the above because a) it can bite you sometimes if you have to refactor and b) personally I think the code should be nice enough to follow without such prompts. However, when things really do start to get confusing is when you use this to reference methods that aren't actually in that class - then you're essentially making it more confusing by adding it! For example, in your Monster class at the time of writing you've got the following line: this.forgetAttackers(); ...but the forgetAttackers method isn't actually in that class at all, it's in the superclass - so I'd say using the this keyword in this instance is definitely more harmful than it is useful. One other point relating to style, it's generally a good idea to put all global variables at the top of the class, not half way down - this just makes them easier to see and distinguishes them from the methods. That said, on the other hand well done with the commenting (looks like you've got javadoc comments in there for most methods) and indentation, that's definitely a plus! Looking forward to the next release :-)
mjrb4mjrb4

2009/6/2

Looks like a good start! Practically speaking though the background makes it quite hard to see the details of what's going on or make some things out at all, perhaps a lighter colour would be better?
Hmm, the score seems to be going up with the same frequency whether I hit the moles or not!
mjrb4mjrb4

2009/6/2

A point on the terrain?
The keyboard controls do work, but only in "real" mode (see the above comments for details.)
I don't watch south park so probably don't get it - but it's possible to stay in one place and collect them all without moving, is this the idea? :-)