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
Animation: The images will not switch back and forth
By BroTolo, with 10 replies.
Last reply by Super_Hippo, about 11 years ago:
BroTolo wrote...
What would i put in the else if?
To answer this question (even if you don't need it anymore): I only replaced your line 4 and added the 'else' for the 'if' in the next line.
Greenfoot and Bluej Portable package no no longer available
By lestopasso, with 3 replies.
Last reply by davmac, about 11 years ago:
The updated bundle is now available from the
download page
.
i need help with having my actor move along the y axis continuously
By nobody123, with 1 reply.
Replied to by danpost, about 11 years ago:
Let us start with line 9. It does the following: * declares an int variable named 'direction' * is assigned a value of one * its value is never changed after being initially set * its scope only lasts for as long as the method is executing With the above information on the variable, the act method given is equivalent to the following: <Code Omitted>To elaborate on the 'direction' variable. Each time the act method is executed, a new 'direction' variable is declared and its value is set to one. Its value is accessible only for
help with a project
By flash007, with no replies.
can somebody help me this inst working its compiling and the .wav is the right name and so is the class name so i would see why it wouldn't work <Code Omitted>
Help with my code?
By iCodeAsian, with 14 replies.
Last reply by iCodeAsian, about 11 years ago:
Err no the one you said or for. addObject( new Body (10, .0000000000000001, new Vector(Greenfoot.getRandomNumber(360), 6.2), new Color(239, 0, 255)), 1134, 726);
Random Moving Enemy on X axis?
By JohnFox, with 4 replies.
Last reply by smcgee, about 11 years ago:
I could not get the above code to work - but with a few simple changes I was able to get a car to randomly move on the X access randomly - thank you so much Super_Hipp! Here is my update to your code: public void act() { if (getX() < getWorld().getWidth()/2) xdirection=1; if (getX() > getWorld().getWidth()-10) xdirection=-1; timer++; if (timer > 50 && Greenfoot.getRandomNumber(20)==0 || ydirection==-1 && getY() < 100 || xdirection==1 && getY()>getWorld().getHeight()-10) { timer=0; ydirection *= -1; } setLocation(getX()+xdirection,ge
How to make the white keys respond to different keys on the piano scenario.
By 4SeaBass, with 2 replies.
Last reply by 4SeaBass, about 11 years ago:
Ok thx! I will try it and see if it helps!
Need help with planets moving in solar system
By DanielChaffey, with 1 reply.
Replied to by Super_Hippo, about 11 years ago:
<Code Omitted> This pauses the whole scenario and not only the current planet. So you should remove that line. Instead, you can either have more points on your circle in this methods (increase rotation by less than 1 in line 80) or you have a timer in the act method, so it is not executed every time. Both depending on the speed of the planet (which is 1 for all planets right now).
Zombie chasing the player while staying on the x-axis, only moving left and right.
By BroTolo, with 2 replies.
Last reply by BroTolo, about 11 years ago:
Thank you kind sir
I need help with getting the actor to follow a line
By bosciw, with 1 reply.
Replied to by danpost, about 11 years ago:
For the second question, you need a scrolling system. There are quite a few support classes within scenarios on the site that can assist with this (I have several -- for different types of scrolling). The size of the world is only limited to the amount of CPU time required to scroll the world. That is -- the larger the world, the more time, exponentially, that is needed to redraw the world. If the world is too large, scrolling may cause the running of the scenario to exhibit lagging. For the first question, your code, which will show how the actor follows the lines, how the lines are ar
How to drop an actor with the space button?
By IsabelSchouten, with 4 replies.
Last reply by Super_Hippo, about 11 years ago:
You could change the '- 2' to '- 1' or remove it at all to let it fall to the bottom. <Code Omitted> I don't have Instagram, sorry.
Select Java version
By DogeOverlord, with 2 replies.
Last reply by DogeOverlord, about 11 years ago:
Perhaps you could allow to drag a class editor into a separate window similar to Chrome, if for example you needed to look at one class while editing another.
POST Request to url
By dazdylz, with 1 reply.
Replied to by Super_Hippo, about 11 years ago:
Did you import the class?
Help with creating object in a for-string
By Skayo, with 1 reply.
Replied to by Super_Hippo, about 11 years ago:
What do you think should 'getY' return? The code is (probably) in a world subclass. A world doesn't have a position inside a world (which 'getX' and 'getY' would return). To add more than one object, move the first line into the for-loop. If the 'Randstreifen' is only a line on the background, you could draw it on the background instead of creating objects.
halp pls
By TheBrains1001, with 1 reply.
Replied to by Super_Hippo, about 11 years ago:
Where is the infinite loop? How many instances of each class do you want to spawn? You aren't calling the 'populateWorld' method from the constructor.
531
532
533
534
535
536
537
X