This site requires JavaScript, please enable it in your browser!
Greenfoot back

What is happening right now?

danpost

reply to similar senario like ant senario

By danpost - about 20 hours ago
The Creature class has a field that references an Anthill object (or home actor). This is used to direct the ants back to drop off the food (using the location of the home actor). This home actor, in turn, contain a field to count the number of foods dropped off. All this should be quite similar to what you need in your robot scenario. I would think the only real difference might be the way the robot moves (as compared to how an ant moves). Attempt some code for what you want and if you run into problems, post the attempted code and explain the issue (what it currently does and how that differs from what you want it to do). Then we can help to fix your code. Unfortunately, the Creature class was made specifically for the Ant scenario (meaning it is not "generic" for any creature). If needed, I could supply a more versatile Creature class that can be used for any type creature (even a robot).
Julian109998

reply to Scrolling Background in y-Achsis Direction

By Julian109998 - about 21 hours ago
Thank you, it works perfectly :)
trimil

reply to Get user's location

By trimil - 1 day ago
Okay.
danpost

reply to Spawning objects after time

By danpost - 2 days ago
MacG wrote...
I wanna addObject with some interval, But I want it loop, every 2 seconds, the zombie will show and it not stoping, can I do that ?
Just count act cycles; and when it reach the number of act cycles executed within a 2 second interval (usually something between 100 and 120) spawn a zombie and reset the 'int counter' field.