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
Health Bar and Stop/Play Problem
By Zyphos, with 6 replies.
Last reply by danpost, over 8 years ago:
The bar class code was not meant to be edited. Everything, and I mean everything, that you could possibly do to it has a method call to do it (if there is something you think I missed, let me know, and I will rectify it). What exactly are you trying to add or change in the bar class? Maybe, you should post the bar class code, as it is right now, here.
Calling an object's methods
By dark_sky, with 4 replies.
Last reply by IsVarious, over 8 years ago:
A tip for code placement: It's normaly a good idea to put code in the place it makes the most sense, so for your example above. Are you wanting to player look for the box, or the box look for the player? it may seem like a subtle difference, but as a project expands, it does help to place code in natrualy logical locations.
Variable from another world?
By MrDoomsday, with 2 replies.
Last reply by IsVarious, over 8 years ago:
So for example if your variable was "pizzaLeft", you would declair it as 'public static int pizzaLeft;" this would enable you to access it from another level.
Creating a New World
By theDoctor, with 5 replies.
Last reply by IsVarious, over 8 years ago:
lol, in the constructor of the new level, set the location of where you want your actor to be added, think of this like you're working with your first level, but you can have many different. you can also setup conditions if they are met after leaving that building, where you want your actor to be placed. here's the same code we used for our final project which did this exact same thing.
Help with movement code
By DAustin15, with 11 replies.
Last reply by danpost, over 8 years ago:
Well, after having a look at the board, I can tell, that this will not be as easy as I had believed at first. Also, with 4 pieces on the board at the same time, you certainly do not what them landing exactly on the same spot when on the same square. That adds another level of complexity. However, with the proper helper objects, and object image manipulation, I believe we can make it work. I am thinking about an array of Pad objects (invisible 'landing' pads for the pieces; 40 of them; one for each spot on the board that a piece can land on). They each can have a reference to the spot in
I can compile it, there are no errors for the code but then something happen
By martijn13039, with 2 replies.
Last reply by martijn13039, over 8 years ago:
Plz Could somebody help me because I have really no idea, and it is really anoying because the game work fine but the wole time if i am playing wil come thise window but i could still playing the game some advice plz?
bouncing of walls
By tylers, with 4 replies.
Last reply by tylers, over 8 years ago:
how do i stop it from bouncing from one wall to another in the same place
fixed it
Referencing Strings from another class.
By JayWood860, with 1 reply.
Replied to by JayWood860, over 8 years ago:
As for the textbox, the method is irrelevant at this point i did not mean to add it. just the parameter to show that i was adding it to the world correctly. and if this was not previously stated, there are no syntax errors through the program, just this issue i have right now.
Levels
By Matt, with 6 replies.
Last reply by trash1000, over 8 years ago:
Apart from different worlds you could always go and use files to read out the structure of a level. However, it's highly dependent on how your levels are structured.
Removing Actors
By Matt, with 2 replies.
Last reply by Matt, over 8 years ago:
I dont really understand the things written on that page :(
How to exit only when door is open.
By dlanni, with 12 replies.
Last reply by dlanni, over 8 years ago:
Thanks so much. I'll get to work on this .
Need a little help with java.awt.Graphics
By darkmist255, with 25 replies.
Last reply by danpost, over 8 years ago:
@pyrokey3, in your code, lines 6 through 9 can be replaced with this one line <Code Omitted>
getObjectsInRange help?
By PiercingGoblin, with 1 reply.
Replied to by Builderboy2005, over 8 years ago:
The command getObjectsInRange() returns a List object that is never null, but might have a size of zero. Therefore, instead of checking to see if the list is null, you should check to see if it has a size of zero, using the .size() method :)
Anybody know the code to theses certain circumstances?
By DAustin15, with 1 reply.
Replied to by danpost, over 8 years ago:
Check out one of my Snake Demo scenarios. It has code for 4-way movement (up, down, left, and right). The only difference being that the Snake is user-controlled (by the arrow keys), and your scenario will just increment the direction value (direction = (direction + 1) % 4; when it reaches the edges). Get all individual parts of the game working first, then work on combining them into a complete game.
scale
By tylers, with 1 reply.
Replied to by danpost, over 8 years ago:
Each time the act method is called, you end up scaling a scaled image. The result in doing this is what you see happening. What you need to do, is create a
new
GreenfootImage by using one of its constructors (probably the one that uses the filename, since you made it in gimp), and scale that new image directly to the required size.
877
878
879
880
881
882
883
X