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

danpost's Comments

Back to danpost's profile

Believe it or not, all coding for this scenario is in one World sub-class constructor. The score-counter, time-counter and blue-dot are Actor objects that each control themselves. A later update will reveal the code.
@Kartoffelbrot, the code is open source.
BTW, you must start the sound using this reference also or it will not stop using the reference bgSound.playLoop();
In addition to what FRUP said, the sound needs to be set in a GreenfootSound object reference field: [code]GreenfootSound bgSound = new GreenfootSound(/* name of sound file */);[/code] so it can be referenced later, in order to use the 'stop' method: [code]bgSound.stop();[/code]
Have you crashed? What three levels?
@Upupzealot, I think a beginner programming instructor is posting all of his/her students scenarios.
Had to completely leave the page and come back to it :/
How do you control the gray cube? I tried arrow keys and ASDW -- neither work for me.
Would be nice to have a key for random distribution of 'on' cells. Also, noticed that neighbor counting is somewhat flawed along the edges (could not say why). Place two along an edge and four more extending away from that edge forming a 2 by 3 rectangle of 'on' cells with 2 along the edge. On the next cycle, the inner two should go away and two should appear next to where they were extending away from the middle of the rectangle; but this does not happen.