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
how to change worlds between levels
By liverpoolfc, with 7 replies.
Last reply by Super_Hippo, over 7 years ago:
You could add a 'Greenfoot.delay(600);' between lines 3 and 4 if you want to delay the whole scenario. If not, you need to set a timer and let it run for those 10 seconds and set the new world when it reached 0.
how to put timer in a game in greenfoot version 2.4.2
By liverpoolfc, with 12 replies.
Last reply by Super_Hippo, over 7 years ago:
liverpoolfc wrote...
When I wrote private int countdown = 3600; , it showed illegal start of an expression.
It should be at the top of the class outside any methods.
Can't Switch Levels
By jjboy, with 1 reply.
Replied to by Super_Hippo, over 7 years ago:
When you call the 'makeLevel' method from the constructor of the 'Space' class, score will always be 0.
scrolling world
By mole2003, with 1 reply.
Replied to by danpost, over 7 years ago:
mole2003 wrote...
I am trying to make the t rex game from google chrome. I cannot make the background (which is a rectangular sprite) to seemingly move for infinity. The randomly spawned obstacles should also move with the background as well
Please refer to my
Scrolling Tutorial
scenario.
Can't Switch Levels
By jjboy, with 3 replies.
Last reply by danpost, over 7 years ago:
jjboy wrote...
oh, I didn't even see that, thanks for your help!
I do not suspect that
addScore
would be called from any of the classes given. At any rate, there is a more general issue here in that once you leave the
Space
world, the
counter
object it created goes with it. However, I do not see a need for a counter that causes a world change upon each increment of its value -- that is, you can just change worlds (it should be obvious which world to proceed to determined by which world is currently active).
Having issues with winning the game
By jjboy, with 1 reply.
Replied to by danpost, over 7 years ago:
To test for equality, use the conditional operator '=='. Line 22 above should be <Code Omitted>I said
supposedly
because I do not see where a
win
field is declared within the class.
Having issues with setImage()
By GaijinVagabond, with 2 replies.
Last reply by GaijinVagabond, over 7 years ago:
thanks that works great
Broken code
By Ticker175, with no replies.
hey guys im having trouble with my code for my pacman game can anyone see whats causeing the problem of the check methods. <Code Omitted>
Can't Add Scoring
By jjboy, with 2 replies.
Last reply by jjboy, over 7 years ago:
thank you so much, now it works!!
Side Scroll
By GaijinVagabond, with 1 reply.
Replied to by Super_Hippo, over 7 years ago:
Basically, you need to differentiate between objects which scroll, objects which should be fixed on the screen (for example score displays) and the object which causes the scrolling. When you add an object to the world, you add it to a scrolling or non-scrolling list. Whenever the object which is causing the scrolling reaches a certain point on the x-axis, you move all objects in the scrolling-list (and the object itself) to the side. You could look at this scenario from danpost:
http://www.greenfoot.org/scenarios/19020
Calling Methods
By SevenGrnSix, with 2 replies.
Last reply by SevenGrnSix, over 7 years ago:
Interesting, but I think it is something else than my question that is the problem. That is, I answered my own question, I think.
Jump/Fall
By GaijinVagabond, with 2 replies.
Last reply by GaijinVagabond, over 7 years ago:
Thanks for the help! I'm new to this so I have no idea what I'm doing.
Pacman Game code
By Ticker175, with 6 replies.
Last reply by Super_Hippo, over 7 years ago:
Please upload your code here to the site or post relevant code here in the discussion. To see if there is a wall next to you, locate where the ghost is in the world's array and check the "neighbors".
Tracking and chaseing player
By Bananarama, with 3 replies.
Last reply by Super_Hippo, over 7 years ago:
Use the 'Math.hypot' method (Pythagoras) to check the distances if you moved to the direction. So use the player's location and the current location of the enemy ± some x/y value depending on the direction you check.
how to move an actor from world to world
By rookiecoder, with 3 replies.
Last reply by Super_Hippo, over 7 years ago:
Option 1: <Code Omitted> <Code Omitted> Option 2:
244
245
246
247
248
249
250
X