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
Assistance on constructor method with two parameters
By jagregg, with 1 reply.
Replied to by danpost, over 12 years ago:
You are missing the following: * a semi-colon, ';', at the end of line 36 of the Emoticon class; * a constructor declaration statement between the field declarations on lines 18 and 19 and the constructor code, lines 36 through 39 of the Emoticon class; * a dot, '.', before the file name suffix on line 55 of the Emoticon class; Then, lines 37 and 38 are trying to set arrays to String values. I think you want to save individual Strings in each of the Emoticon objects created, not arrays of Strings. Lint 48 of the HomeworkWorld class is not needed. That condition is accounted for in t
any one can help me make my hp bar work please
By nic555ex3, with 8 replies.
Last reply by danpost, over 12 years ago:
I first looked at your HealthBar class. You do not need to update its image every act cycle. After the initial creation of the HealthBar object, when you call 'update' to set the initial image of the bar, the only time you need to update the image is when the value of the bar changes (in the 'loseHealth' method after the value is changed). Add the 'update' call there and remove the act method from the class. Then, in your Tojan class, I notice that line 252 is trying to call the 'loseHealth' method on the class, 'HealthBar', and not on an object of the class, 'healthBar' (declared on lin
Setting the pen size for drawing on the background
By vtn2@calvin.edu, with 4 replies.
Last reply by vtn2@calvin.edu, over 12 years ago:
No, none of this is working. but, I did get it to work by changing the greenfoot source code. Thanks anyway.
any one can help me add health to my boos
By nic555ex3, with 3 replies.
Last reply by NikZ, over 12 years ago:
Where is the code where he actually dies?
Playing Background music does not work?!
By Svek, with 3 replies.
Last reply by danpost, over 12 years ago:
From your Main world: <Code Omitted>From an Actor class: <Code Omitted>As an alternative, you could make the 'music' field a 'static' field and use the following from anywhere: <Code Omitted>
move delay??
By TotalBOSS01, with 2 replies.
Last reply by NikZ, over 12 years ago:
You also might want to make moveDelay a private int.
Animated objects
By OlSom, with 3 replies.
Last reply by danpost, over 12 years ago:
OlSom wrote...
If I understand correctly that should also make things more efficient since the images are only loaded once, when the tank is created, not every time the effect is appears.
'static' fields that are assigned their values when declared are set during compilation; when a tank is created is of no consequence.
Copyrights for youtube
By QWERTYMAN, with 3 replies.
Last reply by QWERTYMAN, over 12 years ago:
ok thx
IsKeyDown doesnt work!?
By Hutanoi, with 1 reply.
Replied to by danpost, over 12 years ago:
Please show the code for your Welt class.
getOneIntersectingObject with the World
By Hutanoi, with 10 replies.
Last reply by Hutanoi, over 12 years ago:
okay, it works now, dont know why it didnt before nevertheless thanks :D
Are there directions for building greenfoot from source?
By vtn2@calvin.edu, with 10 replies.
Last reply by vtn2@calvin.edu, over 12 years ago:
I have successfully built BlueJ and Greenfoot now. Here is a much more detailed "log" of how I built it, which may be useful to others in the future. This way built on Mac OS. 1. mkdir ~/build_gf 2. cd ~/build_gf 3. unzip ../Greenfoot-source-2.3.0 4. Mac21495:build_gf vtn2$ ll total 0 drwxr-xr-x 4 vtn2 staff 136 Jun 19 20:47 ./ drwx--x--x 92 vtn2 staff 3128 Jun 19 20:46 ../ drwxr-xr-x 13 vtn2 staff 442 Apr 25 2013 bluej/ drwxr-xr-x 14 vtn2 staff 476 Apr 25 2013 greenfoot/ 5. Start up Eclipse Classic 4.2.2.app 6. Switched workspace to /Users/vtn2/build_gf. Ec
A new way to determine if one actor can "see" another
By jimboweb, with 10 replies.
Last reply by danpost, over 12 years ago:
I think I see where lordhershey is coming from; though, his original post does not seem to have much of anything to do with this issue (a LineOfSight object is only being created once in a blue moon and the pixel-sized image is used once at that time). However, you are creating a new GreenfootImage object each act cycle for the LineOfSight actor at line 41. You could change that line to the following: <Code Omitted>to avoid overhead on the GC.
cant get picture to change
By TotalBOSS01, with 5 replies.
Last reply by NikZ, over 12 years ago:
Your code is perfect for timing act cycles. You just need to add 1 (or more) to curTime every act, instead of getting currentTimeMillis()
I am following a tutorial to do a TicTacToe-game but I aint able to get it running.
By Maecky, with 3 replies.
Last reply by danpost, over 12 years ago:
Please refer to the page on
Classes and Objects
of the Java tutorials.
Way to check time (as in how many seconds since start)
By TotalBOSS01, with 4 replies.
Last reply by TotalBOSS01, over 12 years ago:
All right, thanks alot for all the answers!!
670
671
672
673
674
675
676
X