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
get random value from array based on level
By comfortablyNumb, with 4 replies.
Last reply by Super_Hippo, over 6 years ago:
The equals method compares the characters/content in the string (true if they are the same), == is only true if they are both the same string (the same object). As a simple rule: Always use equals instead of == for strings. (Unless you actually want to check if it is the same object of course.)
Greenfoot Bug again? - NullpointerException
By ITStudent, with 1 reply.
Replied to by danpost, over 6 years ago:
You cannot call a method (
showText
-- on last line) on a non-existent object. The reference to a
World
object returned by
getWorld
will be
null
if
this
actor is removed from the world (previous line). Change last line to: <Code Omitted>
I need help with my code
By kahn, with 2 replies.
Last reply by kahn, over 6 years ago:
thx dadpost
Illegal State Exception: actor trying to get location of player when it has been removed from the world
By comfortablyNumb, with 6 replies.
Last reply by comfortablyNumb, over 6 years ago:
epico its working now :)
Greenfoot - Movement BUG?
By ITStudent, with 2 replies.
Last reply by ITStudent, over 6 years ago:
So i am using shift instead of q and now everything is working fine. Thank You.
Need help with Program Greenfoot #2. I have a question please assist.
By Waterfall100, with 1 reply.
Replied to by danpost, over 6 years ago:
Please provide code, error and location of error.
How do I remove another actor.
By AVH, with 1 reply.
Replied to by danpost, over 6 years ago:
AVH wrote...
I'm trying to kill an orc, by using key is down "space" to remove an orc and use an image when space is clicked. But it is not working.<< ,<< Code Omitted >>
If the orc is an intersecting object, then line 7 removes the wrong actor.
I need help adding a actor if another actor touches the edge!!!!!
By kahn, with 1 reply.
Replied to by kahn, over 6 years ago:
nvm figured it out
TowerDefense
By johnsonhwang1008, with 1 reply.
Replied to by Super_Hippo, over 6 years ago:
If you have a variable in your Enemy class which saves the traveled distance for the actor (increase it by its speed whenever it moves) and a method to return it … <Code Omitted>… then a tower can get the enemy in range with highest distance traveled and shoot a bullet in that direction:
About random populating
By Ethan_net, with 3 replies.
Last reply by danpost, over 6 years ago:
Ethan_net wrote...
Oh, and also only one marble exist for one y value.
Have the method,
addMarbles
, and add all the marbles in one calling. That is, move the loop from the constructor to the method. That way, the loop counter value can aid in controlling the y-coordinate value where the marbles are placed.
Flip a GIF image depending on which way you are going
By Hundmat, with 10 replies.
Last reply by danpost, over 6 years ago:
Hundmat wrote...
how do you create a gifimage array?
<Code Omitted>
Checking if the object is still there
By Erik27, with 1 reply.
Replied to by Nosson1459, over 6 years ago:
it would probably just be easier to add the new drone in the previous drone like this<Code Omitted>
How can I make a score counter ?
By BestMannCZ, with 1 reply.
Replied to by BestMannCZ, over 6 years ago:
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class Vcela here. * * @author (your name) * @version (a version number or a date) */ public class Vcela extends Actor { /** * Act - do whatever the Vcela wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { if (Greenfoot.mouseClicked(this)) { ((Louka) getWorld()).smazVcely(); } } }
How can I spawn actors for a 5 second and then removed them and replace with others
By BestMannCZ, with 2 replies.
Last reply by BestMannCZ, over 6 years ago:
Thank you very much
How can I move an Actor to another Actor?
By Starlord_20, with 2 replies.
Last reply by Starlord_20, over 6 years ago:
Works, thank you very much! :)
164
165
166
167
168
169
170
X