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 need help adding a actor if another actor touches the edge!!!!!
By kahn, with 1 reply.
Replied to by kahn, about 7 years ago:
nvm figured it out
TowerDefense
By johnsonhwang1008, with 1 reply.
Replied to by Super_Hippo, about 7 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, about 7 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, about 7 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, about 7 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, about 7 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, about 7 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, about 7 years ago:
Works, thank you very much! :)
Variable containing classes
By JamesR, with 3 replies.
Last reply by danpost, about 7 years ago:
JamesR wrote...
<< Code Omitted >> I want it so I can have 2 or more classes there if that helps explain it.
So, you want: <Code Omitted>Btw, it is not "2 or more classes" -- it is "2 or more actors (or instances of a class)" .
Maze - detect black color from picture and make it solid
By Aelin, with 2 replies.
Last reply by Aelin, about 7 years ago:
Ah.. thanks. It works now.
How can I spawn actors for a 5 second and then removed them and replace with others
By BestMannCZ, with 4 replies.
Last reply by danpost, about 7 years ago:
Now move the
for
loop into its own method so you call it later from
act
method. Remove your new discussion thread. Deal with issues here.
please help me
By mysrilal, with 4 replies.
Last reply by danpost, about 7 years ago:
Hundmat wrote...
mb
Not really. You could not know without downloading and taking a look at the code of the scenario. No need to apologize or imply self-blame..
Incompatible types: possible lossy conversion from float to int
By Alexkr, with 7 replies.
Last reply by danpost, about 7 years ago:
Alexkr wrote...
This is my actual code: << Code Omitted >>
If that is all you changed, then no wonder you still have issues. You are now (trying to) passing a
float
value to a method that has an
int
parameter (to set speed of enemies). Use
e#.setSpeed((int)enemy#Speed);
in act method.
Problem: Trying to set class as a parameter in a method to spawn actors
By comfortablyNumb, with 8 replies.
Last reply by comfortablyNumb, about 7 years ago:
thanks for the help thats a really cool solution. still new to java programming and using the whole object orientated thing.
isKeyDown only detect once
By WackBoi, with 2 replies.
Last reply by WackBoi, about 7 years ago:
That was exactly what I was looking for. Thanks for your efforts. Appreciate it a lot.
165
166
167
168
169
170
171
X