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
Glitching "a,d,w,s" keys?
By ggongwer, with 1 reply.
Replied to by Super_Hippo, about 8 years ago:
Maybe you can find you answer here:
https://www.greenfoot.org/topics/59948/
How do you make an object jump when the space bar is pressed?
By ThorneC, with 1 reply.
Replied to by danpost, about 8 years ago:
ThorneC wrote...
I am new to Greenfoot, so don't know much about it. If you could make your answers as simple as possible I will appreciate it.
This is really too general of a question with no given code to work off of (or with). The best general answer I can come up with is, using pseudo-code, something as follows: <Code Omitted>where vertical movement is done with a line of code similar to the following: <Code Omitted>
How to add level
By Arifwc, with 1 reply.
Replied to by danpost, about 8 years ago:
It appears that there is code that increases the speed as the score increases (see line 156 of the TetrisWorld class). Apparently, the value of 'speed' is dependent and in proportion to the score at a 1:1000 ratio. The value of 'speed' is convoluted in that it is not actually the speed, but is a term used in some expression that evaluates to the actual speed (the code could be more concise and clear).
Public Boolean Problem
By Abcba, with 1 reply.
Replied to by danpost, about 8 years ago:
Please show the codes that you had attempted -- cannot help fix without it (provide World subclass and rocket class codes).
Animated Gif
By CodeTalker, with 1 reply.
Replied to by danpost, about 8 years ago:
Try using the 'GifImage' class provided with the greenfoot download.
Skor
By JosephCS, with 1 reply.
Replied to by rikpratama, about 8 years ago:
buat variabel skor di class MyWorld; buat method setSkor() di class MyWorld; method ini untuk mengupdate skor di Actor Player panggil method setSkor() https://youtu.be/SCm5IUrhfwU
claraworld.net
By Ankitgujjar, with no replies.
<Image Omitted> <Image Omitted> This problem continues to test you in regards to code decomposition strategies, use of variables and possibly code modification. Clara’s task is to invert her world. This means putting a leaf in every empty cell and removing a leaf from every non-empty cell. While producing your solution for this problem you must use at least one variable (a good idea is to make this variable of type boolean). This variable should be used to help Clara in memorising the direction of her current movement. The simplest way to approach this problem is to base your solution around the sample code for ClaraCleaner from Lecture 3. But here, instead of cleaning the world you must invert it and you must make use of the variable that you declare in order to decide on whether to reposition Clara to the east or to the west, rather than looking at the trees around her to make this decision. Once you do it – make sure you clean up all the unnecessary code from the base solution. The initial configuration is shown in Figure 1 and the result should look similar to Figure 2. Figure 1 Figure 1. Figure 2 Figure 2. Clara always starts in the upper left corner facing east! Your program should be generic enough to handle any world configuration. Example worlds supplied with this problem will help you to test your code.
Trying to display instructions before game stops
By Brantgarron, with 3 replies.
Last reply by danpost, about 8 years ago:
Add the following line to the 'instructions' method: <Code Omitted>
Need Help with Tetris Game
By Arifwc, with 4 replies.
Last reply by Arifwc, about 8 years ago:
Thankyou super_hippo. really appreciated it
Lists
By CavemanWrath, with 1 reply.
Replied to by danpost, about 8 years ago:
Use the 'getNeighbours' method in a list iterating for loop -- something like this: <Code Omitted>You will need to be more specific than getting Actor type objects so that you can perform your check on the actors.
Space Invaders Project
By Toaster, with 8 replies.
Last reply by Toaster, about 8 years ago:
It worked. Thanks! I know i'm asking a lot, but could you tell me or guide me on how to get my aliens to move from one side, down, then move to the other? I'll try to upload my game if you need to know what I'm talking about.
Trying to add score when actor gets to 100 on the x axis
By ryan22, with 10 replies.
Last reply by ryan22, about 8 years ago:
Thanks sm
Shooting: bullet does not move across screen
By michelleed, with 3 replies.
Last reply by danpost, about 8 years ago:
I do not think the Vector class should extend the Actor class -- a vector is NOT an actor (I doubt you saw that in any scenario examples). A vector is an object with two values -- an angle and a length, which is what are needed to describe a vector. The Mover class creates a Vector object to describe the current direction and speed (or 'movement') of the actor. The Mover class should extend the Actor class and the Vector class should extend the Object class (this is implied if no 'extends' clause is given in the class declaration line). Next question: At the beginning of your world cons
Can't upload my scenario
By donysamdhila, with 1 reply.
Replied to by danpost, about 8 years ago:
There is, I believe, a 20MB limit on uploaded scenarios. There may be some things you can do to reduce the size of your scenario. First, start by remove any and all sound and image files currently in your 'sounds' and 'images' folders of your project folder that are not being used (you may not find you have any to remove -- but so be it). Next, make sure you use the 'jpg' (or 'jpeg') format for images used in the backgrounds of any of your worlds (they use less storage space than other formats). Also, if you can reduce the size of any of your sound files either by cutting their length or u
setting a timer for my game
By rory, with 1 reply.
Replied to by danpost, about 8 years ago:
rory wrote...
I want to set my game to have a 2-minute timer (displayed on the screen) and after the timer ends the game stops. I have no clue how to program this. help.
My
Value Display Tutorial
shows how to create a displayable timer.
306
307
308
309
310
311
312
X