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
resizing a gif image
By DaRafster, with 1 reply.
Replied to by danpost, about 6 years ago:
DaRafster wrote...
I've managed to get a gif image to act within the world when ran, but it's way too big. So how would I scale my gif image?
Use a
for
-each loop to iterate through the images to scale them all.
Making an actor face right or left
By nextstone, with 5 replies.
Last reply by danpost, about 6 years ago:
I am saying to store all 8 images. If not using an array, you may might want to use
switch
blocks to hash out which image to use (out of 4 for each block).
IllegalStateException: Actor not in world. An attempt was made to use the actor's location while it is not in the world. Either it has not yet been inserted, or it has been removed.
By footpickle, with 11 replies.
Last reply by footpickle, over 6 years ago:
It doesnt matter anymore i figured it out :)
Coding more smart
By DaRafster, with 2 replies.
Last reply by DaRafster, over 6 years ago:
danpost wrote...
You could combine the
addObject
lines with the assignment lines before them (in most cases. That is, use the assigned values in place of what the variable the value is assigned to in the
addObject
line. As the pairs of lines for your labels are already quite long, I might leave them alone (or just put the
String
values in a variable and use it when creating the actor in the
addObject
line). A non-label example would be to combine lines 10 and 11 into the following: <Code Omitted>
T
GamePads
By Laks, with no replies.
Hi, I am trying Greenfoot with GamePad but I am having trouble with the GamePadTester. I am getting the error package net.java.games.input does not exist. Any help on how to get this started? I am using Greenfoot 2.4.2. Thanks
Help with programming 2048?
By whattheheck, with 1 reply.
Replied to by danpost, over 6 years ago:
Here are examples: <Code Omitted>or (combined) <Code Omitted>
Every actor in my world is now a green foot...
By footpickle, with 1 reply.
Replied to by footpickle, over 6 years ago:
ah wait it fixed
Terminal Window error when looping background music
By DaRafster, with 1 reply.
Replied to by danpost, over 6 years ago:
It means you need to use a music editor to re-save the file with the option to save tags turned off.
java.lang.ClassCastException need help
By minetruck, with no replies.
hi i have a game where you have to click on a dice and when you have 66 points you win. i want to reset all counters when 66 points are achieved. but i have this problem: java.lang.ClassCastException: class player1 cannot be cast to class player2 code of the winner screen: <Code Omitted> code of the method: <Code Omitted>and the code to show the winner screen: <Code Omitted> thanks
remove an intersecting object
By Claudiu, with 18 replies.
Last reply by Claudiu, over 6 years ago:
I have a queston. if i make a game can i publish it somewhere instead of greenfoot site?
If the mouse is clicked, place a new image
By DaRafster, with 2 replies.
Last reply by DaRafster, over 6 years ago:
danpost wrote...
The getWorld method returns the value of the field: <Code Omitted>in the Actor class: <Code Omitted>The field is used to indicate what world, if any, the actor is in. While the actor is not in any world, its value will be set to
null
. Once you execute line 26, which removes the button from the world, the button loses its reference to the world it was in. So, it would be impossible to add an object into that world at that point. Either add the object into the world before removing the button or s
int in showText
By Yoshi21137, with 27 replies.
Last reply by Yoshi21137, over 6 years ago:
It works now. Thanks for helping me and for staying with me for the 3 days you did!
Trying to create a blinking image
By DaRafster, with 3 replies.
Last reply by danpost, over 6 years ago:
Basically: <Code Omitted>
How do you add 1 point every time an actor touches instead of it rapidly adding points while it's already touching?
By Adrian2004, with 3 replies.
Last reply by danpost, over 6 years ago:
Add a field to contain a
Point
object and set it to any touching
Point
object. Also, set it to
null
if not touching any
Point
object. Only score if field does not contain the
Point
object it currently touches.
Need help with highscore system and a fix
By BalanZeD, with no replies.
Hey, I'm new to Greenfoot and need to finish my Game. I would like to add a highscore which is saved and everytime a new highscore is achieved the backround should be switched. that is all it should do and i really need your help. I have another problem in my scenario. I uploaded it and please check it out. I want to switch something. I want that the "Flappy2" in the "bg" subclass is flying faster than the "Flappy" in the Background subclass but it only works if i click reset and then new Background. But if I start this scenario the "Flappy" is flying faster than it should. Only the Flappy2 should fly faster in its world (bg) and I dont want to click reset and new Background everytime. I wanted to know if there is a solution. Thanks !
143
144
145
146
147
148
149
X