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
getWorldCanvas()
By Nosson1459, with 1 reply.
Replied to by danpost, almost 2 years ago:
Nosson1459 wrote...
I'm trying to fix up someone elses old greenfoot code and I came across an error that I don't know how to fix, the person calls a method called getWorldCanvas() from the WorldHandler class Greenfoot doens't know what it is. What is it trying to do and is there a replacement method for it?
I did not research it; but, I believe that it returns a
java.awt.Canvas
object. Being as you cannot upload anything using the
java.awt
package without running into security issues in
javascript
/
HTML
, any scenario using that package will fail to work on a
I am getting an error
By Shaormentiul, with 5 replies.
Last reply by Shaormentiul, almost 2 years ago:
Thanks for the help, it doesnt give me the error anymore. The fact that the attack will hit the player creating it wont matter, because it will only affect P2.
Making an attack delay
By Shaormentiul, with 5 replies.
Last reply by Shaormentiul, almost 2 years ago:
Nevermind, I made it work. Thanks for the help a lot!
Saving the caracter
By Guy68, with 9 replies.
Last reply by danpost, almost 2 years ago:
Guy68 wrote...
Yes but PlayerA is not working because i have two caracters, and i want to choose between them. I wan to play the other levels with the same caracter, without going back to choose the player again. I tryed my best to combine the code but it is not working. Maybe we can go with little steps. I have 2 caracters (Man and a Woman) And i have 3 worlds(MyWorld1,2,3) and I am choosing the caracters in the world Starting. I want to do if i clck on the man in the world satrting that i can play with the man at all 3 worlds and i am able to travell between them(the travelling between worlds
Edge of the world
By Guy68, with 2 replies.
Last reply by Guy68, almost 2 years ago:
Thank you! The problem is solved and its working just fine.
Kill multiple actors with a health system in place
By Deepfist, with 1 reply.
Replied to by danpost, almost 2 years ago:
Deepfist wrote...
I am trying to make a kill system where, if a bullet hits the Stalker or Sniper, it kills them when their health is low enough. With the Sniper it works, but with the stalker I get the error : << Error Trace Omitted >> The code for both is the same, but with different names and it references the right Actor. The codes for the involved actors will be standing below (The actors it extends to have nothing to do with the code itself) This is the code of the bullet that kills the enemies (not the class Enemies) << Code Omitted >> This is the code of myWorld, it might have some
Casting
By SANELE, with 1 reply.
Replied to by danpost, almost 2 years ago:
SANELE wrote...
can someone please explain to me Casting with examples.
Let's say you had in your
MyWorld
class a method that you wanted to call from an
Actor
subclass. Maybe your character dies and you want the world to show a game over screen, so you want to call the
gameOver
method:
Code only execute on first instance
By Makuro, with 3 replies.
Last reply by danpost, almost 2 years ago:
Makuro wrote...
<< Codes Omitted >> Thanks for your reply and here are the Game Manager and Background class respectively
I really do not see the need of the
Game_Manager
class. All the information stored in fields there can be determined on the fly, with fair programming. A
Game_Over
class extending
Actor
could be used to show victory or failure and at the same time be used to stop the scenario when added into the world with (in
Game_Over
class): <Code Omitted>Instead of setting fields
Laggy Greenfoot
By Wiwhyweirdo, with 2 replies.
Last reply by danpost, almost 2 years ago:
Wiwhyweirdo wrote...
After some more testing I have noticed that whenever I receive damage the game speeds up at gets less laggy. Do what you want with this Information .
You might be doing something with images that is causing the lag issue. Make sure you pre-load your images. Make sure you always reference those pre-loaded images when setting an image. Keep your world at a reasonable size. I stick to not much more than (900, 600) world size (depending on the scenario). If using an unbounded world, make sure all actors are removed from the world after they leave the viewport
Greenfoot scenario freezing in browser
By epm, with no replies.
Hey, I tried to share my scenario but it keeps initialising. After a long time it loads but when changing the world it start freezing again. I really don't know why :( It is working in Greenfoot. You can find my scenario
here!
How to reset a World while the Program is running?
By Bankspeers, with 5 replies.
Last reply by Bankspeers, about 2 years ago:
Thank you, now it works
How to detect if all objects are gone
By Psg, with 11 replies.
Last reply by danpost, about 2 years ago:
Psg wrote...
hey, dan I need your help. I have a problem. I believe this if statement is working, but reading the wrong value of the integer rotate. What should i do
First, you should understand that the rotation is already being held in the Actor class, meaning you do not need to declare another field for it. You could use something like the following: <Code Omitted> It is not really clear by your code as to exactly what you are trying to achieve with the turn methods Obviously, you want the crab to turn sharp at an edge, whic
How to stop actors from "sliding" after calling the move() function and changing orientation
By TheGrrMan, with 5 replies.
Last reply by danpost, about 2 years ago:
TheGrrMan wrote...
your QActor class, how do I access this?
It can be found in my
Asteroids w/Improved QActor class
scenario. Again, it is not to be modified in any way -- just used as is. Download the scenario and open in greenfoot. Then, you can copy/paste the class into your scenario. It does work differently than the
SmoothMover
class, however. Open the class and read through the instructions carefully.
Actor
subclasses requiring it should extend the
QActor
class.
How do you rotate an object to spawn in a different way?
By zlm, with 2 replies.
Last reply by zlm, about 2 years ago:
Yes, thank you so much!
How do you make an object move along with another object
By jeremyneedshelp, with 1 reply.
Replied to by danpost, about 2 years ago:
jeremyneedshelp wrote...
I cannot make my frog to move along with the boat that allow the frog to cross the river. i managed to get the frog to go on top of the boat but it wouldnt move at all. it would just get stuck on the boat and it would die.
You need to show your current codes for both the frog and the boat. Also, you can look at other codes that do similar things. For example, my
Jump and Run Demo w/Moving Platform
scenario has an independently moving actor moving on a platform.
23
24
25
26
27
28
29
X