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
Get Actor to move infinitely back and forth until the player wins
By brandondamante, with 3 replies.
Last reply by danpost, over 11 years ago:
Adding the boolean field 'a' and method 'isMoving' was not required, or even needed. In fact, as far as I can tell, you are not even calling the 'isAtWorldEdge' method; so, it is not a factor. Since you do not need to use any of the methods you supplied in the Character class, I have the Guard1 class extending the Actor class below; however, you could still put the act and move methods below in a Character or Guard class so more than one class can have the behavior of moving back and forth and have those classes extend it. This is the basic code for an actor to move back and forth from
i am trying to stop my music from my 1st world with my 5th world. what am i doing wrong??
By qsapp.3, with 18 replies.
Last reply by danpost, over 11 years ago:
A much simpler solution is to make the GreenfootSound field in the Cover class 'static'. <Code Omitted>Then the method to stop the sound in the Cover class would be: <Code Omitted>With this, you do not have to pass anything from level to level. Just start the loop in the Cover class and use the following in the Level5 constructor to stop the loop: <Code Omitted>
Greenfoot or BlueJ
By AlMcInnis, with 5 replies.
Last reply by AlMcInnis, over 11 years ago:
Thank you all, I think I will start them with Greenfoot, and run them through the exercises in the book (have to buy the book first). This should get them started, and potentially mostly on their own while off for the summer and when I am at work.
Greenfoot + Kinect + Ubuntu 12.04??
By trier, with 1 reply.
Replied to by MarioFeles, over 11 years ago:
Fala Pereira ja compro o Kinect.....é o Mario :D
Stress with colours
By Kartoffelbrot, with 2 replies.
Last reply by Kartoffelbrot, over 11 years ago:
thanks
How do i change the font, size, and color of the text??
By qsapp.3, with 4 replies.
Last reply by danpost, over 11 years ago:
There would be a lot more involved if you actually wanted to change the font style as well (importing the Font class and applying the font style to an image before drawing a string on it).
drawing a radius around the towers when their selected
By darkmist002, with 9 replies.
Last reply by danpost, over 11 years ago:
If you declare both the 'tpic' and 'g' images in the tower class and create the images in the constructors of the subclasses, then you should be able to use the code I provided in the tower class using 'setImage(tpic);' and 'setimage(g);' at lines 11 and 6 in my code above. When upgrading the tower the 'g' image will need to be updated, also.
What role does the semicolon play?
By mpmullins, with 1 reply.
Replied to by bourne, over 11 years ago:
Indicates where the statement terminates. Probably mostly to aid the compiler. In Java you can write an entire program on one line.
my "Enemy" wont move like its supposed to when it is 250 leftTurn, it moves half way across the map. I want it to run the full way. how do i fix this problem??
By qsapp.3, with 1 reply.
Replied to by danpost, over 11 years ago:
Forgive me if I am wrong, but it appears that the 'atTurningPoint' method will always return true. The x-coordinate of the enemie will always be either less than or equal to leftTurn (450) or greater than or equal to rightTurn (also 450). This means that the speed will always be changing directions and your actor will jiggle in place. Your conditions for turning in your 'atTurningPoint' method needs some work.
pressing buttons and then adding an object to the world by clicking in it
By darkmist002, with 15 replies.
Last reply by darkmist002, over 11 years ago:
had the right idea, was sticking it in the wrong part lol. thanks for the help.
IcedTea Error
By sametguzelgun, with 1 reply.
Replied to by davmac, over 11 years ago:
I'm pretty sure this is a problem with the IcedTea plugin. I don't think you can use it to view applets on greenfoot.org.
Problem with my code
By Dinokilla7, with 1 reply.
Replied to by Gevater_Tod4711, over 11 years ago:
Your class is never closed. Try adding '}' at the end of your class. That may help.
I have Enemy 1, 2 and 3 but Enemy 2 is compiled perfectly but the other 2 say they r compiled but still have the lines and wont let me place them on the map. what am i doing wrong?? here is Enemy1
By qsapp.3, with 1 reply.
Replied to by danpost, over 11 years ago:
In order to manually place them on the map, they must have a constructor method in the class. For the class given above, add this constructor: <Code Omitted>
How do I channel a "MainPlayer" into a new world if something happens such as he dies??
By qsapp.3, with 1 reply.
Replied to by FlyingRabidUnicornPig, over 11 years ago:
Could you explain it a bit better? If I understand you correctly, you want to spawn the player again when he dies... If that's the case, just set the world to a new version of that or something. It will look like the world is reset, but it didn't really reset. Or you could have a reset method that adds/deletes objects back into their original places (such as the MainPlayer at the beginning of the level)
I keep getting the error cannot find method for gameOver(); how do i fix this properly?? im very confused
By qsapp.3, with 5 replies.
Last reply by qsapp.3, over 11 years ago:
Thank you so much!
804
805
806
807
808
809
810
X