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
I hame littel eroro
By Philipe_Manor, with no replies.
Hello friends i want make a Cashew game. Mi idea es to ham a cashew moving over a nut backgroined. Yo want it to be like crossing road : ] I dont want no cross eyed game. Mi game es my own idea, so por favor don't copy. that eroro is i cant make the loser screen which es crack the nuts open. the nut on screen shuld be averaged size for a cumpoters screen but min is 2 feet and i cant make it bigger. Mi nut es tu small to cover la face. Face es too big. ples help mi por favor, los chicos. chao, Philipe : ] public class MyWorld extends World { /** * Constructor for objects of class MyWorld. * */ public MyWorld() { // Create a new world with 600x400 cells with a cell size of 1x1 pixels. super(600, 400, 1); Face smile = new Face(); addObject(smile, 370, 200); Nuts nutty = new Nuts(); addObject(nutty, 200, 200); Nut nutt = new Nut(); addObject(nutt, 390, 200); } } /** * Write a description of class Nut here. * * @author (your name) * @version (a version number or a date) */ public class Nut extends Actor { /** * Act - do whatever the Nut wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { if(Greenfoot.isKeyDown("right")) { move(20); } } }
How do i compile greenfoot to .JAR?
By Gooberchicken, with 2 replies.
Last reply by Zacy0, about 1 month ago:
Unfortunately, it is no longer possible in recent versions. However, most scenarios work a few versions back. Just download an older version of greenfoot (v26 iirc) and use the share button.
HTML 5 Translation
By MrParakeet25, with 6 replies.
Last reply by MrParakeet25, about 2 months ago:
danpost wrote...
MrParakeet25 wrote...
As a test I uploaded a scenario of a single ant being instanced and nothing else and that still resulted in an HTML5 issue, so it it the computer?
Maybe you should have left it up here for us to look over. Start simple and work up gradually to pinpoint where the problem begins. That is, start with no sound files, limited images and minimal code to get going. Share it to see if it uploads correctly. If not, it may be your computer, your version of greenfoot, or who knows. It loads, maybe add ONLY one music file and test it again. Then continue b
Artificial Inteligence
By CowboyIggy, with no replies.
I am creating a Chess game and would like to make the player vs computer option, but I don't have any idea how to create an Artificial Inteligence to play Chess. Sure using a lots of 'Ifs' wouldn't be the best way... Someone has any ideia or a link for some discussion that could help me in that way? I didn't try any code yet also, if I try in the next days I upload it here in this discussion.
Feedback on Game Request
By EPayne, with 2 replies.
Last reply by EPayne, about 2 months ago:
Thanks danpost! That totally explains why the cows weren’t spawning — I had no idea the timer reset was messing with the later condition. I’ll go fix that now. Also, just wanted to say I haven’t been on Greenfoot for long, but I’ve already noticed how active and helpful you are. Your replies are quick, spot-on, and actually help people level up their code. Big respect — keep doing your thing!
Hame a litt error
By Punithan35, with 2 replies.
Last reply by Punithan35, about 2 months ago:
Super_Hippo wrote...
Try to use fillOval instead of filloval.
it works
why my class just disper
By Punithan35, with no replies.
so when i was makeing a game called BINGO game i left and the next day my number class just disper i dont konw why it disper and the text only ther is like gliched text i cant past to show the text my 10 hours of non.stop coding went wast
A error on making a "counter"
By Punithan35, with 2 replies.
Last reply by Punithan35, about 2 months ago:
danpost wrote...
Punithan35 wrote...
when i was doing the counter ther is a error ,on my latar and laser. on the latar the error is"Undlared variable: Counter and the laser error says"Undeclaren method addOject(counter) so i will send my latarclass,laserclass and my other class Counterclass. << Code Omitted >>
First off, the
Counter
instance should be created, maintained and controlled by the
World
subclass
Latar
, not the
laser
class. Any
laser
instance can get its
World
object and call a
public
Help with null pointer exception while trying to use showtext
By Mp2yayy, with 1 reply.
Replied to by danpost, about 2 months ago:
Mp2yayy wrote...
im trying to run this code and it keeps giving me null pointer exceptions in relation to the show text parts of it i have all my code below << Code Omitted >>
The first four lines in your
act
method are supposed to create a
new P1Charizard
actor and add it to the world. Well. it would if no problems were present. The proper code should be like one of the following:
error with memomory card game
By robobrax, with 1 reply.
Replied to by danpost, about 2 months ago:
robobrax wrote...
So I'm making a memory card game and string to add 6 cards and different positions, but not too sure what's going on, this is what I have. << Code Omitted >>
Okay, no need for the
Random
line. Not sure what the first
for
loop is doing. Looks like you are trying to create and build an array. Example array builds are as follows: <Code Omitted>N
What is the latest java version (for Mac) that supports applets (java applet plugin)?
By louq, with 1 reply.
Replied to by robobrax, about 2 months ago:
7u51aB2.1
problem with neighbor count
By ttt, with 4 replies.
Last reply by danpost, about 2 months ago:
Right. I am getting similar results after further testing. Maybe you should use a different method -- maybe the following for line 10: <Code Omitted>I get consistently correct results with this one.
Stopping a walking soundloop upon death
By Sendaris8, with 4 replies.
Last reply by danpost, 2 months ago:
Sendaris8 wrote...
What do you mean by 'call this new method from wolf/bear classes'?
I mean add the "new method" above,
die()
, to your
Guy
class. Then you can use something like the following in the
Bear
and
Wolf
classes: <Code Omitted>
Using an array switch to a new world
By thunesm, with 5 replies.
Last reply by danpost, 2 months ago:
Looks like I missed one case world: <Code Omitted> And actually, the final range is 1 to 36 as 49 is the character code for '1' (not 48) which shifts everything up by 1. (48 is the character code for a '0' (zero)).
Rhythm Game in Greenfoot?
By SuseGD, with 2 replies.
Last reply by SuseGD, 2 months ago:
danpost wrote...
As always, start with the basics -- your
World
subclass and
Actor
classes. Actors should interact or positioned to determine when a user action is to be executed. Depending on what you want, add a timing system or some type of a scoring system, or both (controlled by the world). If you have specific problems with the code, then show codes, indicate how it is not doing what you want and what you do want.
Hey, thanks for the response! Maybe I should've been a bit more specific with my question; I see that now. I have a general idea of how all the main f
1
2
3
4
5
X