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
NewPong
By ronald, with 25 replies.
Last reply by ronald, over 3 years ago:
thank you spock47 for this code I also had the idea of a snake Anyway, I'm going to try your code and another from snake I am also working on another project I am looking for how to access from an actor class a void method of another actor class, there are several ways to achieve this I had a little trouble understanding Thanks for your help
hello I need help with this getObjectsInRange method
By bañaperras, with 28 replies.
Last reply by bañaperras, over 3 years ago:
hey thanks for the help I have already finished my game it has been a good experience in the forum I feel very comfortable in this community thank you really soon I will upload it to the forum so you can see what I learned thanks to you I hope that if someone is in need can help see you soon :)
Help with transferring actor's instance variables
By Gabe8469, with 4 replies.
Last reply by Gabe8469, over 3 years ago:
Sweet, now it's working perfectly! Thanks alot for your help!
How do I make an exe from a greenfoot scenario?
By KOTerra, with 3 replies.
Last reply by RcCookie, over 3 years ago:
I've built the project for you:
https://drive.google.com/file/d/1NEnP8RrfqYHAkIsIpcSxmSAYJHINbUUz/view?usp=sharing
life or gasoline
By elvacan, with 4 replies.
Last reply by danpost, over 3 years ago:
elvacan wrote...
if you can pass me the code
With the int field: <Code Omitted>It might look something like this: <Code Omitted>
life bar
By elvacan, with 1 reply.
Replied to by RcCookie, over 3 years ago:
There is no general solution to a problem like this. But here is some useful information: If you want to do it the object oriented way, you may create a HealthBar class: <Code Omitted> To create a visual health bar, use GreenfootImage to set the objects image. Here are some important methods:
hi
By truck_hunt97, with 1 reply.
Replied to by Spock47, over 3 years ago:
Here is a source code that slows down all enemies by one movement point for 5 seconds when You collects a SlowDownObject. The SlowDownObject is consumed in the process. <Code Omitted>
achievements
By elvacan, with 14 replies.
Last reply by danpost, over 3 years ago:
RcCookie wrote...
RcCookie wrote...
Should be:
danpost wrote...
spawning actors on top of moving actors
By tedyy, with 2 replies.
Last reply by danpost, over 3 years ago:
The error occurs because
getObjects(Shit.class)
returns a
List
object, not a specific
Actor
object, and
getX()
and
getY()
are only declared in the
Actor
class as instance methods. That is, you cannot use those methods on a
List
instance. You must first make sure that the list is not empty. Then, if not, extract a ship from the list and use the methods on it.
My for clause doesn't work
By Turbo_Thorsten, with 3 replies.
Last reply by danpost, over 3 years ago:
Also, line 3, within a
for
loop, is troublesome because you a scaling the same image multiple times, which never works well. Best is to save the original image in an instance field, and on each iteration of the loop, create a copy of that image and then scale the copy once.
i need held with my code
By truck_hunt97, with 3 replies.
Last reply by danpost, over 3 years ago:
truck_hunt97 wrote...
I have a coin counter, every time I take one, this is the account, how do I multiply its value?
Show all methods and fields that deal with the coin counter and indicate the classes each code block/field is in.
Hi i need held thanks in advance
By truck_hunt97, with 1 reply.
Replied to by Spock47, over 3 years ago:
Please have a look at https://www.greenfoot.org/topics/64967/0 There is a menu to choose which ship the hero is flying. You can reuse it for your idea, especially adding buttons for each position to the chooser-menu. At the button action, you can also add a check whether the hero has enough coins and the reduction of coins when the number of coins is sufficient. You can also add booleans to the hero class to indicate whether the effects are already bought. Please let me know whether this helps, otherwise just add additional questions as response here to resolve any remaining problems.
I need help pls
By OE51, with 2 replies.
Last reply by Spock47, over 3 years ago:
The problem is probably the check "x>=0 ||x==getWorld().getWidth()". The first part checks whether x is greater or equal 0, which is always true. But I think you want to check whether x is less or equal. Note, that you need two simple ideas as the basis for the reflecting: 1. If the fish bounces off top or bottom, its new rotation is 360-oldValue. 2. If the fish bounces off left or right, its new rotation is 180-oldValue. A simple source code to implement this:
I need help with a code!
By ELquenosabena, with 2 replies.
Last reply by ELquenosabena, over 3 years ago:
ok, but, could you send me a code, as an example, if you can
I need help with some code
By nedenatt, with 1 reply.
Replied to by danpost, over 3 years ago:
Use
Actor
type objects to display clickable text. Use
World
objects for different screens (probably).
38
39
40
41
42
43
44
X