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
3000x2000 pixel World?
By MyHeartRocksNRolls, with 2 replies.
Last reply by MyHeartRocksNRolls, over 13 years ago:
I mean that my image for the world is 3000x2000 big, because i want to have a big map for a shooter. It should be kind of big mall. the perspektive should be from above and no i don't want a scrolling world, better would be if the camera moves with the actor.
Is something like this possible?
By MyHeartRocksNRolls, with 4 replies.
Last reply by MyHeartRocksNRolls, over 13 years ago:
Thank you very much! It works without any problems and the using of a variable could be used in so many cases! This help make me move some steps forward.
Setting paths for the actor to follow and switching between them
By moiraxlaband, with 20 replies.
Last reply by danpost, over 13 years ago:
moiraxlaband, It has been 5 business days since I uploaded the newer version of JungleWorld, but I have not heard from you to let me know you got the newer version. It has now been removed. If you have not got it, and you still want it, post a reply.
Writing game/simulation data into a database or text file
By quelea, with 2 replies.
Last reply by davmac, over 13 years ago:
You can use the standard Java file I/O classes and methods. The Java API documentation (all of it) is
here
. Look at the following classes: File (java.io.File), FileOutputStream (java.io.FileOutputStream), FileWriter (java.io.FileWriter), PrintWriter (java.io.PrintWriter). Also try
googling "java file io"
. ("io" means "input/output", also written as "i/o"). There are plenty of tutorials out there.
How to make an invincibility code for a video game
By rsdt, with 5 replies.
Last reply by DonaldDuck, over 13 years ago:
My mistake! I'm not good with for, do, or while loops yet. I thought it sounded convincing though :) Thanks for clearing that up davmac
Greenfoot 2.1 released
By mik, with 6 replies.
Last reply by mik, over 13 years ago:
A short demo showing one of the new features — the
setWorld(..)
method — is now in the Gallery:
http://greenfootgallery.org/scenarios/3061
.
Unrecognized Response From The Server: 500
By DonaldDuck, with 2 replies.
Last reply by DonaldDuck, over 13 years ago:
Thanks Davin!
Get the degree of a rotated GreenfootImage
By schnatter, with 2 replies.
Last reply by davmac, over 13 years ago:
@Lildarkone: I think schnatter is talking about the rotation of a GreenfootImage, not of an actor. @schnatter: you can't "get the rotation" of an image because an image doesn't have a rotation. If you rotate an image, the effect is to actually modify the image pixel-by-pixel. If you want to know how much you've rotated an image by, you'll need to track it separately.
Keeping direction
By MyHeartRocksNRolls, with 3 replies.
Last reply by danpost, over 13 years ago:
Set up a private variable, say 'currentDirection', in your mover classes, possibly int for {0, 1, 2, and 3} or String for {"north", "east", "south", and "west"} (for int you could set up 4 public static final int North = 0, East = 1, South = 2, and West = 3); the mover would have its variable set to the direction it is currently moving; then, reference it, add 2, and then get the remainder after dividing by 4: int reverseDirection = (currentDirection + 2) % 4; Do not forget to change the 'currentDirection' variable when changing the mover's direction. Also, the other directions
Why Greenfoot Cannot Access Sound Card..?
By dmaxel, with 3 replies.
Last reply by giskard, over 13 years ago:
oh, I having this problem too. Hopes that new release solves that.
Creating Variables Infinitely
By manster2008, with 1 reply.
Replied to by nccb, over 13 years ago:
One way or another you will need to store enough data to remember where they've been in the world. One way to do this would be a two-dimensional array. You could make it contain integers, and have 0 for empty, and 1 for when player 1 has passed through that square. This would make collision detection relatively straightforward, and then you could draw the array onto an image. Another method would be to store it directly in an image, painting when you move through, but then to do collision detection you'd need to pick colours out of the image and examine them. Perhaps the easiest way (
Place greenfootImage on top of greenfootImage?
By MrCohen, with 1 reply.
Replied to by MrCohen, over 13 years ago:
Never mind - I figured it out! This is the act method for my Location class, if it helps. public void act() { setImage(scene.getImage()); GreenfootImage g = this.getImage(); g.drawImage(scene.getImage(),0,0); if (this.event != null) { g.drawImage(event.getImage(),0,0); } //setImage(g); }
setX() Methode needed
By schnatter, with 2 replies.
Last reply by schnatter, over 13 years ago:
Thanks a lot :-)
Levels
By CLLV, with 2 replies.
Last reply by DonaldDuck, over 13 years ago:
A simple level counter is this method, using a switch in the world class... <Code Omitted> Then you can setLevel(level) in your player, or j
Move to another world
By RedTurbo5, with 2 replies.
Last reply by nccb, over 13 years ago:
Greenfoot 2.1.0 is due out in the next week, and will feature the ability to change the world (heh!). There will be a Greenfoot.setWorld(world) method which will allow you to change the world mid-execution, which we hope will be useful for these sorts of level changes.
1045
1046
1047
1048
1049
1050
1051
X