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
Memorize Variables
By Hermoduro, with 1 reply.
Replied to by danpost, over 8 years ago:
1) create new world; 2) set values in new world to those in current world; 3) set new world active
Bejeweled Board
By JosephTheVA, with 2 replies.
Last reply by danpost, over 8 years ago:
JosephTheVA wrote...
If I was to try to generate a board with the code, where would I need to start?
As with any scenario, you start in your World subclass constructor. Your world can be either with pixel-sized cells or use a grid of large-sized cells. You would then add code to build the world and add Actor subclasses as needed. Only one subclass of Actor is needed for all gems -- or, rather, the main playing tiles. A field of int or String value, or just its image (which can be given randomly), can be used to identify which type piece the tile is.
Why does my Greenfoot Terminal throw these errors given the following code(s)?
By t_k_990, with 1 reply.
Replied to by Super_Hippo, over 8 years ago:
You are creating black keys even when there shouldn't be one. Then the string is "" and you can't use "" as a parameter of the isKeyDown method. When creating the black keys, prevent them from creating when the string in the array is "". <Code Omitted>
Question int and subclasses
By Dr.Dre, with 1 reply.
Replied to by Super_Hippo, over 8 years ago:
Each object (from this class and its subclasses) will have its own variable, but all classes can access it.
Random Numbers
By Dr.Dre, with 2 replies.
Last reply by Dr.Dre, over 8 years ago:
thanks
Helper Classes
By okwuvic, with 6 replies.
Last reply by okwuvic, over 8 years ago:
Thanks so much @danpost. I understand now. God bless you.
Snake game
By messthegamer61, with 1 reply.
Replied to by danpost, over 8 years ago:
messthegamer61 wrote...
can one of you guys send me the code for the snake game please.
You need to do what you can first and in while doing so, if you run into issues, we help resolve the issues. Do not ask to have others do all your work for you..
How to make object disappear
By Diactaeon, with 2 replies.
Last reply by Diactaeon, over 8 years ago:
I tried moving 'collision' to the end of the act method and it worked Thanks!
Character slips off edge of platform
By Kestroz, with 2 replies.
Last reply by Kestroz, over 8 years ago:
Ok, thanks will make sure to check out your demo
I'm stucked.
By mariusvid, with 1 reply.
Replied to by danpost, over 8 years ago:
You could make use of the 'ask' method of the Greenfoot class. Sample usage might be: <Code Omitted>See the Greenfoot class API documentation for more details.
Random Array
By ORSODO, with 3 replies.
Last reply by ORSODO, over 8 years ago:
Thank youu! :D
Greenfoot editor is not showing code
By dan1701, with 4 replies.
Last reply by dan1701, over 8 years ago:
Thanks for the reply Thats is also not working. I can't drag the frames to another position.
Trying to write a proper collision detection
By Xolkiyr, with 6 replies.
Last reply by danpost, over 8 years ago:
Xolkiyr wrote...
That's the way the code is supposed to be, you have to be hovering over the ore to be able to see how much is there. and it even updates as you're mining.
Okay -- glad to know you are happy with it.
Life counter
By ORSODO, with 8 replies.
Last reply by ORSODO, over 8 years ago:
Thx
Static get world
By Paul12345, with 1 reply.
Replied to by danpost, over 8 years ago:
Paul12345 wrote...
I can't seem to memorize the current world in a static variable. Could i please get an example?
<Code Omitted>
288
289
290
291
292
293
294
X