Hey guys, I've literally just signed up to the greenfoot forums in the hopes of getting an error checked out by someone who knows what it is they're doing.
I'm trying to implement a visual way of representing a percentage of a bar, somewhat akin to a health bar (and in the code shown, exactly like a health bar), in such a way where I'd be able to just change the parameters used in the World constructor to adjust how much of the bar is shown or not. However, despite the syntax being correct and the logic resulting in no actual divisions by zero as far as I'm aware, greenfoot keeps throwing errors at me. Here's my code:
What's weird about it is that it worked before I tried to used the updateBar() method to also draw a label next to the health bar that said "Health", but couldn't get it to work so I reverted the changes. If I change the "private int curVar;" to "private int curVar = 5;", the world compiles but no red bar is drawn.
