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
Problems converting between greenfoot.Font and java.awt.Font
By tonyreks, with 1 reply.
Replied to by danpost, about 7 years ago:
I came up with the following test class code which seems to work:
Adding a point to the score counter.
By lorcis__, with 3 replies.
Last reply by danpost, about 7 years ago:
lorcis__ wrote...
The score counter has been added in the world "capworld" << Code Omitted >>
Okay -- as an alternative to the line previously given, you could use: <Code Omitted>
Greenfoot export jar empty window
By JustDylan, with no replies.
I've been trying to export my greenfoot game for about 3 hours but I can't get it to work.
github link
this is the github page if the game, I am working in an external ide so that's why I am able to work in packages. it also fully functions in greenfoot. I think greenfoot doesn't know what the default world is when you execute the exported jar because it creates an empty window. anyways, does somebody here know why this is happening. I am using version 3.1 btw, in the newer versions there is no good way of using an external ide.
How do you delete comments on a game?
By vinay365, with 2 replies.
Last reply by vinay365, about 7 years ago:
Oh ok. Thanks for your help!
Int share between actors
By Nahquin, with 13 replies.
Last reply by Nahquin, about 7 years ago:
Thank u very much.
Abstract World, Health Bar
By fittirc04, with 2 replies.
Last reply by danpost, about 7 years ago:
A couple things about your code: (1) instead of a field and a
getter
method in each
Area World
class, you can simply add them into the
AbstractWorld
class and inheritance apply them to all
Area
worlds. The
getter
method itself is not actually needed at all, provided the field has
public
access. Also, by making the field
static
and only creating a
HealthBar
object in your initial
Area
world, all areas can use the same health bar: <Code Omitted>
justification in terms of why they are classes and why they are inheriting from actor or world
By Rodrigo_Pizarro, with 1 reply.
Replied to by danpost, about 7 years ago:
Rodrigo_Pizarro wrote...
Can someone please help justifying classes and why they inheriting from actors. i would be very much appreciated. An example would more than enough so i can guide myself through thank you.
The
World
and
Actor
abstract classes are base classes for any and all worlds and actors. The greenfoot platform is built around these classes. You cannot create a world in greenfoot without a class that extends the
World
class and only
Actor
objects created from some extension of
Actor
are the only objects you can place into a
Upload
By Nahquin, with 2 replies.
Last reply by Nahquin, about 7 years ago:
Thank u
Shopping Cart mouseClicked()
By adore.ange, with 1 reply.
Replied to by danpost, about 7 years ago:
adore.ange wrote...
I'm not familiar with mouseClicked(). I have a shopping cart assignment which involves: The ShoppingCart (actor) will be a class with no image. The class will simulate purchasing the clicked on objects and required quantity. Must have Greenfoot.mouseClicked() and quantity = Integer.parseInt(Greenfoot.ask(Enter quantity:"); I have to be able to click the item image which is on the world and have it to let the player put in the quantity. Then have the number of items they inserted and the picture show on the world. << Code Omitted >>
The
mouseClicked
part look
Lag after update
By Paul12345, with 1 reply.
Replied to by 12AF34, about 7 years ago:
hi
Stopping Background Music When One Actor Touches Another Actor
By TyrantVal2542, with 2 replies.
Last reply by danpost, about 7 years ago:
TyrantVal2542 wrote...
in my game I have background music playing and when it is Game Over, there is a new song. It is game over when the player class touches the enemy class. I'm trying to get the background music to stop and let the game over music play.
I wrote a background music support class scenario called
BGMusic Actor Class
. The BGMusic class could be useful whether you need an actor object from the class or not.
Greenfoot memory leak?
By HeapSpace, with 1 reply.
Replied to by davmac, about 7 years ago:
Task manager just shows how much memory an application has allocated from the operating system, not how much it is actively using. Java uses "garbage collection" meaning that it doesn't free unused memory immediately and may continue to allocate memory from the OS that it doesn't strictly need. I'm pretty sure that's what you're seeing here. If you keep repeating the same process, you'll eventually see the memory use according to Task Manager level out or even drop back to somewhere near the original level.
World int share?
By Nahquin, with 1 reply.
Replied to by Super_Hippo, about 7 years ago:
You could pass the gold as a parameter between the world. Or you use a static variable (variable for a class instead of an instance of the class). Or you could save a reference to the game world in the menu world (and/or other way around), so you can access the variable.
Adding Title Screen Music
By WizardGamer, with 6 replies.
Last reply by WizardGamer, about 7 years ago:
The music is playing now. Thank you!
I'm trying to get the game to stop when actor "car" hits actor "wall1". This is my code but it seems to not work. Could someone please help me, I'm completely new to this.
By lorcis__, with 2 replies.
Last reply by lorcis__, about 7 years ago:
Thank you for your help! It works finally :)
225
226
227
228
229
230
231
X