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

Super_Hippo's Comments

Back to Super_Hippo's profile

Yes, it does run faster directly in GF. Unfortunately, even optimizing your code (if it is even possible in any way) won't really make a difference because all uploaded scenarios run slower since the conversion to JS. You can even notice a difference at speed 50 which makes playing games on the site often easier than they are in GF.
For me, one line (from one side to the other, when it is moving almost through the middle) needs a little bit less than third of a second. (Just counted 60 in 22 seconds.)
Something along these lines could work: ------- String key = Greenfoot.getKey(); if (key != null) //any key was pressed { if (correctKey.equals(key)) { //correct key was pressed } else { //any other key was pressed } } -------
Well, despite the fact that the game doesn't know what to do when you actually solve all numbers. Mainly because I don't know how I should handle that in the score system.
So far your score is lost if you don't have a connection to the GF server at the time the game ends. Maybe I will make it possible to keep the score to try submitting it later. Other than this, everything should work now. (I hope.)
Oh and the width of the world is too small. The numbers on the right side are cut off a bit.
You are welcome :) To fix the gray rectangles of the numbers, you can change line 32 in the Number class to: tile.drawRect(1,1,42,42); With (0,0,45,45), the bottom and right edge is outside the image = not visible. In theory, the same applies to line 40. In practice, drawing something in gray on an image which was filled in gray right before, doesn't have a big impact anyway though. The alternative is to draw those rectangles on the background of the world.
The other (not so complex one) is also online again: 13445
Actually I remember that the second one will never work online for some unknown reason. But you can download it. (Scenario number 19646)