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 remove text?
By WardedBowl403, with 1 reply.
Replied to by danpost, almost 9 years ago:
What text are you trying to remove? are you trying to replace that text? do you not have a Message class? Need more information and code?
Runtime Error Window
By suzbo, with 2 replies.
Last reply by Super_Hippo, almost 9 years ago:
See this discussion:
https://www.greenfoot.org/topics/58676/0#post_115370
ERROR: Class java.awt.Rectangle was not found
By Busch2207, with 6 replies.
Last reply by Yehuda, almost 9 years ago:
The same way it used to only work on certain browsers and only if you allow it (in java control panel).
Animated Gif
By suzbo, with 5 replies.
Last reply by danpost, almost 9 years ago:
Along with your fields declared on lines 12 and 13, add a GifImage reference field and assign a GifImage object given your gif file: <Code Omitted>The gif file should be in the 'images' folder of the project folder. Line 25 should be: <Code Omitted>This line initializes your world background image. The same line of code should also be in the 'act' method of the class to run the animation when the scenario is running.
How do I make my own MyWorld constructor
By jkfrmsttfrm, with 1 reply.
Replied to by danpost, almost 9 years ago:
Move the code in your current constructor into your new constructor and replace your old no-parameter constructor with the following: <Code Omitted>You can then work with the parameter value within the new constructor.
How to get method from another world
By Arifwc, with 1 reply.
Replied to by danpost, almost 9 years ago:
I guess one way is to go through a Menu world to start a new TetrisWorld world by utilizing a second Menu world constructor. Something like this: <Code Omitted>Then, instead of going directly to a new TetrisWorld at restart, go to a Menu world with this: <Code Omitted>
how to make random choice, but cannot choose same number
By rey24, with 1 reply.
Replied to by danpost, almost 9 years ago:
What is line 13 supposed to be doing (what are you intending it to do)? The array is to contain elements of type 'int'. This is a primitive type which cannot be 'null' as all primitive types have default values ('false' for boolean and '0' for all others). So, if line 13 is trying to do what it looks like, then maybe you should check for a meaningless value, like '-1' and set it to that value at lines 18. Lines 18 and 19 seems to deal with a possible different element of the array (using index value from 'x' instead of 'ke'). In fact, it appears that if you use 'x', the index could en
||ERROR|| Class, interface, or enum expected ||ERROR||
By Max64751, with 2 replies.
Last reply by danpost, almost 9 years ago:
Line 2 should start 'public
class
'.
Making extra walls, that an actor cannot pass through
By XD-69, with 1 reply.
Replied to by Super_Hippo, almost 9 years ago:
In
my Pac-Man game
, I saved the map as an array in the world, so Pac-Man can check if there is a "wall" on the side. You can download the game and check the code. The alternative is to have walls as actors in the world. Then Pac-Man can move, and if it hits a wall, you place it back to where it came from.
How do i change the font?
By Recorsi, with 8 replies.
Last reply by Recorsi, almost 9 years ago:
Super_Hippo wrote...
Create an image. Set a font and then, draw a string on the object. You can not use this constructor when you don't want the default font. <Code Omitted>
Thanks :)
How to stop the game?
By agiastaee, with 2 replies.
Last reply by agiastaee, almost 9 years ago:
its work! thanks for your help
Invisible Object Problem
By donysamdhila, with 6 replies.
Last reply by donysamdhila, almost 9 years ago:
danpost wrote...
Replace lines 42 through 60 with my 2-liner above and replace lines 24 an 25 with this: <Code Omitted>Then test it out. If it is still not working, show the revised class (so it can be verified that the changes were done correctly) and explain in what way it is not what you wanted. You may also need to show the Boss class code (since that class is what this class extends and may influence what is going on).
Thanks !! It's working..
Greenfoot Lifes
By StudentGR, with 1 reply.
Replied to by danpost, almost 9 years ago:
StudentGR wrote...
Hello so I am working on a project that my character is tracing items in my world and i wanted to add lifes for better marks. but whenever my character is touched by an item is dying. I want him to die after three times he is getting touched.
You will need to show the codes you ended up with (the World subclass, the HealthBar class, and the Actor subclass that has health).
I'm having trouble drawing a String and setting Fonts!
By Mushi, with 4 replies.
Last reply by Mushi, almost 9 years ago:
EDIT: It was drawing the label, but adding the object of the label too far off the screen for me to see. Sorry!!!
Sharing variables through Actors
By XD-69, with 4 replies.
Last reply by XD-69, almost 9 years ago:
Awesome thanks alot.
305
306
307
308
309
310
311
X