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
For loop
By UKPowerMax, with 3 replies.
Last reply by danpost, over 13 years ago:
Sorry for the multiple partial postings (I accidentally tried to use the tab key in the posting and that selects the 'Post' button, where I must have hit 'Enter' a couple of times). I forgot to mention that the code above should be in an act() method or in a method that an act() method calls.
Deactivating the reset button.
By kiarocks, with 5 replies.
Last reply by kiarocks, over 13 years ago:
<Code Omitted>Also, this might work:
Image variable
By gazza162, with 1 reply.
Replied to by mjrb4, over 13 years ago:
Technically speaking an image comprises part of the state of an actor, so the answer would be yes! You can use the getImage() method to grab the current image on the actor, and then take an action based on what image it is. However, using the current image of the actor to determine what state it's in isn't necessarily the best idea because it couples each image to a certain state, without the possibility of changing it later (without refactoring the code.) You may be better to store the "state" that you want separately, such as in an integer - and then use an if statement over that integer
What? Scenario not loading when uploaded?
By TheNightStrider, with 46 replies.
Last reply by davmac, over 13 years ago:
I just woke up... glad to hear it's sorted.
is it possible to get rid of the run and pause and reset buttons?
By marzukr, with no replies.
I want to get rid of these because I have a menu to my game and when other people play it they always say to get rid of it because they don't want to click twice. If there is then how?
Problems with export to .jar
By lux, with 4 replies.
Last reply by lux, over 13 years ago:
ok, finally the
scenario
works.. thanks for the help davmac!
Looking for invaders source code scenario circa 2008
By ray_parsons@gwinnett.k12.ga.us, with 1 reply.
Replied to by davmac, over 13 years ago:
Do you mean as in a Space Invaders type of game? I'm not aware of any "official" Greenfoot version but there are a few on the gallery - type "invaders" into the search box (top of this page) and you'll see them.
Read Only
By akinyemi, with 3 replies.
Last reply by Tobbe, over 13 years ago:
Thanks davmac, I just realized that I could Save as a copy in other location and start editing it there. As you say, RTFM :)
how to make game
By Imp, with 3 replies.
Last reply by matt.milan, over 13 years ago:
what kind of game do you want to make
Log In problem
By dlanni, with 2 replies.
Last reply by dlanni, over 13 years ago:
Thanks, my mistake
Score System
By Sciyaps, with 1 reply.
Replied to by danpost, over 13 years ago:
You will find what you need
here
.
How can I make a object "solid"?
By Sciyaps, with 1 reply.
Replied to by dlanni, over 13 years ago:
There is a method in Class Actor called getOneIntersectingObject and several others that might fit your situation. You can use these methods to sense when one object intersects another. Maybe make a method based on the ever popular crab scenario's canSee method, whose code is downloadable (although they usually use the less useful getOneObjectAtOffset). My game, PyroTyro, uses the first method. The code is available; just open the House class. After one car "canSee" another (they collide), you can remove both of their images and replace them with a crunched up car image, just as I have rep
Referencing a world from another?
By TheNightStrider, with 1 reply.
Replied to by TheNightStrider, over 13 years ago:
Sorry - You just do it normally!
How to avoid image flickering
By nachocab, with 7 replies.
Last reply by nachocab, over 13 years ago:
Thnaks a lot for your replies, I was thinking in an array of images like davmac said. I'm not sure if there is a difference in usgin == or equals but the use of equals sounds more for usefull for Strings. Thanks a lot for the tips Duta and davmac!!!
move(double distance)
By Duta, with 3 replies.
Last reply by davmac, over 13 years ago:
We do have a bug in recent versions of Greenfoot
Indeed, the code above contains the same bug. Line 04 should be removed, because setLocation(...) already takes cell size into account.
Yeah the problem is it doesn't actually go in the direction you're facing necessarily (especially at angles like 30 degrees and similar). Will this be fixed in the next release?
That is an issue with accuracy of position; you can fix it by moving in larger increments, or by using the SmoothMover class. It won't be "fixed" in the next release because it's arguably not a bug.
998
999
1000
1001
1002
1003
1004
X