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
Scrolling World
By joshuadswa, with 5 replies.
Last reply by joshuadswa, over 9 years ago:
Okkk thx :) i will try to study it
[@danpost] How to center the "camera" in a scrolling world
By Super_Hippo, with 13 replies.
Last reply by danpost, over 9 years ago:
danpost wrote...
You should be able to just subtract 3162 from all your coordinate values before you use 'super.act();' (if I am not mistaken).
I probably was mistaken and you need to subtract 2762, not 3162. I was trying to find an easier way to center the town in the viewer. Experimenting with 'setMainActor(dorfzentrum, 0, 0)' followed by 'dorfzentrum.setLocation...' and 'super.act'; then 'setMainActor(maus...'. You would then have to 'addObject(dorfzentrum...' to add the object to the list of scrolling objects in the SWorld object.
Remove an actor
By Fifilein, with 4 replies.
Last reply by danpost, over 9 years ago:
What code are you using to add the snake into the world and where is it located? (show as much code as needed)
Help with costumes
By Avecinat, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
Are the cells actors? If yes, save a variable to show if a cell is alive or not (you could also compare the image but I usually prefer using a variable (int or boolean). <Code Omitted> Just in case it is not working: (I am never really sure about this without testing)
jumping help pls
By ninjaFI, with 2 replies.
Last reply by ninjaFI, over 9 years ago:
thx
ask
By ajiereus, with 3 replies.
Last reply by aldrisang, over 9 years ago:
oops yeah i forgot to say boolean or int for mine, and i got my 0s and 1s mixed up. man i'm tired. i'm sure they'll figure it out :) ciao for now...
Updating an Image with UserInput
By SpicyEmpanadas, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
'String inputstring' (line 18) is not used for anything. Maybe it has to be 'text=...'?
Holding the mouse down
By Wasupmacuz, with 2 replies.
Last reply by Wasupmacuz, over 9 years ago:
danpost wrote...
You will need a Boolean field to track the state of the mouse button: <Code Omitted>Then, in your current code (if the above here is done first), you can utilize the value of 'shooting' (along with your 'firePause' field) to determine when to fire.
Thank you Dan!
backtracking
By Alexlazea, with 2 replies.
Last reply by Alexlazea, over 9 years ago:
because it will get way more complicate in the future and the posibilities will be more than just 6 And i really want to do it this way :D
Outdated Version?
By Freekywill, with 1 reply.
Replied to by danpost, over 9 years ago:
Freekywill wrote...
I am making a game, which works fine on my personal laptop, but this line of code doesn't compile when on my school computer, receiving the error message "cannot find symbol - variable type" < Code Omitted >
Maybe it works in newer versions of greenfoot because of generics, where the object returned by 'getObjectsInRange' is 'List<InventorySlot>' (this was implemented somewhat recently).
Pause and resume
By YunitaPutri, with 13 replies.
Last reply by danpost, over 9 years ago:
Super_Hippo wrote...
@danpost: I think the 'pauseAndResume' method replaces and 'pause' and 'resume' methods. This way it should stop the scenario from doing anything when space is pressed until enter is pressed. And if I understood Yunita correctly, it does work now.
Ahh. I missed the 'while' bit. Yes -- that would work; except for the fact that you will not be able to actually Pause the scenario (by way of the greenfoot UI 'Pause' button) when the scenario is actively paused.
Shooting Range
By joshuadswa, with 5 replies.
Last reply by joshuadswa, over 9 years ago:
OK thx all :D
web link not moving
By divinity, with 2 replies.
Last reply by davmac, over 9 years ago:
You could float the first link left, the last link right, and have the text-alignment of the containing element be "centered". With that said, this is really off-topic for this forum... can I suggest you find a suitable HTML forum instead?
remove object
By joshuadswa, with 5 replies.
Last reply by joshuadswa, over 9 years ago:
gonna try it :3
Greenfoot src
By Nosson1459, with 3 replies.
Last reply by Nosson1459, over 9 years ago:
Thanks.
390
391
392
393
394
395
396
X