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
Add certain amount of objects
By SemDeBakkero, with 10 replies.
Last reply by SemDeBakkero, over 6 years ago:
Oh shit thanks!!
Getting the location of an object
By ihjufaeshiju, with 3 replies.
Last reply by danpost, over 6 years ago:
ihjufaeshiju wrote...
Can you explain what line 5 does though?
LIne 5: <Code Omitted>defines a variable that can reference an
Actor
object and assigns to it an object, from the
houses
List
object at index
i
, cast as an
Actor
object (
(Actor)
).
Download a new font
By Ti103, with no replies.
Hi, i'm new here. I have a project and i have to use a downloaded font. When I use anyfont, it works very well, but when I use the downloaded font, it doesn't work.<Code Omitted>
fff
By DARKSGAMER, with 1 reply.
Replied to by AndyGun, over 6 years ago:
?
Greenfoot exercise 9.69
By dROS, with 1 reply.
Replied to by danpost, over 6 years ago:
dROS wrote...
Can anybody check my code? Code is between 77 to 89.
The condition on line 81 will always be true (that is, unless size is less than or equal to zero -- which would be never). I think you should be asking if the size is greater than 16 or not.
Exercise 9.69 Fix the score count
By dROS, with 3 replies.
Last reply by danpost, over 6 years ago:
dROS wrote...
code for more classes can you check it. << Code Omitted >>
Appears okay. And, finally, your
Bullet
class? It would seem like that is where the collisions are detected.
How can i have a player to move a certain amount of steps in order to finish the game?
By KiddoNow, with 1 reply.
Replied to by danpost, over 6 years ago:
KiddoNow wrote...
I have a player and they can move 1 step by pressing an arrowkey. Now i want them to reach an object and collecting it BUT with a certain amount of given steps. Lets say you start in the bottom left corner and the other object is somewhere in the upper right corner. Now you have to reach that object with exactly 15 steps e.g. How can i make such a counter?!
Just add an int field for the player. Increment it each time it moves. When object is reached, check its value for win/lose.
How to get the code for the Greenfoot base classes
By SailingStone, with 2 replies.
Last reply by SailingStone, over 6 years ago:
Thanks for that! That helps a lot.
Objects moving from the right to te left
By SemDeBakkero, with 3 replies.
Last reply by SemDeBakkero, over 6 years ago:
Aha, I didn't know that. Thanks guys
Enemies still Spawning
By Alexkr, with 3 replies.
Last reply by Alexkr, over 6 years ago:
I could fix it, thank you for the fast and clear response.
Delete Account
By Galaxy, with no replies.
Hi! I was wondering if it is possible to delete my account. And if so how?
Error
By Nate2002, with 3 replies.
Last reply by Nate2002, over 6 years ago:
Thanks it works now :)
Turn Object to the direction of the mouse
By SemDeBakkero, with 10 replies.
Last reply by SemDeBakkero, over 6 years ago:
danpost wrote...
Just to be clear, an actor with zero rotation is considered to be facing (or turned towards) the right. If the image given the actor is not one that naturally "faces" right, then you will need to do something extra to make it appear properly. Let us say that you have a rocket image which "faces" up as it would when in a landed orientation. You could set it as the default image and change its orientation in the constructor of the class:
Remove bullet after killing
By SemDeBakkero, with 2 replies.
Last reply by SemDeBakkero, over 6 years ago:
danpost wrote...
You are calling two methods, each which could remove the actor from the world (lines 12 and 13). Neither of these methods can execute properly if the actor is not in the world (one uses
getOneObjectAtOffset
and the other
isAtEdge
,, both requiring the actor be in a world). Regardless of the order these methods are called, if the first one removes the actor, the second one will fail. There are two main ways to avoid this dilemma. One is to not remove the actor is those called method, but have them return a
boolean
value indicating the "to-remove" state
Programming of a ghost in pacman
By annika.g, with 1 reply.
Replied to by Super_Hippo, over 6 years ago:
You can check my Pac-Man game here:
https://www.greenfoot.org/scenarios/19573
It is pretty similar to the original one and you can view the source. However, it is mostly in German. The code for the ghosts is located in the Geist class.
160
161
162
163
164
165
166
X