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
Getting a java.lang.NullPointerException
By Dimako21, with 1 reply.
Replied to by danpost, almost 8 years ago:
Restriction in directions is due to speed and the hardware makeup of pixels of the screen (cannot be moved between pixels). The null pointer exception is probably due to the debris wanting to time itself out of existence when at an edge. If removed due to edge by line 23, removing due to time (line 30) will error as 'getWorld' will now return a 'null' value.
평범한 사람과는 달라 혼자만 있는 게 좋아.
By Tyleroneil72, with 2 replies.
Last reply by Tyleroneil72, almost 8 years ago:
Owen08 wrote...
Why do u suck so much
평범한 사람과는 달라 혼자만 있는 게 좋아.
Creating a door into next level
By Echarch11, with 9 replies.
Last reply by Tyleroneil72, almost 8 years ago:
일리아스 wrote...
I didn't copy that, therefor I cant give any source.
System.exit(0);
Creating doors
By Owen08, with 3 replies.
Last reply by Tyleroneil72, almost 8 years ago:
일리아스 wrote...
Please dont copy paste code. Use sources.
Source
I made it myself, you stole it from me, please source me.
Writing to an external file?
By dimako33, with 1 reply.
Replied to by J.A.M, almost 8 years ago:
Have you tried wikipedia yet????:((((
Writing to an external file?
By Dimak, with no replies.
Hello everybody, I am making a game for my final project and one of the requirements is to add the score to an external file. I browsed green foot forums and the best I found is the UserInfo Greenfoot API http://www.greenfoot.org/files/javadoc/greenfoot/UserInfo.html where you can save a score. Here is where the saving to an external source comes in, I want to instead save into some kind of online form ( Like an excel sheet ) where I can then go through the values column by column and row by row and display the best scores. Would that be possible? Because if I were to use something like the read and write methods provided by
Java
the user would then have to upload it somehow for it to show up for everyone else. Just as a recap I need to somehow save a name and a score in some kind of form that then can be accessed by anyone with the greenfoot file. ( Sorry for my bad english )
Getting a nullPointerException and random turning problems
By Dimako, with no replies.
This only happens sometimes, but after a bullet hits an asteroid it creates Debris. That Debris later has a randomly generated decay and is destroyed after the decay timer is up as seen on line 27 My question to you is why does it only randomly choose to give a NullPointerException and how do I fix it? <Code Omitted> Another question I have about the code is the turn / setRotation functions. Whenever the debris is generated, it is given a random rotation and then turned towards it. For some reason it only ends up having 8 or so different rotations visible as shown here <Image Omitted> And I am wondering if there is anyway I can make it have more possible outcomes. Or is this due to the object being so small? (2x2 pixels) Edit: took out the code for generating sound as that was copied by mistake
i need help with atleast one of these 3 things
By nick_crompton, with 9 replies.
Last reply by nick_crompton, almost 8 years ago:
no need to look into the score i already fixed it, i switched up 2 codes from different classes + the mistake you noticed
Can you write to an external file?
By Dmitriy32, with no replies.
Hello everybody, I am making a game for my final project and one of the requirements is to add the score to an external file. I browsed green foot forums and the best I found is the UserInfo Greenfoot API where you can save a score. Here is where the saving to an external source comes in, I want to instead save into some kind of online form ( Like an excel sheet ) where I can then go through the values column by column and row by row and display the best scores. Would that be possible? Because if I were to use something like the read and write methods (read write api) the user would then have to upload it somehow for it to show up for everyone else. Just as a recap I need to somehow save a name and a score in some kind of form that then can be accessed by anyone with the greenfoot file. ( Sorry for my bad english ) ( Also sorry for not posting links as that seems to get me spam blocked)
Looking for teaching resources
By mwjallen, with no replies.
Hi all, I am delivering a Games Development Unit to HND students next semester and was wondering if there were any teaching resources available focussed on Greenfoot as the game development environment? Thanks in advance for your help. Mike
checking if an Object is removed
By L2plex, with 2 replies.
Last reply by L2plex, almost 8 years ago:
Thanks danpost. I replaced the "intersects(localFlashlight)" with "localFlashlight != null" and it works fine. ; )
Getting a nullPointerException and random turning problems
By Dimak, with 3 replies.
Last reply by danpost, almost 8 years ago:
Super_Hippo wrote...
If you don't save the exact values (double instead of int for x and y values --> you can try the SmoothMover class), you can't have other possible movements with a speed of 1. Higher speed leads to a higher number of possible rotations, but it still won't be accurate without using doubles.
That is not exactly true. My QActor class uses int values for both location and rotation (in coordination with a "Zoom" factor) to create quite accurate smooth movement. With a "zoom" of 100, each int unit is 1/100 of a cell or 1/100 of a degree. Int values are much quicker to
java.lang.NullPointerException error
By ImAndrew, with 2 replies.
Last reply by ImAndrew, almost 8 years ago:
The first 3 lines were global in healthstatus class and the other 2 were global variables in myWorld.Anyway, I resolved the problem with a HealthStatus constructor who accepted the hero object whom I put in a variable and used. :D
objects moves down when space is available?
By woodentable, with 8 replies.
Last reply by xbLank, almost 8 years ago:
Glad to hear that.
New Level
By Echarch11, with 5 replies.
Last reply by Echarch11, almost 8 years ago:
ok
297
298
299
300
301
302
303
X