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
DansPost - ImgScroll (Questions)
By OnFight, with 4 replies.
Last reply by OnFight, over 7 years ago:
danpost wrote...
OnFight wrote...
I am still curious what is behind the making of the second scroll? If something goes wrong it corrects? Like if somehow you manage to get outside of the limits?
The second
scroll
is used to allow your main actor some wiggle room before scrolling takes effect. That is, with that method, scrolling will not begin until your main actor moves some allowable distance away from the center of the window.
Oh, i should've had calculated that was it, (the demo had an option for bigger region).
Get the angle of an actor
By ckverdad, with 3 replies.
Last reply by danpost, over 7 years ago:
ckverdad wrote...
Thanks man! The greenfoot api needs to be a little clearer in it's descriptions, nonetheless, thanks a lot!
Seems quite clear to me:
Return the current rotation of this actor.
Rotation is expressed as a degree value,
range (0..359)
.
Zero degrees is towards the east (right-hand side of the world), and the angle increases clockwise.
Oh. and -- your welcome. Note: I just noticed I missed the parentheses after the
getRotation
's in my code.
How to make objects appear after clicking all the given actors
By Zsazsz, with 1 reply.
Replied to by danpost, over 7 years ago:
Presuming
nextlvl
is your button, it looks like you are adding the button into the world right at the start. I presume that no actor will be in the world after all items have been clicked on. Therefore, if you add the button at that time, the condition to add the button goes away (the fact that no actors are in the world). So, you can simply add something like this:
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.
198
199
200
201
202
203
204
X