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
how do i use gifs?
By Weeb2.exe, with 5 replies.
Last reply by Weeb2.exe, about 6 years ago:
it worked thank you
how to make a health bar?
By Weeb2.exe, with 4 replies.
Last reply by Weeb2.exe, about 6 years ago:
ok thanks
game lag
By Roshan123, with 4 replies.
Last reply by danpost, about 6 years ago:
Roshan123 wrote...
but i have a question when i wrote this my game a lagging a lot. how << Code Omitted >> and when i cleared 25,26.27.28.and line number 29 ,it was not lagging << Code Omitted >>
It takes noticeable CPU time to access the
UserInfo
server. By trying to access it unconditionally every act step it becomes quite noticeable. By putting those lines inside the next if block (where game over is detected), you access it only when you need to.
Act out loop over multiple act 'frames'?
By whattheheck, with 1 reply.
Replied to by danpost, about 6 years ago:
You can use: <Code Omitted>after invoking
updateList
.
userinfo
By Roshan123, with 13 replies.
Last reply by danpost, about 6 years ago:
Roshan123 wrote...
which one will show the the high score in get data
Neither is yet programmed to show any score. Currently, you only have code to save one; and even that is flawed as
newScore
appears to be undefined at the moment. Also, I do not think an
act
method is the right place for saving a high score. It should have a method that is invoked only at game over which will check and save a high score only if that score is indeed a new high score. Maybe an
addedToWorld
method can be added to later create and set the actor's image.
how would i create an openable door
By Weeb.exe, with 85 replies.
Last reply by Weeb2.exe, about 6 years ago:
Oh My God! IT WORKED YESSSSSS THANK YOU SO MUCH you are awesome dan thank you so much for helping
Greenfoot Scenario in Netbeans
By aksi12uhr, with no replies.
Has anyone managed to run Greenfoot Scenarios in Netbeans? This used to work by calling the main-Method of
greenfoot.export.GreenfootScenarioMain
method and passing scenario name, name of world class and path to greenfoot-labels as parameters. One way was to configure your IDE as documented on https://www.greenfoot.org/doc/running_on_netbeans. I preferred using a simple starter class to pass the parameters <Code Omitted>Both ways worked fine until GF 3.5 Since version 3.6 Greenfoot 3.6 uses JavaFX and the class
greenfoot.export.GreenfootScenarioApplication
does not have a main-method any more. Does anyone know a working solution for GF versions 3.6?
how to download older scenario
By Roshan123, with 2 replies.
Last reply by Roshan123, about 6 years ago:
thanks for reply
Left & Right facing images
By genju, with 15 replies.
Last reply by danpost, about 6 years ago:
I think if you renamed your
setImg
method more appropriately (like to, say,
loadImages
), you might see one problem. Let me point out that this particular method is invoked exactly one time, from the constructor of the class. The attack images will certainly not load if you apply conditions above and beyond what is required (what does "with enemy" have to do with what images are loaded --the
boolean
is always
false
during constructing anyway). You just need to load all images for
Blue
or all images for
Red
; then set the initial image for the actor.
Removing objects
By scaps, with 7 replies.
Last reply by scaps, about 6 years ago:
alright it worked thanks a billion
How can i get the height and width of an object in another class?
By cantmember, with 1 reply.
Replied to by danpost, about 6 years ago:
Enemy
is a
Class
name (or a
Type
). A class does not have an image. Instances created from the class do. Use
getOneIntersectingObject
to obtain a reference to the "seen"
Enemy
instance.
Continuation: accessing integers in other classes
By scaps, with 4 replies.
Last reply by scaps, about 6 years ago:
it worked thanks a million
Neat way of getting a character at a specific index?
By 444Jam444, with 2 replies.
Last reply by 444Jam444, about 6 years ago:
Thanks.
The "if" statement is not working this instance
By Top_Gerald, with 4 replies.
Last reply by Top_Gerald, about 6 years ago:
Thank you danpost for the comprehensive reply! Also, thanks Jarvissss for the attempt. I managed to get the code working by putting a "public void act()" into my world class and putting the "sourceSpawn" in there.
Need help with static method
By Shabaz616, with 2 replies.
Last reply by danpost, about 6 years ago:
MyWorld
is a
Class
name and only shares its name as the type of objects it creates. In general (that is, without specifically programmed restrictions), a class can create multiple objects. Given two worlds: <Code Omitted>The use of the
Class
name (or
Type
of object) is not sufficient to distinguish what world instance you might, say, want the width of.
124
125
126
127
128
129
130
X