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
My missile continues in all eternity and destroys object out of the frame after I shoot my missiles?
By JoNGrEeNfOoT, with 11 replies.
Last reply by JoNGrEeNfOoT, about 7 years ago:
Okay, thank you alot
Terminal Error: NullPointerException
By SpeckieChan, with 7 replies.
Last reply by danpost, about 7 years ago:
SpeckieChan wrote...
I downloaded the tutorial game from the website and there it works perfectly: << Code Omitted >>
As it should. Only one
Counter
object is created there.
random
By Adambruzac, with 3 replies.
Last reply by danpost, about 7 years ago:
Adambruzac wrote...
Between yes. I figured out how to stay between the walls on the length, but when it spawns, I need to find a way on how to not exceed the walls on the height if that makes sense.
Sounds like you have 4 conditions for one coordinate value and 2 conditions for the other; but the order of coordinates could be swapped. So either (the x-coordinate is between the inner and outer walls and the y-coordinate is between outer walls) OR (the x-coordinate is between outer walls and the y-coordinate is between the inner and outer walls). By "inner and outer walls", there are tw
no suitable method found for move HELP!!!
By shane11300, with 1 reply.
Replied to by danpost, about 7 years ago:
shane11300 wrote...
Tried making a game earlier and everything was going fine until when I was almost finished the game did not run because a message keeps on saying "no suitable method found for move", please help me I really need this game for my work:) Below is the code and the word "move" keeps on having the message pop up "no suitable method found for move". please help me:) << Code Omitted >>
Please show your Mover class code, as well -- and use code tags (square brackets with the word "code" before the code and same with "/code" after).
Rotating canon from the end
By dev4ltar, with 35 replies.
Last reply by dev4ltar, about 7 years ago:
yes, so on rot 360 it can't have direction = 1 or having Rot = 361, only direction = 0 or -1 so the rotation is 360 or 359- and so does 300 can't have direction = -1 or having Rot = 299, only direction = 0 or 1 so the rotation is 300 or 301+ thank you very much
Bullet moving in direction that actor is facing
By Pando, with 3 replies.
Last reply by Pando, about 7 years ago:
nvm i used found it out by using getRotation() in bullet class and changing speed (-/+) based on angle
help with breakout
By Quickske, with 3 replies.
Last reply by danpost, about 7 years ago:
Quickske wrote...
i'm sorry, but i still don't understand is. :s would it be possible to clarify it a bit further?
Please refer to
this page
of the java tutorials.
intersecting objects
By sarah02, with 2 replies.
Last reply by sarah02, about 7 years ago:
Thank u!
reloading ammo, help
By shah5826, with 17 replies.
Last reply by shah5826, about 7 years ago:
Great! thank you
Checking if an object of the same class as others are still in the world.
By iCookieMad, with 8 replies.
Last reply by iCookieMad, about 7 years ago:
Thanks for the reply, but I couldn't use that code (I probably didn't explain what I wanted very well). I came up with another solution where I'd remove and then spawn back in all the tiles, in one frame, so that they would all be restored. Thanks anyway though!
I need Help With An Assignment
By Sean03, with 1 reply.
Replied to by danpost, about 7 years ago:
You only need to combine the two conditions. In pseudo-code: <Code Omitted>The last line combines the two conditions and returns the result. This can also be simplified to this: <Code Omitted>without having to explicitly declare the boolean variables.
Making a timer
By Fargesia, with 2 replies.
Last reply by Fargesia, about 7 years ago:
Oh I get it thank you so much, seems logic now.
Stalling an AI
By Samummy1, with 1 reply.
Replied to by danpost, about 7 years ago:
Samummy1 wrote...
I have code for an AI that I am creating for pong. I am trying to get it so that it will have to wait based on a small probability. If anyone has code or an idea on how to program this please reply
Add a timer field (outside any method): <Code Omitted>Give a wait time (in act cycles) to
waitTimer
on small chance (in
act
or in a method called from
act
): <Code Omitted>Do normal AI stuff only if waitTimer is zero; otherwise, do nothing more than chalk time:
Hit detection.
By Will5230, with 3 replies.
Last reply by danpost, about 7 years ago:
Will5230 wrote...
Sorry , could you be more clear? I tried to change signs in line 150 but that mixed up both of the sides.
Changing something in one should not effect the other at all. What is your new line 150? Show what you changed.
Updating Money score.
By DragonL68, with 16 replies.
Last reply by danpost, about 7 years ago:
DragonL68 wrote...
<Code Omitted>
The clickable objects are not shops, but, in essence, buttons. Their classes should extend the
Actor
class.
222
223
224
225
226
227
228
X