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
Wombat Scenarion help !!!
By KOSIUS, with 1 reply.
Replied to by danpost, over 11 years ago:
Although the wombat is not an enemy,
this
still might help. It is the same type of movement.
How to check actor compatibility?
By Stoeptegel, with 1 reply.
Replied to by danpost, over 11 years ago:
Line 5 uses 'getOneObjectAtOffset'. The documentation shows that it returns an object of type Actor (regardless of what class of object you are looking for). To access anything in the Container class with the field 'containerPicked', you need to let it be known that the field holds a Container type object. <Code Omitted>This line takes the actor (containerPicked) and casts it as a Container type object and then sets the new variable 'cp', which is declared to hold a Container object, to that actor.
Constructor booleans do not work properly.
By Stoeptegel, with 2 replies.
Last reply by Stoeptegel, over 11 years ago:
Ah! I almost forgot about switch cases *shame*. Thanks mate! Much improvement :)
Error: n must be positive
By Pe1per, with 7 replies.
Last reply by davmac, over 11 years ago:
Super_Hippo wrote...
How is 350-250= -100?
Hmm, you're right. I mis-read that code (as 250 - 350). However, the 'n must be positive' error nearly always comes from mis-use of the Greenfoot.getRandomNumber method, in my experience (and it certainly doesn't come from addObject). Pe1per, perhaps you can point out which line actually causes the error rather than forcing us to guess?
Press a button while Game is over problem?
By AnthonioBanderas, with 1 reply.
Replied to by Super_Hippo, over 11 years ago:
Are only enemies moving? I think I didn't really get the way the game works right now. You get points for every click on an enemy and you have to place them back until one reaches the right side? Could it be that the seeLocation method (which I don't really understand why it is made like this) is quite useless? It is only called when it was dragged to a different position and if it is on a target position, it shouldn't move. How is this supposed to be? You could do it like that:
I dont want to press 2 buttons at a time
By Moho, with 3 replies.
Last reply by danpost, over 11 years ago:
For continuous: <Code Omitted>
trail following player
By Moho, with 1 reply.
Replied to by danpost, over 11 years ago:
<Code Omitted>or <Code Omitted>
Need Help ASAP
By n1nikko, with 1 reply.
Replied to by Super_Hippo, over 11 years ago:
Use the code tags to post code please. What I would suggest first, because this code is a mess (and it isn't easy to get an overview of what is important and what not), have the images in arrays. Then you can code that in a few lines and don't have to do something like what you did there.
Is this code correct for having an enemy moving left to right in my maze?
By pingster, with 2 replies.
Last reply by pingster, over 11 years ago:
Firstly thanks for the reply . Could you possibly give me a suggestion of what the code in line 3 and 6 needs to be?
Help With My 'Game Over' after HealthBar is Empty
By Manda_x, with 4 replies.
Last reply by Manda_x, over 11 years ago:
thanks its works now, you've been a great help to my game.
Array Problems
By xJesterPROx, with 7 replies.
Last reply by xJesterPROx, over 11 years ago:
In your second Demo, can you explain to me how the tail knows how to follow the head? I would post the code that covers things like direction and spawning the tail is almost the entire snake class.
Any ideas?
By pingster, with no replies.
Has anyone got any ideas about what to put into a maze game? Thanks
Slight Problem Getting Counter To Work
By Manda_x, with 13 replies.
Last reply by Manda_x, over 11 years ago:
thank you guys its now working
Boolean for sensing objects on one side?????
By DiplomatikCow, with 9 replies.
Last reply by danpost, over 11 years ago:
You should be able to use code similar to the code of the act method except that you will reverse the direction of the turns and look for walls instead of looking for where walls are not. This should be done once, when the actor is added into the world (use the 'addedToWorld' method).
How can I test the performance of the game?
By EnderPicture, with no replies.
http://www.greenfoot.org/scenarios/13054
608
609
610
611
612
613
614
X