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
Start Greenfoot in Code?
By Locomotion15, with 11 replies.
Last reply by Locomotion15, over 13 years ago:
Thank you all! I will test both of these out shortly and announce whether or not they work.
Problem with arrays? String[] whiteKeys?
By manster2008, with 13 replies.
Last reply by mjrb4, over 13 years ago:
You're looking at
Newton's law of universal gravitation
if you want to do some reading around :-)
Game Development Team Project
By webmessia, with 7 replies.
Last reply by Evmorov, over 13 years ago:
-
On Adding to Lists
By danpost, with 3 replies.
Last reply by mjrb4, over 13 years ago:
When you declare a field such as you had originally, you're essentially declaring a space that fits a particular type, in this case a list. You haven't actually put a list there yet, that comes when you do: <Code Omitted>That way you've created a new object and assigned it to listData, and you can manipulate it by calling methods (such as add.) When you don't create the object you're trying to manipulate an object that's not there, or "null" - hence NullPointerException. When you see an exception like that, that's almost always what will be going on!
card games
By stokers, with 2 replies.
Last reply by mjrb4, over 13 years ago:
If you still want more help with this then it'd help to be a bit more specific - what have you tried so far? Have you got any code that we can work from? Generally speaking, if you have a class you can implement the equals() method and subsequently call it to work out if two particular objects are equal, but how to implement it depends on the context!
Checking for values of things in range
By kiarocks, with 59 replies.
Last reply by kiarocks, over 13 years ago:
im back
Quellcode
By MyLove, with 1 reply.
Replied to by davmac, over 13 years ago:
Take a look at the "balloons" scenario that comes with Greenfoot. The "ScoreBoard" class shows you how to make a "Game Over" window.
On fixing 'Infect'
By danpost, with 83 replies.
Last reply by danpost, over 13 years ago:
OK, try: 'infect(infectChance * getInfectChance());' (missed the parenthesis after 'getInfectChance')
Scrolling
By F-L-Undead, with 9 replies.
Last reply by davmac, over 13 years ago:
F-L-Undead, let's put it this way: if you don't use "synchronized" on those methods, then you're messing with forces you don't understand :) It will probably work most of the time, but sometimes, just occasionally, it will go mysteriously wrong... unless you use "synchronized". You don't have to understand what it does, and you don't have to use it in your own code; just in the two methods in ScrollingListener.
How to recognize left-clicking even if the mosue isn't moving...
By manster2008, with 7 replies.
Last reply by davmac, over 13 years ago:
You can't do that exactly in Java. You have a few options: First option: store the values in a HashMap eg: <Code Omitted> For this to work you'll need to import the HashMap class at the top of your class: <Code Omitted>
Scenario Information
By F-L-Undead, with 2 replies.
Last reply by davmac, over 13 years ago:
Choose "Scenario Information" under the "Scenario" menu.
How can I upload games?
By MyHeartRocksNRolls, with 3 replies.
Last reply by mjrb4, over 13 years ago:
In the newest version of Greenfoot, you don't even need to use the menu - there's a big share button in the top right :-)
Scenario outside Greenfoot
By B00bietrap, with 5 replies.
Last reply by B00bietrap, over 13 years ago:
It's more or less just a experiment for this Kinect. the minigames i have in greenfoot and it's fine there. I just tried to expand the kinect with all my other stuff in Netbeans. And it's not toally out of greenfoot, still using the same classes system and library. I just try to run it without an additional software this time.
Compiler Warnings (Ubuntu)
By Evmorov, with 3 replies.
Last reply by Aikon, over 13 years ago:
Hi, I saw this message today: "unmappable character for encoding UTF8" I run greenfoot on ubuntu 11.04. It was a class that had some strange characters in a comment (this hapened because of changing computers, and i write in portuguese with accents). I fixed it and it executed as usual.
Steps to Time?
By manster2008, with 2 replies.
Last reply by davmac, over 13 years ago:
You can measure the speed yourself using System.currentTimeMillis() - it returns (as a "long") the number of milliseconds since 1 January 1970. You can simply print it to the terminal each act() and then calculate the difference by hand.
1043
1044
1045
1046
1047
1048
1049
X