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
bootstrap class path not set in conjunction with -source 1.6
By Upupzealot, with 19 replies.
Last reply by Upupzealot, about 13 years ago:
@davmac thanks a lot. @danpost I would try that next time, thank you.
need help
By manish123, with 1 reply.
Replied to by Gevater_Tod4711, about 13 years ago:
What exactly do you want this code to do? Until now you just start a for loop and create an image that is never shown. If you want to create a countdown timer you first should never use loops. The loop will count down in only one act and you game will end before it has begon. Then you should create the image you want using another GreenfootImage constructor and also print the image onto the world or somewhere else so that you can see the image. Try it like this:
Insert image in world
By savanibharat, with 7 replies.
Last reply by danpost, about 13 years ago:
The 'addObject' method has the signature 'addObject(Actor, int, int)', not 'addObject(String, int, int)'. You need to substitute 'Actor' with either 'new
ActorName
()' or get a reference to a new actor with 'Actor actor = new
ActorName
();' and then use 'addObject(actor, x, y);'. Of course, 'x' and 'y' need to refer to or be replaced with values.
Detecting an Image
By Y3llowMustang, with 3 replies.
Last reply by Gevater_Tod4711, about 13 years ago:
You can use the methods
getIntersectingObjects
or
getOneIntersectingObject
from the greenfoot API to detect whether your actor touches another actor. The method getIntersectingObjects will return a list of objects and getOneIntersectingObject will only return one object. You can use this methods e.g. like this:
The current code im using for my character,how do i add lives?
By CreepingFuRbalL, with 3 replies.
Last reply by Gevater_Tod4711, about 13 years ago:
To add the variable you can use this code: <Code Omitted> To make your actor loose a live when it hits another actor is easy. Try it like this: <Code Omitted> The only problem is that after you lost a live the actor will still be there and your actor will get hurt again. Do you want to remove the other actor after it has hit you
Need help with adding a spawn point to the world
By CreepingFuRbalL, with 1 reply.
Replied to by Gevater_Tod4711, about 13 years ago:
The easyest way to add a spawn point would be to add new objects to the world when a condition is fullfiled: <Code Omitted> This will make new objects spawn when there are less than it should be.
Also how to add health or lives onto the game
By CreepingFuRbalL, with no replies.
Hi id also like to add health/or lives in my game so that if one life goes my actor can respawn with 2 other attempts
Need Help Animating Actor
By Otaku_Programmer, with 6 replies.
Last reply by danpost, about 13 years ago:
We really do not have enough information to help at this point. Best might be to post the code for the whole class.
Counting the number of a certain class in the world
By TobyW, with 7 replies.
Last reply by danpost, about 13 years ago:
If any basic key can unlock any basic door, then all you need to do is: <Code Omitted>With this, you do not need to keep track of ANY amounts. If there is a special key and door, you can use separate classes for those classes and work them separately.
Create a scoreboard
By kdoulas1228, with 3 replies.
Last reply by danpost, about 13 years ago:
It appears you imported the Scoreboard class and then edited it, ruining the basic structure of the class. (1) the field 'scoreCounter' field is not declared or initialized anywhere (not sure if that method belong in this class) (2) only the first statement (the 'return...') is reachable in the 'getScoreCounter' method (see note parenthesized in (1)) (3) the last block (starting '{ if(UserInfo.isStorageAvailable())...' is not within a method (4) the 'SCORE' field is being set to 'newScore', yet 'newScore' seems to come from nowhere (I think you delected a constructor declaration for the bl
Changing a string into an integer?
By a_quiet_person, with 4 replies.
Last reply by mjrb4, about 13 years ago:
Gevater_Tod4711 wrote...
To convert a String to an int you can use the method Integer.parseInt(String) which returns the int value of the String. This method throws a NumberFormatException so you need to surround it with a try catch block. <Code Omitted>
NumberFormatException is an unchecked exception, so you don't *need* to surround it with the try catch block (though you may wish to if you're parsing something that may not be a valid integer, user input for e
score
By sH1R1U, with 2 replies.
Last reply by sH1R1U, about 13 years ago:
:O thank you i try use in my game thanks again
sounds for java
By sH1R1U, with 2 replies.
Last reply by sH1R1U, about 13 years ago:
:O thank you so much :D i can't found any pagr :D
Gum ball machine
By Th3j4, with 7 replies.
Last reply by danpost, about 13 years ago:
Again, in order to assist in removing the text, you need to show how it is displayed. "Show your code!".
plz help
By manish123, with 5 replies.
Last reply by manish123, about 13 years ago:
ok ill try these solutions, thanks!
799
800
801
802
803
804
805
X