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
Variable and Points
By Cett, with 4 replies.
Last reply by Cett, over 8 years ago:
oh my god that's so simple. Thank you so much!
Heap space after a few level restarts
By Paul12345, with 33 replies.
Last reply by Paul12345, over 8 years ago:
Now even if i use my old big world i still get no memory issue
Stopping and playing music
By Heet_Patel, with 9 replies.
Last reply by danpost, over 8 years ago:
Heet_Patel wrote...
thanks though. and do you have a youtube channel on coding for greenfoot
No -- just the two tutorials uploaded here. Most of your other recent posts were answered by my last post (without code -- but quite straightforward). The walls also can be set when you save the world.
[Help Needed :)] Changing the Actor target of a troop
By Arakniode, with 4 replies.
Last reply by danpost, over 8 years ago:
Arakniode wrote...
does that mean that when I remove the resource with getWorld().removeObject(this);, the resource
still exists
, but is not in the world?
As long as a valid reference exists on the object, it will not go to the gc. The field 'currentTarget' references the actor (even if removed from the world). Think of when you create an object, before it is added to the world. It must remain or you would never be able to do anything with it. The only thing removing it from the world does is (1) remove its reference from the list of actors the World object keeps; and (2) set
back to main board - question
By divinity, with 2 replies.
Last reply by divinity, over 8 years ago:
probably idk hence the reason why i ask,
Greenfoot.ask() causing number format exception (null)
By temch55, with 1 reply.
Replied to by danpost, over 8 years ago:
That is crazy, because for the last half hour or so I was working with just that -- using Greenfoot.ask in a constructor. I had not come across any issues with it; however, I have not yet closed out and opened it again. It may just be that without some world already having been created, it has no width to place the text in, thereby disallowing it. I say this because I did change my world to a (1, 1, 1) size and it did set the input box to the previous width size. I am glad you came across this because I was about to inform someone else that it would actually be possible, where this proves
I need help with collision detection.
By Aura_, with 1 reply.
Replied to by danpost, over 8 years ago:
Important to know: are these black squares Actor objects or are they drawn onto the background image? Also, what is the cell size of the world and, if larger than one, are actors all maintained within a grid square at each moment? And, at what speed do the enemies move and what rotation directions are allowed for them.
Greenfoot.getRandomNumber
By Acituanbus, with 13 replies.
Last reply by Yehuda, over 8 years ago:
I think I might agree on that, it is a valid question to (on - ?) my part. It might have been that I thought at the time that what was necessary was someone who knew the problem, and I wanted to stop a lead onto a false trail of posting more code.
HELP
By Indy5Drew, with 4 replies.
Last reply by Vercility, over 8 years ago:
Use a counter for delaying (I read somewhere that 130 act cycles are about 1sec but you'd have to try yourself) And one for the amount of keys played yet When the Counter is > whatever delay u want, call a method that plays a key depending on the key counter
How to make Object turn before touching edge.
By Nordine, with 2 replies.
Last reply by Nordine, over 8 years ago:
Thank you Danpost for the quick reply. I did not think of that one. I appreciate the help.
Doubles to Integers
By DrCrane, with 11 replies.
Last reply by Vercility, over 8 years ago:
IDK, used an online compiler on my phone when i wrote this, might have been faulty
JOptionPane
By Hmac2000, with 6 replies.
Last reply by danpost, over 8 years ago:
Okay -- you cannot repaint a world that has not been completely constructed. Therefore, your initial world cannot be a question world if you are to use the constructor for the questioning. Secondary world constructors could be used; however, they again must be created after the initial world has been completely constructed (the secondary world being created from either the act method or the started method of the initial world). The secondary world would have to use the initial world background to pose the questions from its constructor because the initial world is the one that is active at
Infinite loop
By ImAndrew, with 8 replies.
Last reply by danpost, over 8 years ago:
ImAndrew wrote...
I thought that would cause errors but I see it didn't.
I am not declaring a new variable with the same name. Just re-using an already existing variable.
How could I shrink and enlarge the object image without losing its quality. With the scale method wich I use the objects images look very bad and pixelated.Could I use vector images?
You should not, in this case, re-scale the same image over and over. Copy the original image and scale it each time:: <Code Omitted>whe
A Pig's Dream - Improvements
By Lilly123, with 4 replies.
Last reply by xbLank, over 8 years ago:
1) The hitboxes are completly messed up 2) You can just hide at the very top of the screen where no clouds are 3) Make the background scolling 4) Let the pig move back and forth
using one actors variable in another
By roonie01, with 2 replies.
Last reply by roonie01, over 8 years ago:
thank you
292
293
294
295
296
297
298
X