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 can i change the background during game
By alicia007, with 1 reply.
Replied to by danpost, over 5 years ago:
alicia007 wrote...
i want to change the background during my game at a specific action.
Use this
setBackground
method or this
setBackground
method.
Newton's Lab: this(new Vector()) what does this mean??
By disassociated, with 5 replies.
Last reply by danpost, over 5 years ago:
disassociated wrote...
Can you open that up or give a hint about the concept where I can read more? The run sequence is like this right? Space/ Constructor Vector / Constructor SmoothMover / Constructor Body / Constructor
Let me just point out a thing here. When an
Object
instance is created, it is created from the bottom up. All extending classes are built on their supers. So, when you create a body, the
SmoothMover
portion is created before the
Body
portion. Think of it as such that the
Body
object inherits pre-defined traits provided by the
Smo
Greenfoot code
By Sauravbasyalking12, with 5 replies.
Last reply by Sauravbasyalking12, over 5 years ago:
Thank you so much dan I got it
The jump should be made slower
By Flantox, with 1 reply.
Replied to by danpost, over 5 years ago:
The one way that will most surely work is to use a smooth movement system on the actor so that you can use a "fractional" acceleration value. A slower than one acceleration will make your actor jump a bit higher, while doing so at a slower speed. See my
GQActor Superclass Demo
scenario for a demo (or download to look at or use). Adjust the gravity value, which is vertical acceleration, for the effect.
little-crab scenario
By Codec, with 5 replies.
Last reply by Codec, over 5 years ago:
Thanks guys it worked.
Greenfoot code
By Sauravbasyalking12, with 2 replies.
Last reply by Sauravbasyalking12, over 5 years ago:
Thank you so much kostya
How to start music if the scenario runs?
By TerminatorHD, with 19 replies.
Last reply by danpost, over 5 years ago:
TerminatorHD wrote...
Yeah sure, I will look into it. Would you tell me how I can interact with my classes? I thought its public first but I didn't found anything. So..should I use "static" for those purposes?
Again, probably not. But, cannot tell for sure. Must be considered individually.
How to use getNeighbours() to check if any of the neighbours are from a specific class
By MonkeiProtecc, with 5 replies.
Last reply by danpost, over 5 years ago:
MonkeiProtecc wrote...
<< Quote Omitted >> so what does this exactly do? So i can understand it :). Also what I meant was i want to check all the 8 neighbours of a black cell. And for every white neighbour within the 8 cells, a variable (i) should increase by 1.
Well, your title suggested you wanted to know if any White objects were neighbouriing a Black (order of colors not being pertinent). However, now you specify you need a count of them. For number of neighbors: <Code Omitted>This will give the current number of Wh
Embed Greenfoot Program into my new created website
By Bolla13, with no replies.
Is it somehow possible (I hope it is :-)), that I embed my Greenfoot program into a self-created website, like you are doing here. Is there a manual for this. Thanks for your help
how to check for a value in array
By Kaggs, with 4 replies.
Last reply by Kaggs, over 5 years ago:
<Code Omitted>it worked just did a shuffle methods and now i get random number from 0-9
Danpost plz help me in blue j
By Roshan123, with 3 replies.
Last reply by danpost, over 5 years ago:
There are some control codes below 32 that will either not print or perform their intended operations (BS=8, LF=10 and CR=13, to name a few). There may be one more that lies between 32 and 100. There are many above 256 that are either unassigned or will display as a small unfilled box. I do not think you can do anything about how they display in the greenfoot terminal.
little-crab scenario, changing the crabs image
By Bambus, with 2 replies.
Last reply by Bambus, over 5 years ago:
Thanks. It wokred (:
Background sound fades when another sound is played
By Libraoct7, with no replies.
I have created a simple game in which an object (boy) eats all the cherries avoiding snakes and bombs. When the game starts, a background sound is played. When the boy eats a cherry, a pop sound is played. But when the pop sound is played, the background music is faded where you can't even hear it until about 7 seconds later that would the background sound is heard. Please help me to fix this problem. This is my MyWorld class: <Code Omitted>This is the Cherries class: <Code Omitted> And this the boy class: <Code Omitted>
Hi I am stuck in this scenario
By Sauravbasyalking12, with 3 replies.
Last reply by danpost, over 5 years ago:
Sauravbasyalking12 wrote...
I need to change the code instead of greenfoot.stop in instead of game ending << Code Omitted >>
Drop it and ask if any crabs are left in the world.
NullPointerException with getObjects()
By nebuto, with 4 replies.
Last reply by nebuto, over 5 years ago:
Perfect! Got it. Thanks a lot. And after trying to write a homing calculation for my Missile with a lot of Analysis/Trigonometrie, i finally found the turnTowards-Method :-)
112
113
114
115
116
117
118
X