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
Need help with Counter!!
By A1234, with 2 replies.
Last reply by A1234, almost 12 years ago:
It works now! Thank you so much!!!
Is it possible to reconstruct World sub classes?
By forteddyt, with 2 replies.
Last reply by forteddyt, almost 12 years ago:
Oh wow, I can't believe I didn't see that method :/. Thanks though, that's exactly what I was looking for. I was messing around with sub-sub classes of World and tried reconstructing it like that, but was calling just "new subSubClass();" instead of "Greenfoot.setWorld(new subSubClass());". Thanks for the quick and simple response! :D
How do i get an image to point the way it is moving?
By JamesHughes, with 10 replies.
Last reply by Alwin_Gerrits, almost 12 years ago:
Obviously you can allso change the image to a mirrored one. You'll just have to put it instead of the getImage line.
We thought the same dan :). I just didn't write it down. But that put aside, I see how your code is better :).
World Isn't Spawning New Actors
By BryanGSMST, with 2 replies.
Last reply by BryanGSMST, almost 12 years ago:
danpost wrote...
Line 18 is setting the value of 'j' to zero; so the condition in your next line, line 20, will always be 'false' ('j' will never be anything but zero). Declare 'j' outside of the method, changing it from a local variable to a instance field (a local variable exists until the method is exited, so the next time the method is executed the variable is re-created; an instance field exists as long as the object it belongs to exists -- in this case, your CrabWorld instance, or world object). After moving the line outside the method, you will need to reset the field to zero after ten
Invincibility?
By CKnox, with 4 replies.
Last reply by CKnox, almost 12 years ago:
Thankyou Hippo, it works now!
need help with loop
By mntng, with 13 replies.
Last reply by mntng, almost 12 years ago:
Actually, I just opened the file again, without changing anything, really. And... no problem exists. I don't know what happens, it just works again. But thank you guys, I really learn a lot from you.
lives counter not working
By wslade, with 15 replies.
Last reply by Super_Hippo, almost 12 years ago:
True, it checks both, but only if the first one is false. (At least I think that should be the logic.)
need help for assignment: loop for non-random chess pieces locations
By mntng, with 4 replies.
Last reply by davmac, almost 12 years ago:
Another way: you can loop from 0 to 31 to cover all squares, and maintain two variables - row and column - inside the loop (but declare them outside the loop!). During each iteration, increment the column, and if it reaches 8, reset it to 0 and increment the row.
gravity on my platformer not working right..
By bmw0045, with 1 reply.
Replied to by danpost, almost 12 years ago:
Chances are one or more of the images involved (his image, the ground image or both) have excess rows of transparent pixels that not actually part of the image portrayed, but still is part of the rectangle that makes up the image block. If that is the case, the images blocks will intersect before the actual images intersect which will cause the behavior you described. You can use an image editor (one that supports transparency) to remove any complete rows (or columns) along the edges of your image that are completely transparent. If you do not have an image editor the supports transparency,
I need help with Labels
By dassteffen, with 2 replies.
Last reply by Super_Hippo, almost 12 years ago:
You need to make a program... did you sleep in your lesson? ;)
making a working subclass of world (which is subclass of World)
By Alwin_Gerrits, with 20 replies.
Last reply by Alwin_Gerrits, almost 12 years ago:
YES! I FIXED IT! Turns out I was changing world twice, once to go to the menu-world and once to go to the level-world. However, because it's being given no time between the two changes. That way the world it changes to isn't the level world, but the menu-world. In the end I fixed it by putting a copy of the menu into an actor so I don't have to call two different worlds in succession. Even though I fixed it myself I couldn't have done it without you guys, so thanks guys!!
How would I make a win message?
By rrose5, with 2 replies.
Last reply by Super_Hippo, almost 12 years ago:
I think it would be much easier if you create a actor which uses the "You win" message as its image and display it when you reach you object. (Make sure the actor is the first in the 'setPaintOrder' method or remove all other actors.) If the game ends there and nothing else has to be there anyway, you could also just change the background of the world to this image and remove all actors from the world. With this, you won't create a (sometimes) annoying pop-up.
How would I go about making a checkpoint?
By rrose5, with 1 reply.
Replied to by Alwin_Gerrits, almost 12 years ago:
If the program simply is in one screen it's prety easy, just put in a command like <Code Omitted>Define the x and y-coördinates and you should be done. If it's something like a sidescrolling game that's a bit different.... you might want to rebuild the world in that case, but that's where some trouble might appear. Anyway, if you want more suggestions or something just post a short comment you need more help behind mine and you should be fine.
How do i use this?
By shadowfire_ew, with 1 reply.
Replied to by Alwin_Gerrits, almost 12 years ago:
You can create actors by right-clicking actor then making a subclass. When you do you also get the option to name it straight away and pick an image for it. Looking a bit further you can see you also have a 'World' class on the right. If you make a subclass of 'World' you can use the command super(x, y, a). Now I made it with these variables on purpose because the super command used like this will determine the size of the world you're gonna be using. variable x is the width of the world, variable y is the height of the world and a is the size of one pixel within your world. I would recomm
System cannot find the file specified (set image)
By csrgamer, with 4 replies.
Last reply by csrgamer, almost 12 years ago:
It happens with just that one image. Using the code worked perfectly though, and now I can even select it out of the set image finder. Thanks!
643
644
645
646
647
648
649
X