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
How to animate Charakter
By Marcel.0311, with 3 replies.
Last reply by danpost, about 4 years ago:
Marcel.0311 wrote...
Ok , i somewhat understood your code but where to i have to tell what images i want to use?
See comment at end of line 2.
timer code
By siizwee, with 3 replies.
Last reply by danpost, about 4 years ago:
siizwee wrote...
do i have to initialise the simpleTime class?
You don't need that class unless you want the timer to be shown on the screen.
Create GreenfootImage from webcam?
By proGuest_0, with no replies.
Is it possible to create a GreenfootImage from a computer webcam?
How to save the current instance of a world to be able to pass into other world classes
By Cs-studentX, with 5 replies.
Last reply by danpost, about 4 years ago:
Okay. In all your world constructors, you are calling
prepare
prior
to setting the
mazeWorld
field. It is no wonder the field values in your
Actor
objects are
null
.
How to add strings
By johnsec, with 1 reply.
Replied to by danpost, about 4 years ago:
johnsec wrote...
I am trying to add these two strings together. How am I able to do that
<Code Omitted>
getWorld().addObject isnt working
By Sombra, with 3 replies.
Last reply by danpost, about 4 years ago:
Sombra wrote...
Thx a lot,and I appreciate seeing you in every post
Actually, you can completely remove the line that was incomplete since you create another object of that type to add to the world in the next line. The "problem" with the act method in general still would need resolved.
MouseClicked(this) does not work
By jeppe9756, with 1 reply.
Replied to by danpost, about 4 years ago:
jeppe9756 wrote...
the mouseClicked statement just works in a weird way
You probably have one or more objects that are over top of the button. When weirdness occurs, pause the scenario and right-click on the button to see what type actors are at that location. A possible fix is to add the following line to your world constructor: <Code Omitted>
How to make a variable that can access from any class
By Gabe1098, with 7 replies.
Last reply by danpost, about 4 years ago:
Gabe1098 wrote...
I meant if ((MyWorld)World()).score > 60
You cannot use that if the
score
is in the
Snake
class. You must get a reference to the
Snake
object and use it (instead of a reference to the
World
object). You may want to keep a reference to the
Snake
object in your
World
subclass: <Code Omitted>Then you can use:
((MyWorld)getWorld()).snake.score
for the score. Also, this way, the score is not lost upon removing the snake from the world.
Running greenfoot projects on blue j
By Roshan123, with no replies.
Is it possible to run greenfoot scenario on blue j? If yes then how am i supposed to do?
Issue in uploading scenario
By S-Square, with no replies.
I am not able to upload my scenario in greenfoot gallery it is showing html 5 version of this scenario is not available can someone help me regarding this issue
phassing through floor and platforms
By Dlantz, with 2 replies.
Last reply by Dlantz, about 4 years ago:
I'm sorry, but im lost. at the moment i want to fix my problem with the platforms
Help with code
By Gabe1098, with 4 replies.
Last reply by danpost, about 4 years ago:
Gabe1098 wrote...
I had a bug, the ones on the top wouldn't work.
I would have thought the rotation was previously set. This could be done with the following: <Code Omitted>This should initialize those actors placed along the top of the world to move vertically (using the code I previously gave above). Note that the rotation could otherwise be set from the world:
So I have a game that I don't get how it works
By DavidSaguna, with 2 replies.
Last reply by DavidSaguna, about 4 years ago:
danpost wrote...
Line 17 creates a new
Ground
object whose
boolean
will be
true
until another
Ground
object is created (by this new one). So, each
Ground
object will create the next one when needed.
Thanks! Have a nice day!
How to keep my timer, and health from one world to another
By jc.xi, with 3 replies.
Last reply by danpost, about 4 years ago:
jc.xi wrote...
1: with the line of code you provided "Greenfoot.setWorld(new QuestionWorld(this));", can you put it into a method in the maze class that returns a variable that stores that instances of the world? So that we can access it in other classes?
Unnecessary. "this" IS that instance of the maze world when used in the
MazeWorld
class.
2:what if the ...new QuestionWorld () is being called in an Actor subclass? Because of that line that creates a new QuestionWorld we have something similar already but it's in the smooth mover subclass that I have created.
Run on a webpage??
By henryufo85, with 1 reply.
Replied to by Gabe1098, about 4 years ago:
If you mean share your scenario? you click the share button on the top right
56
57
58
59
60
61
62
X