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
How can I make a timer that will after 5 seconds remove the first bullet
By Nib, with 1 reply.
Replied to by lordhershey, over 11 years ago:
You can set a timer on the bullet itself to remove itself when the time expires like this: <Code Omitted>
Need help to identify an object
By Edanleep, with no replies.
What i want to do is to make a code in the world class to look for an object in the world and then use that answer as a boolean for an if statement
Help I cant start scenarios anymore
By FlicknFlack, with 5 replies.
Last reply by davmac, over 11 years ago:
put security settings to lowest
Do not do that.
and add www.greenfoot.* to your whitelist/greylist.
Do this
instead
.
switch statement
By davemib123, with 4 replies.
Last reply by davemib123, over 11 years ago:
Thanx for the replies.
array?!?!?
By callumbo, with 1 reply.
Replied to by lordhershey, over 11 years ago:
The question is a little too big. Is it the array that you do not know how to make, or it is trying to map this to the screen in some meaningful way?
Problems with numbers symbols
By Kartoffelbrot, with 10 replies.
Last reply by Kartoffelbrot, over 11 years ago:
Nice idea!
Problem uploading the game
By 666Jay666, with 8 replies.
Last reply by 666Jay666, over 11 years ago:
erdelf, you solved the problem! I must have at some point renamed the images folder for some reason. I don't recall doing it, but I have been working on the game for some time and had so many versions something could have went wrong which could have been the reason I done this. I renamed the folder 'images' and it now works fine. Thanks for your help!
How to use intersects(Actor) command?
By K210, with 1 reply.
Replied to by danpost, over 11 years ago:
You cannot use a class in place of an Actor in the intersects method. If you want to look for a actors of class, use a different method, like the 'isTouching' method.
Hey, I keep getting illegal start of expressio
By MaximusDestruction, with 6 replies.
Last reply by elias.groll, over 11 years ago:
That will fix the error in beeing easyer to read :) Btw it will increase the performance..
nothing happen until is key is pressed
By sumrandom, with 8 replies.
Last reply by AntonB, over 11 years ago:
Fortunately, the UWS administration is in possession of very advanced heuristic systems to detect plagiarism- specifically, those to detect similarities in the underlying code structure regardless of changes in variables names and ordering of various things.
Anton Bogdanovych
Problem making a new world
By CalzoneCannon, with no replies.
I am trying to add a start screen to my game, but whenever I try to create a new world sub class, it tells me the picture I am trying to use was not found, even though I put it in the images folder, then it deletes the image from the folder. Error message: java.io.FileNotFoundException: E:\Computer Science\Temp Folder\PlantsVsZombies\images\PvZStartScreen.png (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:146) at greenfoot.util.GreenfootUtil.copyFile(GreenfootUtil.java:441) at greenfoot.actions.BrowseImagesAction.actionPerformed(BrowseImagesAction.java:79) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) at java.awt.Component.processMouseEvent(Component.java:6505) at javax.swing.JComponent.processMouseEvent(JComponent.java:3320) at java.awt.Component.processEvent(Component.java:6270) at java.awt.Container.processEvent(Container.java:2229) at java.awt.Component.dispatchEventImpl(Component.java:4861) at java.awt.Container.dispatchEventImpl(Container.java:2287) at java.awt.Component.dispatchEvent(Component.java:4687) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422) at java.awt.Container.dispatchEventImpl(Container.java:2273) at java.awt.Window.dispatchEventImpl(Window.java:2719) at java.awt.Component.dispatchEvent(Component.java:4687) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735) at java.awt.EventQueue.access$200(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:694) at java.awt.EventQueue$3.run(EventQueue.java:692) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87) at java.awt.EventQueue$4.run(EventQueue.java:708) at java.awt.EventQueue$4.run(EventQueue.java:706) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:705) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154) at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182) at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221) at java.security.AccessController.doPrivileged(Native Method) at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219) at java.awt.Dialog.show(Dialog.java:1082) at java.awt.Component.show(Component.java:1651) at java.awt.Component.setVisible(Component.java:1603) at java.awt.Window.setVisible(Window.java:1014) at java.awt.Dialog.setVisible(Dialog.java:1005) at greenfoot.actions.NewSubclassAction.createImageClass(NewSubclassAction.java:93) at greenfoot.actions.NewSubclassAction.actionPerformed(NewSubclassAction.java:81) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.AbstractButton.doClick(AbstractButton.java:376) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877) at java.awt.Component.processMouseEvent(Component.java:6505) at javax.swing.JComponent.processMouseEvent(JComponent.java:3320) at java.awt.Component.processEvent(Component.java:6270) at java.awt.Container.processEvent(Container.java:2229) at java.awt.Component.dispatchEventImpl(Component.java:4861) at java.awt.Container.dispatchEventImpl(Container.java:2287) at java.awt.Component.dispatchEvent(Component.java:4687) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422) at java.awt.Container.dispatchEventImpl(Container.java:2273) at java.awt.Window.dispatchEventImpl(Window.java:2719) at java.awt.Component.dispatchEvent(Component.java:4687) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735) at java.awt.EventQueue.access$200(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:694) at java.awt.EventQueue$3.run(EventQueue.java:692) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87) at java.awt.EventQueue$4.run(EventQueue.java:708) at java.awt.EventQueue$4.run(EventQueue.java:706) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:705) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.run(EventDispatchThread.java:91) Any help would be greatly appreciated!
Help with trying to get something to happen only once
By fyziqs, with 2 replies.
Last reply by AntonB, over 11 years ago:
Hello, fyziqs. If you did have any issues with your major assignment, you should have just emailed me! Kind regards,
Anton Bogdanovych
.
returning to ghost house
By newprogramming, with 16 replies.
Last reply by AntonB, over 11 years ago:
Hello Danpost. Thank you for being so kind and informative to a new programmer- however, I must inform you that this is most likely a student who is doing the course I coordinate (Programming Fundamentals) at the University of Western Sydney (UWS). For their major assignment, I have assigned my students the task of recreating the popular 'Pac man' game in Greenfoot, and I have given them a few methods pre-written to help them out. The lectures I have given, and the information supplied online at the UWS site are more than enough to be able to complete this assignment, and I am disappointed the
"Array required, but [Class Name] found"- Help!
By Kwhyte, with 3 replies.
Last reply by erdelf, over 11 years ago:
give the constructor of the Prize class
Hey, I keep getting illegal start of expression
By MaximusDestruction, with no replies.
Hey, I keep getting illegal start of expression for this code. Can anyone tell me whats wrong with it? import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class Coin here. * * @author (your name) * @version (a version number or a date) */ public class Coin extends Actor { private GreenfootImage image1; private GreenfootImage image2; private GreenfootImage image3; private GreenfootImage image4; private GreenfootImage image5; private GreenfootImage image6; private GreenfootImage image7; private GreenfootImage image8; private GreenfootImage image9; private GreenfootImage image10; private GreenfootImage image11; private GreenfootImage image12; private GreenfootImage image13; private GreenfootImage image14; private GreenfootImage image15; private GreenfootImage image16; private GreenfootImage image17; private GreenfootImage image18; private GreenfootImage image19; private GreenfootImage image20; private GreenfootImage image21; private GreenfootImage image22; private GreenfootImage image23; private GreenfootImage image24; private GreenfootImage image25; private GreenfootImage image26; private GreenfootImage image27; private GreenfootImage image28; private GreenfootImage image29; private GreenfootImage image30; private GreenfootImage image31; private GreenfootImage image32; private GreenfootImage image33; private GreenfootImage image34; private GreenfootImage image35; private GreenfootImage image36; private GreenfootImage image37; private GreenfootImage image38; private GreenfootImage image39; private GreenfootImage image40; public Coin() { image1 = newGreenfootImage("Zen1.png"); image2 = newGreenfootImage("Zen2.png"); image3 = newGreenfootImage("Zen3.png"); image4 = newGreenfootImage("Zen4.png"); image5 = newGreenfootImage("Zen5.png"); image6 = newGreenfootImage("Zen6.png"); image7 = newGreenfootImage("Zen7.png"); image8 = newGreenfootImage("Zen8.png"); image9 = newGreenfootImage("Zen9.png"); image10 = newGreenfootImage("Zen10.png"); image11 = newGreenfootImage("Zen11.png"); image12 = newGreenfootImage("Zen12.png"); image13 = newGreenfootImage("Zen13.png"); image14 = newGreenfootImage("Zen14.png"); image15 = newGreenfootImage("Zen15.png"); image16 = newGreenfootImage("Zen16.png"); image17 = newGreenfootImage("Zen17.png"); image18 = newGreenfootImage("Zen18.png"); image19 = newGreenfootImage("Zen19.png"); image20 = newGreenfootImage("Zen20.png"); image21 = newGreenfootImage("Zen21.png"); image22 = newGreenfootImage("Zen22.png"); image23 = newGreenfootImage("Zen23.png"); image24 = newGreenfootImage("Zen24.png"); image25 = newGreenfootImage("Zen25.png"); image26 = newGreenfootImage("Zen26.png"); image27 = newGreenfootImage("Zen27.png"); image28 = newGreenfootImage("Zen28.png"); image29 = newGreenfootImage("Zen29.png"); image30 = newGreenfootImage("Zen30.png"); image31 = newGreenfootImage("Zen31.png"); image32 = newGreenfootImage("Zen32.png"); image33 = newGreenfootImage("Zen33.png"); image34 = newGreenfootImage("Zen34.png"); image35 = newGreenfootImage("Zen35.png"); image36 = newGreenfootImage("Zen36.png"); image37 = newGreenfootImage("Zen37.png"); image38 = newGreenfootImage("Zen38.png"); image39 = newGreenfootImage("Zen39.png"); image40 = newGreenfootImage("Zen40.png"); setImage(image1); } { /** * Act - do whatever the Coin wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { { if (getImage().equals(image1)) { setImage(image2); }else if (getImage().equals(image2)) { setImage(image3); }else if {(getImage().equals(image3)) { setImage(image4); }else if {(getImage().equals(image4)) { setImage(image5); }else if {(getImage().equals(image5)) { setImage(image6); }else if {(getImage().equals(image6)) { setImage(image7); }else if {(getImage().equals(image7)) { setImage(image8); }else if {(getImage().equals(image8)) { setImage(image9); }else if {(getImage().equals(image9)) { setImage(image10); }else if {(getImage().equals(image10)) { setImage(image11); }else if {(getImage().equals(image11)) { setImage(image12); }else if {(getImage().equals(image12)) { setImage(image13); }else if {(getImage().equals(image13)) { setImage(image14); }else if {(getImage().equals(image14)) { setImage(image15); }else if {(getImage().equals(image15)) { setImage(image16); }else if {(getImage().equals(image16)) { setImage(image17); }else if {(getImage().equals(image17)) { setImage(image18); }else if {(getImage().equals(image18)) { setImage(image19); }else if {(getImage().equals(image19)) { setImage(image20); }else if {(getImage().equals(image20)) { setImage(image21); }else if {(getImage().equals(image21)) { setImage(image22); }else if {(getImage().equals(image22)) { setImage(image23); }else if {(getImage().equals(image23)) { setImage(image24); }else if {(getImage().equals(image24)) { setImage(image25); }else if {(getImage().equals(image25)) { setImage(image26); }else if {(getImage().equals(image26)) { setImage(image27); }else if {(getImage().equals(image27)) { setImage(image28); }else if {(getImage().equals(image28)) { setImage(image29); }else if {(getImage().equals(image29)) { setImage(image30); }else if {(getImage().equals(image30)) { setImage(image31); }else if {(getImage().equals(image31)) { setImage(image32); }else if {(getImage().equals(image32)) { setImage(image33); }else if {(getImage().equals(image33)) { setImage(image34); }else if {(getImage().equals(image34)) { setImage(image35); }else if {(getImage().equals(image35)) { setImage(image36); }else if {(getImage().equals(image36)) { setImage(image37); }else if {(getImage().equals(image37)) { setImage(image38); }else if {(getImage().equals(image38)) { setImage(image39); }else if {(getImage().equals(image39)) { setImage(image40); }else {(getImage().equals(image40)) { setImage(image1); }
677
678
679
680
681
682
683
X