Questions tagged [greenfoot]

Greenfoot is an environment that makes it very easy to create 2D animations and games using Java.

Greenfoot is designed for beginners and makes it easy for people who have never programmed before to create games and animations without worrying about dealing with any complexities such as threading, double buffering or swing.

After scenarios have been created they can easily be shared by using the Greenfoot Gallery.

Links:

Main site (download Greenfoot here)

Greenfoot Gallery (users scenarios are published here)

Greenroom (only open to teachers)

128 questions
0
votes
1 answer

Greenfoot: How do I make it so I press a button once and it keeps acting?

Title, I want to make my program shoot a ball when you press the button once, and then it keeps going and you can't do anything until it finishes. Current code for firing below. public void act() { // Steps for calculating the launch speed…
Jack
  • 15
  • 7
0
votes
1 answer

Static array declared but method cannot work

I have to do my homework in Greenfoot. This part means that I have to save the position of Chess and then click reset. Then, I have to choose load to put back the pieces of chess in the position they had before reset. Since I don't know the exact…
Smile
  • 3
  • 2
0
votes
1 answer

Java: How do I check to see if a particular instance of an object is in the world?

Note: I am using the Greenfoot IDE So I have been tasked to create a Balloon project where objects of a Balloon class float to the top of the screen. Any other details are up to my decision. So I made it so that my Balloons pop through a pop method,…
Ben Boudreau
  • 25
  • 1
  • 6
0
votes
1 answer

Attempting to Connect my Kinect to Mac and code in Greenfoot Environment

Running: Mac OS X 10.8.5 I'm following the step by step instructions on the Greenfoot website: http://www.greenfoot.org/doc/kinect/macos.html I've dealt with all the run arounds with installing Macports for OSX 10.8, and finally installed 'boost',…
0
votes
0 answers

User is not getting tracked

I am developing a game using greenfoot and kinect. The theme of the game is to catch the falling apples with the basket.The basket movement should happen via kinect. The problem is I am not getting tracked by the kinect. UserData user=…
deepthi
  • 29
  • 2
0
votes
1 answer

java cannot be applied to given types

so i got this error: java cannot be applied to given types; required: java.lang.String,int,int; found:java.lang.String; reason: actual and formal argument lists differ in lenghhs when i typed this in one Actor (im using Greenfoot): public String…
0
votes
0 answers

Mini pacman code java

I've written a mini pacman code, using greenfoot. My question is, once all the leaves have been collected Clara is to stop infront of the first tree, however, i continue getting an error, saying she cannot move the tree. Below is my code: /** *…
user3459720
  • 29
  • 1
  • 4
0
votes
0 answers

How to compare images?

For a project I am making a memory game, but I am trying to make to objects disappear when the are equal. This is my code: public void opencard(){ int duiker = 0; int duiker2 = 0; if (duiker == duiker2){ …
0
votes
1 answer

Greenfoot issue with making ball go away from player

I'm trying to get a baby to kick a ball into the goal. So far I have managed to get the ball to go into the goal when the baby touches it by using move(-300); to go into the desired position, but that isn't technically getting the baby to hit the…
Joe
  • 68
  • 6
0
votes
1 answer

How do track rotation from actor to mouse

I am trying to fire bullets from the location of the gun that is firing. So when the mouse is moved the gun moves at a direction. I would like the bullet to move at the direction which the gun is pointing to. So i can fire at any direction. Ive…
Pro-grammer
  • 862
  • 3
  • 15
  • 41
0
votes
1 answer

Java can't start RMI server

After installing avasty greenfoot a simple java programm to learn java isnt working on my windows 8 machine. In the log there is more information provided, but i as java beginner dont really understand the problem ! I hope somebody can help…
John Smith
  • 6,105
  • 16
  • 58
  • 109
0
votes
2 answers

BlueJ error: incompatible types

Complete noob at Java here. School just started and I'm taking APCS. Our teacher showed us this cool class called Scanner, but he hasn't taught us it yet. I thought it was pretty cool, so I decided to research it more. After I did a little research,…
Abdi Abdalla
  • 13
  • 1
  • 3
0
votes
1 answer

Java list in Greenfoot

I am trying to access a specific element in a java list of Greenfoot (http://www.greenfoot.org/). getObjects(Object.class).get(0).getPosition(); Object is my own class. It has a method named public float getPosition() { ... } getObjects() returns a…
user1429101
  • 87
  • 3
  • 9
0
votes
3 answers

Calling one specific overriden method in all derived classes

Consider the following code: // ======== Abstract class ======== public abstract class Creatures { public abstract void loseEnergy(); public void execute() { loseEnergy(); } } // ======== Animals ======== public…
user2205657
0
votes
1 answer

Making a method that random places an object on the screen.

I have everything else correct, but for some reason this is giving me problems. I want to implement a method called populate(). i want to be called in the constructor. I want it to the method to create a random number of objects of each type of…
New2.java
  • 29
  • 6
1 2 3
8 9