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
moving from level 1 to level 2
By ChrisD, with 1 reply.
Replied to by ChrisD, over 8 years ago:
i tried making altercations to the code so that everything that is happening in level 1 will happen in level 2 but instead there will be an error (e.g. instead of grabbing a crystal it will crash the game and say that it cannot be retrieved from level 1)
Uploading a new scenario instead of updating an old one
By Ruv25808, with 5 replies.
Last reply by Ruv25808, over 8 years ago:
Im not sure i understand you. Is there a different way i can name the scenario to make it say share instead of update?
move from level 2 to level 3
By ali18, with 2 replies.
Last reply by ali18, over 8 years ago:
Thank you for your help, its all working outstandingly.
Help aiming at a moving player
By jordanmyer, with 1 reply.
Replied to by danpost, over 8 years ago:
You are calling the 'getX' and 'getY' methods on a Class object, not on an object of the class. Player is the name of one of your classes, it does not refer to that which was created from the class, which is what has an x- and y-coordinate value in the world. You need to get the objects in the world of that class, if any, and then get the coordinates of it:
how do i make meteors fall randomly
By ChrisD, with 16 replies.
Last reply by danpost, over 8 years ago:
I will repeat one more time, more explicitly. The number of meteors dodged does not need to be tracked. For the first level, you will be spawning 20 meteors, controlled by the number spawned and the current maximum number to spawn. The 'meteorCount' field will count the number of spawned meteors this level and 'maxCount' is the maximum number of meteors to spawn this level (set to 20 for level 1), then (in world class act): <Code Omitted>says to spawn a meteor if the maximum has not been reached and any other conditions sa
Sound does not play
By 7oel, with 3 replies.
Last reply by 7oel, over 8 years ago:
danpost wrote...
I think you should simplify matters by ridding yourself of all the method calls. A simple class code might be something like this:
How to delay a new world
By 7oel, with 14 replies.
Last reply by 7oel, over 8 years ago:
danpost wrote...
Take the 'if' block out from where you put it, add the following into the class: <Code Omitted>and put the 'if 'block at line 3 of the act method supplied here.
thanks!
Timer and Powerup Question
By icantstudy995, with 6 replies.
Last reply by danpost, over 8 years ago:
icantstudy995 wrote...
Should I add slowDownTimer = 180 in line 6?
Yes, I forgot to mention how to start the timer.
when I add this piece of code, which is in the rocket class, my game over screen stops showing up when my rocket ship hits an asteroid.
Need to see the Rocket class codes -- not the world's.
I need a loop
By BrianOK, with 9 replies.
Last reply by danpost, over 8 years ago:
The code starting at line 12 in your last post is the beginning of a method called 'prepare' -- it is the prepare method within your Game class. What was so difficult to understand about that??? Okay, so currently you are only adding one huge Floor object into the world (supposedly). I will presume that the final setLocation line has a second parameter that is greater than 353. It would be best if you could reduce the width of the floor image by about 60%; and its height should be such that none (or very little) of its image is below the bottom edge of the world window. The less height
Trying to make a counter
By Nozarashi, with 5 replies.
Last reply by Nozarashi, over 8 years ago:
danpost wrote...
You are probably manually adding the Counter object into the world and it is probably not the same object that the 'counter' field refers to. Add a call to the 'prepare' method in your world constructor and adjust where the actors are spawned at. Then compile and only manually add ants into the world.
It's working now. Cheers Danpost.
How do I make an object follow another under condition?
By cryptxt, with 1 reply.
Replied to by danpost, over 8 years ago:
First thing is buttons2 should not be a static field. How many buttons are collected is the state of the actor itself -- not of the class. You can add a getter method to make the value accessible from outside the class: <Code Omitted>Then, in the ChaseKiller act method, a 'do-while' is not what you want. A simple 'if' will do there:
not a statement
By BrianOK, with 1 reply.
Replied to by danpost, over 8 years ago:
All you have is an arithmetic expression at line 17. It is not assigning any value to any variable. Maybe the first '+' should be an '='.
Help Me Please :(
By iban, with 3 replies.
Last reply by iban, over 8 years ago:
oh very difficult. my project already post you can see that. i want open stage 2 if score stage 1 >= 200 and same for next stage. my logic if stage 2 >= 200 than image stage 3 in World is changed to new image :(
How to link to a boolean from an actor, in the world?
By AndreasAagaard, with 5 replies.
Last reply by danpost, over 8 years ago:
AndreasAagaard wrote...
Ok, i changed that, but what i have to use it for is this code <Code Omitted> This does not happen when the game ends. Why?
Show the act method within the class that line is in.
I have a problem of not matching version.....So the world has not opened.
By MadhavSapkota, with 1 reply.
Replied to by danpost, over 8 years ago:
MadhavSapkota wrote...
I have tried to open the project of greenfoot done by friends in their own version . But while opening in my different version the world has a problem in starting.And the system shows you have to fixed manually,but I have not any idea.How to solve??Please help
You will have to post the entire world class code here and also give what version of greenfoot you are using.
358
359
360
361
362
363
364
X