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
When Dragging Actor and moving Actor Around A lot of LAG
By joshthebossxxl, with 2 replies.
Last reply by RcCookie, over 4 years ago:
I does not matter weather there are other objects in the world, and it also applies for big transparent images.
How do you find out if your actor is in the top-half and bottom-half?
By BlueHand, with 8 replies.
Last reply by danpost, over 4 years ago:
BlueHand wrote...
I'm trying to make it so that an object (participant) turns 90 degrees every time it encounters an obstacle. The direction of the turn should be different depending if they are in the top-half or bottom-half of the world. Top-half turn clockwise, bottom-half turn counterclockwise.
Okay, so the code you have shown is inside another
if
block, like "
if (isTouching(Obstacle.class))
". Then your code should be okay. It could be more succinct, like this: <Code Omitted>or <Code Omitted>
How do you change a value in a actor at a certain location
By KylesGallery, with 1 reply.
Replied to by danpost, over 4 years ago:
KylesGallery wrote...
I want to change a boolean but the objects are never touching and there will be multiple of both actors, so i want to get code so it only changes it a actor if it is at a certain location
Show attempted codes (need to know what you are dealing with).
x value
By BlueHand, with 1 reply.
Replied to by danpost, over 4 years ago:
First, you need to declare the variable "
x
". Next, with code being in your world class, if anything "
world
" should be "
this
". Finally, "
grass
" needs to refer to a
Grass
object. However, you seem to already know its width. <Code Omitted>
how to teleport to a location as a character movement?
By ambrokato, with 1 reply.
Replied to by danpost, over 4 years ago:
Essential code: <Code Omitted>A direction key must also be pressed. The dashing can be limited either by distance traveled or by time between use, or both.
Help needed!:
By amit3118, with 2 replies.
Last reply by danpost, over 4 years ago:
Change line 11 to: <Code Omitted> and line 12 to: <Code Omitted>
Help needed!:
By amit3118, with 3 replies.
Last reply by RcCookie, over 4 years ago:
To set the image of an actor: <Code Omitted>
How to create a “border”
By BlueHand, with 1 reply.
Replied to by RcCookie, over 4 years ago:
A for loop follows this system: <Code Omitted>Here’s a normal for loop printing the numbers 0-9. Usually the counting variable is called i (short for index, iterator,…): <Code Omitted>In your case, you may want to use a slightly different loop:
Stuck near the teleport instead of transportation to a new location
By Olexandra, with 2 replies.
Last reply by Olexandra, over 4 years ago:
Thanks! I thought that stepping away should prevent the cycle. But it doesn't work. <Code Omitted>
java.lang.NullPointerException error
By BenjiFoxy, with 9 replies.
Last reply by danpost, over 4 years ago:
An easier way is to not worry about which counter it is. You only need one Counter class that can create both counters. Your Tardis class would simply be:
I can't seem to fix the error I get for paddle 2, which is cannot find symbol. I understand how I got the error but do you guys know how to fix it?
By Dannythechanp, with 8 replies.
Last reply by danpost, over 4 years ago:
I do not understand why a paddle would need to know anything but what keys to react to:
How to find the smallest value from objects created
By Jemy, with 43 replies.
Last reply by Jemy, over 4 years ago:
danpost wrote...
Change line 3 in leader code to: <Code Omitted> OR: maybe the server timers need to be reset (?)
I tried your suggestion, it worked but when i tried to run it again instead of changing to candidate for a new leader to emerge, it changes to the leader. i think server timers need to reset to allow another low server to be candidate and eventually be elected each time the simulation is run
control the camera
By Aaron-aid, with 1 reply.
Replied to by danpost, over 4 years ago:
Aaron-aid wrote...
hey, i was wondering if its possable to move the camera with the player, if so how?
Please refer to my
Scrolling Tutorial
scenario.
How to flip a fuelbar by 180 degrees
By Jeeshan, with 2 replies.
Last reply by Risen, over 4 years ago:
<Code Omitted>
How to use setters and getters
By Jeeshan, with 5 replies.
Last reply by Risen, over 4 years ago:
Jeeshan wrote...
Jeeshan wrote...
<Code Omitted>
This is the code that isnt working. I want fuel to decrease after every amount of time but the fuel remains constant
Show class code please. Can't understand, where you get FuelAmount(FA)
74
75
76
77
78
79
80
X