This site requires JavaScript, please enable it in your browser!
Greenfoot
Username
Password
Remember Me?
Sign Up, Lost Password
Activity
About
Documentation
Download
Discuss
Scenarios
Discussions
You need to login to take part
Current Discussions
Delete account
By Caionumero, with no replies.
Hello, Can the administrator delete my other account?
Null Pointer Exception
By AdiBak, with 3 replies.
Last reply by Super_Hippo, over 7 years ago:
Change <Code Omitted>to <Code Omitted>
Game runs slow/fails when switching worlds
By renniemm, with 5 replies.
Last reply by Super_Hippo, over 7 years ago:
The shm is not in the installation folder, it is the project.greenfoot file which you open when you open your scenario in Greenfoot. (Unless this is different with a Mac, I use Windows.) But for your problem: Try to
increase
the world size and/or
decrease
the number of objects you add and/or
decrease
the minimum space between objects. In a bad case, an object can't find a possible place and it keeps searching for it forever. If the total number of objects doesn't matter that much, you could also do something like this in the addedToWorld method. Then it will stop search
getObjects() doesnt work
By SparrowBoy, with 4 replies.
Last reply by SparrowBoy, over 7 years ago:
Thank you very much! It works now. :D
Variable, Hitbox, and Actor problems
By NovaEnigma, with 3 replies.
Last reply by Super_Hippo, over 7 years ago:
Removing every "static" from your code would be a good start. None of these variable should be a class variable. Also, a Shuriken is not a Character and a Fireball is not a Boss. So they shouldn't be subclasses.
NovaEnigma wrote...
Finally, there are some hitbox issues i have and everything i read doesn't make sense unless i see code with my game actors and code.
I don't really understand this sentence. In your code, I only see the Shuriken checks if it hit the Boss (hurt method). Obviously it will also hurt the boss if it is only hitting a Fireball because your Fireball is a subclas
Sorting Blocks
By Abwatts, with 1 reply.
Replied to by Super_Hippo, over 7 years ago:
The merge sort algorithm basically cuts lists in half and sorts them. You won't be able to implement the algorithm without creating more lists in the process. The Wikipedia article is pretty helpful I would say:
https://en.wikipedia.org/wiki/Merge_sort
How do I cite the move() method on an Actor
By compsci9001, with 3 replies.
Last reply by danpost, over 7 years ago:
compsci9001 wrote...
<< Code Omitted >> In this part could I just change the int to a different number for the wombat to move a different amount of spaces on the grid?
Try it. Use the
Act
button for testing. (I presume that the method is being called from the
act
method).
Python Vs. Java
By 19balsamoa, with 1 reply.
Replied to by danpost, over 7 years ago:
Although I am not too familiar with
Python
, I doubt, in general, one is much more difficult than the other. I would guess that it would depend more on the individual (preference in style and previous programming knowledge).
Illegal State Exception
By AdiBak, with 16 replies.
Last reply by Super_Hippo, over 7 years ago:
I am a bit lost in your code to be honest. What is the purpose of the State class and its subclasses? Why don't you just put that in the world subclass? It is also weird that you have several variables in which you save the world, but you still use 'getWorld' instead most of the time. I couldn't reach 6000 points yet, so I have no clue what is causing it. Is anything special happening at 6000? Lag usually happens if too many actors are in the world at the same time. For example if actor A is spawning another actor A every act cycle, then the scenario will basically stop after a second. By th
mouseClicked(this) not working
By TheFormalCorgi, with 6 replies.
Last reply by TheFormalCorgi, over 7 years ago:
Thanks for the code Super_Hippo! That helped my figure out that when I was clicking inspect sometimes I was also clicking on the object (I feel dumb now) and that's why it seemed like the Pause button was changing it because when I clicked play it would register that click.
Why is this site and the program called Greenfoot?
By dominatioN, with 2 replies.
Last reply by dominatioN, over 7 years ago:
OK thank you.
replaying previous levels while keeping old ones unlocked
By ErasedBlade, with 1 reply.
Replied to by danpost, over 7 years ago:
With my
Levels
support class, the main
Levels
world was only meant to be created once at the very beginning of a run. All other
Levels
objects were to be from its subclasses. The
Levels
class itself was intended to create a header world and be a place where all common methods and fields can be maintained (it seems your
er#
fields might be a candidate for promotion to the Levels class). You may want to create a separate world for the level selection process.
does move() only move the actor in angles that are multiples of 45
By TheGoldenProof, with 9 replies.
Last reply by TheGoldenProof, over 7 years ago:
Thank you so much! I was about to totally lose it. I forgot that that class existed. It all works great now!
Timer keeps adding 0.02
By renniemm, with 4 replies.
Last reply by renniemm, over 7 years ago:
Thanks, it works!
getting a character to shoot the way im aiming
By EthanWasHere_, with 3 replies.
Last reply by Super_Hippo, over 7 years ago:
The act method of the bullet (or in your case the laser) should only be moving straight and maybe detect collisions. Since its rotation is set at its creation, you don't need to check in which direction it should travel. Your "else if" is exactly the same as the "if" before, so it will never do anything.
198
199
200
201
202
203
204
X