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
is anyone here can help me writing a while loop for a Z pattern?
By MLP, with 6 replies.
Last reply by MLP, over 10 years ago:
thank you so much
Line break
By Lio1020, with 1 reply.
Replied to by Super_Hippo, over 10 years ago:
Write \n at the position you want a new line to begin.
How can an object hide or remove itself?
By JohnOfStony, with 1 reply.
Replied to by Super_Hippo, over 10 years ago:
To make the world unbounded: Double click your world subclass. Find the first line in the world constructor and add another parameter 'false', e.g.: <Code Omitted>To make an object remove itself from the world, use the 'this' keyworld: <Code Omitted>
Physics in 2D raycasting Engine
By wabuilderman, with 2 replies.
Last reply by wabuilderman, over 10 years ago:
The 'MoveWithPhysics' function is essentially drawing a line segment between my current location, and the new desired location. If this movement line were to intersect any wall, I want to place the player slightly behind the point of the collision (that way he isn't stuck in the wall). As for the fisheye-effect, thanks for the tip. I will look into that. Also, interesting fact about doom. I hadn't realized that.
Edit the IceBurgs so that they move and turn randomly.
By JamesHughes244, with 1 reply.
Replied to by danpost, over 10 years ago:
JamesHughes244 wrote...
How would I edit an object to turn and move randomly in an 8 by 8 grid world.
First, I would add fields for a pre-determined destination grid-square: <Code Omitted>The initial value of these fields should be the coordinate values of the location the actor was placed into the world at. The 'addedToWorld' method can be used for this (so you can use 'getX' and 'getY' to set the value of the fields with). Then, to make things a bit easier, we will alternate between moving horizontally and moving vertically. This will mean only one tu
Facing in the direction of movement
By JamesHughes244, with 4 replies.
Last reply by JamesHughes244, over 10 years ago:
Thats great, thanks SPower and danpost
Eating worms
By Aquariusnights, with 1 reply.
Replied to by wabuilderman, over 10 years ago:
Um, assuming that you followed the tutorial word for word, it should work 100% of the time. Double check your code and make sure everything is exactly the same. If all else fails, then paste the problematic code here.
Moving randomly in four directions?
By JamesHughes244, with 2 replies.
Last reply by JamesHughes244, over 10 years ago:
Thank you very much, this solution is great! The actor doesnt seem to stay near the same location in reality though so it works fine. Thanks again!
Enemy Health Not Working
By AreebRaza, with 20 replies.
Last reply by danpost, over 10 years ago:
AreebRaza wrote...
is it possible to make enemies with health in one class
What are the differences between the classes?
danpost wrote...
Remove 'static' from the 'health' declarations lines in the Skeleton classes at line 20.
Actually, I do not think anything in those classes should be declared as 'static' (as yet), except for maybe the images. Remove all occurrences of the word 'static' in those classes. Note (do not make any changes for this unless you fully understand or get further help on this): I mentioned the images because currently, as your code is, each en
getRotation() not setting rotation properly
By Xevinaly, with 3 replies.
Last reply by danpost, over 10 years ago:
The problem is due to the limitations of the screen and the speed of your CommandMissile actors, which is one. The pixels in the screen are arranged in rows and columns. When moving one pixel, there are a limited number of ways the movement can be made -- horizontally, vertically or diagonally (to one of eight pixels). This drastically reduces the number of angles that the missile can travel at. There are a couple of ways (at least) that you can compensate for this; one is to track the location coordinates of the missile with more precision and the other is to save the starting location of
Issue with object going backwards
By CuddlySpartan, with 5 replies.
Last reply by danpost, over 10 years ago:
CuddlySpartan wrote...
Okay so I tried that but it didn't quite work. When the bullet hit the camooctopus, the octopus would spawn not on the line so it wouldn't be able to move. It spawned below where the original camooctopus was.
Sorry -- I wrote that out a bit quickly. Line 4 above should be: <Code Omitted>
NullPointerException That I Really Need Help With
By mreed7231, with 4 replies.
Last reply by mreed7231, over 10 years ago:
danpost wrote...
(3) the block of code starting at line 22 of the mBullet class is missing its identifying code; should probably start with 'public void act()'.
THANKS FOR THE HELP that was the main issue causing my error and I'll go in and fix up that other stuff too.
Avoider game-help me fix problems
By donatela201, with 3 replies.
Last reply by danpost, over 10 years ago:
Please show the code for the class this 'addedToWorld' method is location within. Also, show what code you are using to add the Skull actor into the world.
This throws up an error help please
By SiWeller, with 3 replies.
Last reply by SiWeller, over 10 years ago:
its ok now thanks anyways
constructor cannot be applied to given types
By chrl98, with 7 replies.
Last reply by danpost, over 10 years ago:
Link99 wrote...
I need help with something similar, in my pokemon game I want to have an enemy appear every few steps I take, but the constructor for enemy required an int and a class from playerheroes.
You should start a new discussion thread on your issue -- not revive one that is over two years old. Also, you need to supply the codes you are currently using (the class of the enemy and the class of the playerheroes).
456
457
458
459
460
461
462
X