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
(ask) help me fast needed 12hours from now
By billxha, with 2 replies.
Last reply by danpost, about 5 years ago:
billxha wrote...
How to make time timers from 600sec to 0? thank you so much
Please refer to my
Value Display Tutorial
scenario.
Actors associated with other objects.
By oofitsme, with 5 replies.
Last reply by danpost, about 5 years ago:
oofitsme wrote...
Using pizza was just part of the example because I have multiple actors under the class OrderSlip1 and one of them happens to be pizza. I originally used "this" for the Greenfoot mouse-click method but where it gets confusing is I hardcoded each actor from the OrderSlip1 and 2 class to be associated with a specific person from the customer class (if that makes sense). And when I run the game, instead of showing up the way that I hardcoded it to be, the order tickets show up with different customers than intended.
I suggest you use fields for the slips of a customer. T
How to change pictures back to back by clicking?
By lonkness, with 1 reply.
Replied to by danpost, about 5 years ago:
You need to have some way to tell how far along you are with the mouse click actions. A simple
int
counter field should suffice: <Code Omitted>Then, <Code Omitted>
Hey guys how do I add a cool down to my gun, im making a game and this is my code for the arrow/bullet, how do I make it so there's a cool down between each bullet
By TejasKanch, with 1 reply.
Replied to by TejasKanch, about 5 years ago:
Nevermind guys I got it here you go: this goes in the actor that is shooting the bullet <Code Omitted>
Actor not in the World
By Genota, with 2 replies.
Last reply by Genota, about 5 years ago:
Okay nevermind I figured it out by myself... And yes the problem was in the MyWorld class. Thank you anyways!
Actor not in world
By SeafodHalal, with 2 replies.
Last reply by danpost, about 5 years ago:
In
Projectile
class, remove any collision with
Enemy
object code.
How can I make my background scroll left and right?
By Samuaelk, with 3 replies.
Last reply by Samuaelk, about 5 years ago:
Thanks!
How to register when left and right mouse buttons are clicked at the same time?
By RoverKnight, with 1 reply.
Replied to by danpost, about 5 years ago:
Add an
int
field to track buttons down. Increase by (button value plus one) divided by two on mouse presses and decrease by same on mouse clicks. Only perform action for both buttons down when its value is three. One thing to note: although not very likely, it is possible for both buttons to perform an action during the same act cycle, which may throw your count off. Increasing the scenario speed will help in minimizing that possibility. Limiting the value of the field to between zero and three on any change in its value would also help to rectify it when it does go off value.
Sound issue in Greenfoot
By m84ef, with 1 reply.
Replied to by danpost, about 5 years ago:
m84ef wrote...
my code works fine (up to now). I wrote a code, so music plays when I press the level1-button, but the sound starts when I click the back-button and the sound is laging
Please provide
Level1
class codes.
How do I make actor disappear after touching another actor.
By ExistingProof, with 1 reply.
Replied to by danpost, about 5 years ago:
The only
Actor
class method that can remove an object from the world is the
removeTouching(Class)
method.
How do I make actors randomly generated on the screen infinitely?
By ExistingProof, with 1 reply.
Replied to by danpost, about 5 years ago:
Add
Cloud
objects from an
act
method in your
MyWorld
class (it is a
World
method that is repeatedly called by greenfoot while your scenario is running).
Test
By User7881818, with 3 replies.
Last reply by User7881818, about 5 years ago:
Vraag 3 Wolf class: import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class wolf here. * * @author (your name) * @version (a version number or a date) */ public class wolf extends LittleRedCap { private int marge=90; private int randomWalk = 5; public void act() { move(10); turnAtEdge(); walkRandom(); eatLittleRedCap(); } /** * turns the wolf unpredictable at the edge in another rotation. * * */ public void turnAtEdge() { int min=0;
magikarp pokegameing
By magikarp2010, with no replies.
<Code Omitted>
magikarp kool code pokemopn
By magikarp2010, with no replies.
<Code Omitted>
How to get and delete an object that you click on?
By RoverKnight, with 2 replies.
Last reply by RoverKnight, about 5 years ago:
I implemented the code you wrote in the 2nd insert, and it works now. Thank you! I did put my original code in the cell covers act method, but forgot that I didn't need to then check which cell got clicked on... :,)
76
77
78
79
80
81
82
X