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
Exploding
By Avik, with 4 replies.
Last reply by GreenGoo, almost 12 years ago:
Look at my scenario and just copy the explosion code : http://www.greenfoot.org/scenarios/8371
Scrolling Text Box
By SP00F3R, with 2 replies.
Last reply by danpost, almost 12 years ago:
A simple class for a scolling textbox might look like the following:
help whit shooting
By gust.ramos, with 1 reply.
Replied to by danpost, almost 12 years ago:
The problem with the code is what I have made bold: if("c".equals(
Greenfoot.getKey()
)){ newBomb(); }else if ("x".equals(
Greenfoot.getKey()
)){ newBullet(); } You are calling 'getKey' twice within the same act cycle. The second call will always return 'null'. So, what you need to do is save what is returned the first time in a local field and use its value for comparing. <Code Omitted>
Urgent
By Avik, with 3 replies.
Last reply by Gevater_Tod4711, almost 12 years ago:
Then you should set the location of the coins to the other edge of the world: <Code Omitted>
What Was Your First Game?
By JetLennit, with 7 replies.
Last reply by GreenGoo, almost 12 years ago:
My first game, without using Mik's tutorials, was a very simple game where some turrets shot at a car which the player controlled.
Java Heap Space - delete background image
By Ragtime, with 4 replies.
Last reply by Ragtime, almost 12 years ago:
I will try to make some improvements. Thanks.
Help for Rudi
By Kartoffelbrot, with 4 replies.
Last reply by GreenGoo, almost 12 years ago:
My blobfish? It might be, I don't know.
Animation
By Gzuzfrk, with 1 reply.
Replied to by Gevater_Tod4711, almost 12 years ago:
If you use the modulo operator (%) that will help. E.g. <Code Omitted>
Key Pressed
By Gzuzfrk, with 1 reply.
Replied to by Gevater_Tod4711, almost 12 years ago:
You have to add an else part after your if statement. If this else part is executed you set everything back to normal: <Code Omitted>
Multi Worlds problem
By geekykid2013, with 20 replies.
Last reply by danpost, almost 12 years ago:
I think the problem was your 'checkOut' method. Try this: <Code Omitted>
WHATS WRONG
By Avik, with 4 replies.
Last reply by danpost, almost 12 years ago:
There is no correct code for what you have given above. First, you are using an Object in the class that is not recognizable to the class. Second, you are using a method on an Actor object that is supposed to be executed on a World object. Finally, you have one method inside of another, which you cannot do in Java coding.
Image/ Actor issues
By GreenGoo, with 5 replies.
Last reply by danpost, almost 12 years ago:
How do you know? what will tell you that it registers or not?
help
By Avik, with 3 replies.
Last reply by danpost, almost 12 years ago:
You placed the code after a 'return' statement that will always execute. Therefore the snippet is actually unreachable where it is placed. The compiler was not expecting code there; hence, the error. Your 'scrollPosition' appears to change by one every act cycle. In fact, being 'scrollSpeed' is 'final' (never changes), you can change your act method to:
whats wrong with this?
By Avik, with 15 replies.
Last reply by danpost, almost 12 years ago:
It what way does it not work? Are you getting an error message? if so, what does it say?
Collison Detection Problem
By geekykid2013, with 2 replies.
Last reply by geekykid2013, almost 12 years ago:
Here is the code for my world import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) import java.awt.Color; /** * * The square world. The square world has Gold Eggs that need to be collected * * @author * @version 1.0 */ public class SquareWorld extends World { // private static final int GAP = 12; private Counter counter; private HealthBar healthBar; private Paddle paddle; private Robot robot; /** * Constructor for objects of class SquareWorld. * */ public SquareWorld() {
836
837
838
839
840
841
842
X