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

What is happening right now?

ttt_

reply to problem with neighbor count

By ttt_ - about 7 hours ago
danpost wrote...
ttt wrote...
The Actor method getNeighbours() gives strange results in certain situations. << Code Omitted >>
I do not seem to be getting any strange results. Maybe you can give examples. Like, for what image do you get for what strange results (that is, give image AND results). The results can be given as in the following: For image "yellow-draught.png", I got 2 in the corners, 3 along the edges and 4 in the interior. I got these results regardless of the image size.
Sorry, there was a screenshot attached, but this didn't work. Huh? For the moment there is a small image in my profile. Examples (all with yellow-draught.png) are as follows: cellsize=59 2333333332 3444444443 3444444443 3444444443 3444444443 3444444443 3444444443 3444444443 3444444443 2333333332 (the expected result) cellsize=60 2333233332 3444344443 3444344443 3444344443 2333233332 3444344443 3444444443 3444344443 3444344443 2333233332 (not the expected result) cellsize=61 cellsize=62 correct result cellsize=63 2333333332 3444444343 3443444343 3434334333 3444444343 3443444343 3444444443 2333333232 3444444343 2333333332 (wrong, but different from cellsize 60) cellsize=64 cellsize=65 cellsize=66 correct result cellsize=67 2333333322 3444434433 3323323322 3434434433 3434434433 3323323322 3444434433 3434434433 2323323322 2323323322 ??? Can anyone confirm this? Got the same results on a different machines. Tried Greenfoot 3.7.1., 3.8.x, 3.9.0 - all the same.
danpost

reply to Stopping a walking soundloop upon death

By danpost - about 13 hours ago
Sendaris8 wrote...
What do you mean by 'call this new method from wolf/bear classes'?
I mean add the "new method" above, die(), to your Guy class. Then you can use something like the following in the Bear and Wolf classes: <Code Omitted>
danpost

reply to Using an array switch to a new world

By danpost - about 20 hours ago
Looks like I missed one case world: <Code Omitted> And actually, the final range is 1 to 36 as 49 is the character code for '1' (not 48) which shifts everything up by 1. (48 is the character code for a '0' (zero)).