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
Fonts in Greenfoot
By Agent40, with 1 reply.
Replied to by davmac, over 8 years ago:
What do you mean by "changing the default Font"? You're correct that you can't change the default font, i.e. the font that you get when you use the default Font constructor. You can also use
an alternative constructor
to specify a font name, though it will only find system fonts (i.e. you can't make it use a TTF font included in your scenario). You can use a font created in this way to draw on an image. However, the GreenfootImage constructor which creates an image from text always uses the
How to add a countdown timer and record the results
By allsterrrr, with 2 replies.
Last reply by allsterrrr, over 8 years ago:
Ok, thank you so much!
code not working
By seslu, with 1 reply.
Replied to by danpost, over 8 years ago:
The intersecting object, if found, is an
Actor
object -- and more specifically, a
Key
object (an object of type
Key
). Your condition in the
if
clause is whether
Key
is
null
. The compiler only knows
Key
to be a
Class
object. It is not defined more locally to be anything else. But you cannot remove a
Class
object from the world -- you can only remove an
Actor
object (or an instance of a subclass of
Actor
) from the world. Look over the given code and see if you can determine exactly what you want the condition to
Need Help with Variable access from world to classes and transfer into different worlds
By Shade1177, with 9 replies.
Last reply by Shade1177, over 8 years ago:
HO... thank you danpost!!! this does solve my first problem! THANKS. ahh, I have been troubling over this all day and it has frustrated me at every turn thank you for relieving me of this stress. although now I still have the multi-world problem... but ill come back to that once I finish a little more variables... ill prolly post that problem later if I cant solve it. (mostly cause I don't have any idea of how to do it), but as said later. for now ill keep working on the code. then again thanks danpost and yehuda for helping me. I'm glad I was able to get this off my back.
Help with error/code
By hosfeldli, with 9 replies.
Last reply by danpost, over 8 years ago:
The problem is you have 3 distinct reasons for removing the actor from the world, but you cannot check subsequent conditions if a previous condition was true and the actor was removed -- mainly using
getX
. You can concatenate the possible conditions for removing the actor so that no other code needs to execute after the removal. Replace lines 69 through 90 with this:
Sound won't play when mouse is clicked
By soufou27, with 4 replies.
Last reply by soufou27, over 8 years ago:
danpost wrote...
soufou27 wrote...
The name of the actor is Emoticon, so what should I write between the brackets after mouseClicked?? "Emoticon", "Emoticon.actor", "Emoticon.class", "actor" didn't work :/
The name of the actor is not
Emoticon
-- that is the name of the class and the
Type
of object your actor is. You refer to the object the code is executing for as
this
.
Ooh now I see!! Thank you so much, it works now!
Actors Spawning on Each Other
By Ectomorph, with 2 replies.
Last reply by Ectomorph, over 8 years ago:
Thank you that, I'll give it a go.
Help stopping an Actor
By GreenfootHelp, with 1 reply.
Replied to by danpost, over 8 years ago:
GreenfootHelp wrote...
Hi, so I have a program that is basically code from the Rocket ship tutorial one. I added SpaceWombats to attack the Rocket but the game will not stop when the Wombat gets to the Rocket. << Code Omitted >>
Look at your
act
method. While doing so, ask yourself when the other methods (
touch
,
hitrocket
and
rocket
) will execute. Keep in mind, the greenfoot framework only calls the
act
method (in general) to execute.
Scrolling World Image Not Appearing
By Applez, with 1 reply.
Replied to by danpost, over 8 years ago:
Applez wrote...
Hello! I've made a scrolling world which adds 2 images and makes them go down when the up arrow key is pressed, both the images move down but they don't follow reappear after they have gone out of sight... It's like they go down and i can never see the actor again.
Line 24 in the
Road
class does not look right with
getHeight
in the x-coordinate expression. That is the first thing I had noticed, at least. You should probably think through exactly what that method should do.
Change Background
By Cmo, with 1 reply.
Replied to by danpost, over 8 years ago:
Cmo wrote...
i need help changing the background of the game when the score reaches a certain amount. << Code Omitted
Please show your
addScore
method in your
Rocket
class.
Having trouble with score counter
By DoubleShoot, with 1 reply.
Replied to by danpost, over 8 years ago:
Remove line 2 from the Counter class -- this one: <Code Omitted>
[Help] Turret Aiming within range
By B_rob1, with 21 replies.
Last reply by danpost, over 8 years ago:
If by
snipercard
, you mean
turretCard
object, then: <Code Omitted>or <Code Omitted>
Make actor stay at one point on other actor and mirror rotation.
By maboidanpost, with 1 reply.
Replied to by danpost, over 8 years ago:
maboidanpost wrote...
Trying to make the fire follow the ship like exhaust or something.
Have the ship control the location and rotation of its fire object. When ship moves or turns, adjust fire to match.
Making healthbar decrease if it get hit by bullet
By OfficerRiot, with 13 replies.
Last reply by OfficerRiot, over 8 years ago:
Ok i got it to kinda work but now it goes down way to fast i want it to take a sliver of the health not a small chunk
game like playing skipping
By intanmuliawati, with 14 replies.
Last reply by intanmuliawati, over 8 years ago:
it works.thank you so much danpost :)
259
260
261
262
263
264
265
X