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

danpost's Comments

Back to danpost's profile

@TehRyan, locally it is stored as an Excel cvs file. On the site it is stored as a database (sql format).
Re-uploaded to adjust speed.
Of course it is possible to have the music start on. Just call 'play' on a BGMusic object: new BGMusic().play();
Although, it looks like you have already added it as well as the arc bar volume indicator.
@JeppDev, of course. That why I put it up on the site. Just add the BGMusic class to your project as is (no changes need to be made to it). The image in the 'images' folder is meant to go along with the class. Add it to the 'images' folder of your project.
@K_wow, they are equal: 2*sqrt(2) = sqrt ( (2^2) *2) = sqrt (4*2) = sqrt(8)
@meazalplaq, this scenario was not uploaded with the ability to open it in greenfoot. The option to include the source was not checked by the creator when uploading.
@K_wow, see my last post. Another way of writing it could be 'speed/Math.sqrt(2)' (dividing, not multiplying).
Yes, in order to move diagonally the same distance as one pixel distance horizontally or vertically, you must multiply the distance by one half the square root of two, or approximately 0.7071; because that value squared is two-fourths, or one-half, and two halves is a whole. I do not know why you would complicate it by moving speed inside the square root function and squaring it when you can just leave it outside. That is, instead of 'Math.sqrt((speed*speed)/2)', you can just use 'speed*Math.sqrt(1/2)' or 'speed*Math.sqrt(2)/2'.