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
platform problem
By razenoid, with 5 replies.
Last reply by danpost, about 8 years ago:
This will be a bit complicated, especially since there is scrolling involved. The turn around points need to be fields, not just local variables, so that their values are retained from one act step to the next. Then, they will need to be adjusted anytime horizontal scrolling is implemented. Finally, after moving, the location and direction need checked for each turn-around point to determine if the actor is to turn around.
need help on my AI
By gaisuke, with 3 replies.
Last reply by Super_Hippo, about 8 years ago:
You have to write an algorithm for that. As long as the flag doesn't change its location and the maze doesn't change in some way, it is enough to calculate it once. I think the best way to do this would be to start at the flag, give it route length 0, the possible neighbor cells are then 1 and so on. And then, when you reach the AI, it will have a route length (X) too and can find the shortest route moving from X to X-1, X-2, ... to 2, 1, 0. You can then save this route in a list, so you don't have to calculate it again and again. I don't have the algorithm in code. Maybe you can find maze sc
Object Detection
By CavemanWrath, with 2 replies.
Last reply by CavemanWrath, about 8 years ago:
THANK YOU
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
306
307
308
309
310
311
312
X