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
help with if statement
By Psg1223, with 4 replies.
Last reply by danpost, over 1 year ago:
Psg1223 wrote...
it returns as getobjects is always equaling zero and never changes the string variable
It does set a
String
variable called
player
to "
Ninja
" -- just not the one you think it should. Line 35 declares a new variable called
player
which is not the variable you declared on line 10. Remove the "
String
" from line 35 so the one on line 10 gets set.
Aquarium Lab
By r0b75hg7, with 2 replies.
Last reply by r0b75hg7, over 1 year ago:
Thanks, I got it.
Pollinating Bees Lab
By r0b75hg7, with 1 reply.
Replied to by r0b75hg7, over 1 year ago:
Never mind.
Trying to get the physics in my platformer right
By Nextonic, with 17 replies.
Last reply by danpost, over 1 year ago:
Nextonic wrote...
Looks something like this java.lang.RuntimeException: The gif file "images/RunRight.gif" doesn't exist.
Double check the file name and suffix. All characters must be in the proper upper/lower case.
trying to get radio button in java to work
By divinity, with 15 replies.
Last reply by danpost, over 1 year ago:
divinity wrote...
I see the error and put in the curly (}) that I had miss out but now am getting another error << Code Omitted >>
Looks like you are trying to treat the
Banking
object as a
java.awt.Component
object, which, as coded, it is not.
Enemy wave system
By Deepfist, with 2 replies.
Last reply by Deepfist, over 1 year ago:
The code is amazing, my DelayTimer is a bit different however. Nonetheless it's still wonderful and it has helped a lot (was stuck on this for a while). Thx a lot :D
Programing an endless route with 2 gifImages
By Ururu, with 7 replies.
Last reply by danpost, over 1 year ago:
Ururu wrote...
thats right. I managed to simplify it based on whats within my knowledge and it works now :)
Please provide what you simplified it to.
Moving an actor towards another without rotating
By VOiDBABY, with 1 reply.
Replied to by danpost, over 1 year ago:
VOiDBABY wrote...
I'm creating a 2D game in which enemies on the right side chase after the player on the left side. I was wondering if there's another way for the enemies to chase after the player as they move without rotating as it flips the images (has animations) upside down and backwards. I'd appreciate any suggestions or feedback! Here's my current code: << Code Omitted >>
Just reset the rotation back to zero after moving: <Code Omitted>
Bullet despawn
By Wizzzarium, with 2 replies.
Last reply by Deepfist, over 1 year ago:
You need to implement a hit registration, you can do this the following way <Code Omitted> <Code Omitted>In this instance the bullet is looking if it intersecting with the actor Object. If it isn't intersecting (so it is null or == null), then it returns false
How to make a bullet disappear after hitting?
By Wizzzarium, with 3 replies.
Last reply by Wizzzarium, over 1 year ago:
<3
How to code Player chasing an actor but it runs away as much as possible from the player?
By MuchieBun, with 1 reply.
Replied to by danpost, over 1 year ago:
MuchieBun wrote...
It's like ghost from Pacman. I don't know how to code it, I've found sources but I can't understand it how it works. It's really difficult.
To run away: <Code Omitted>That is one way, at least. The idea of other ways is the same. Determine where (and possibly, how close) the player is, then turn away and move it.
Can you help me to solve this error?
By MuchieBun, with 6 replies.
Last reply by danpost, over 1 year ago:
MuchieBun wrote...
how can i make my manager not to go through walls. Because, when the manager start to chase the player, it goes through the walls. :((
Well, you probably just want to reverse the moving if a wall is encountered. That is: <Code Omitted>There is no need for a separate method for this (remove the "
public void Wall()
' method). The order of instructions in your
act
method should probably be as follows:
I need Help Programming smooth Mouse Moving for a Parking Jam type game
By JyspeKV2, with 4 replies.
Last reply by JyspeKV2, over 1 year ago:
The first Fix works Perfectly thank you danpost
Transfer values from world class to an actor class and vice versa
By Ramrun, with 3 replies.
Last reply by danpost, over 1 year ago:
Ramrun wrote...
In one of my cases, the value of three int variables is determined in the subworld class 'Bloodstream' in the following code: << Code Omitted >> It should then be possible to use these three variables in the actor subclass 'whitecell' That is my try: <Code Omitted>
Assuming the variables in question are declared
static
, all you need do is put the class name first (before the variable names) on the right side of the 3 lines. If they are not
I need help publishing my game
By SaltyBacon, with 4 replies.
Last reply by danpost, over 1 year ago:
SaltyBacon wrote...
It didn't fix it. do you have any other ideas?
There is one in your
Counter
class and one in your
HealthCounter
class as well. If it does not work after changing those also, you may have to consider loading the music files on the fly, instead of right at the beginning. For example: <Code Omitted>You would then have to check if the val
15
16
17
18
19
20
21
X