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
Adding multiple objects to the world after an intersection
By gamer121, with 1 reply.
Replied to by bourne, about 10 years ago:
Use a loop like the following: <Code Omitted>
Enemies code not working
By GamesGrinder1998, with 6 replies.
Last reply by erdelf, about 10 years ago:
did u even change something `? this should work line 68-71 <Code Omitted>
Variables keeping track of values
By gamer121, with 28 replies.
Last reply by gamer121, about 10 years ago:
Nevermind, I finally got it to work! Thanks for all of your time and help. I really appreciate it!
Changing locations of objects after an intersection
By gamer121, with 3 replies.
Last reply by gamer121, about 10 years ago:
So now, I want to add 10 new food objects into the world randomly every time the Player gets to Home. How do I add the food randomly without copy and pasting the code several times? My Food class code is shown below. Thanks so much for the help.
Selecting an actor using Greenfoot.mousePressed(this)
By Zzimon, with no replies.
Trying this again, what I'm trying to do is select an actor after clicking it so that when i have clicked an actor i can press w,a,s or d to get my actor to move either up, down, left or right and after the actor have moved for it to become un-selected again. I have tried this a couple of different ways and haven't been able to get any of them to work, actually if I could just get one tile to move in a direction when i click on it i would be thrilled but I can't. here's a picture of what my world looks like: <Image Omitted> The blue background is made from me using a class that creates a mini-world withing a world so as to get the grid working. I suspect that there is something in my PIP actor or my world actor that is blocking the mousePressed on each of the tile actors and making it click on the PIP element instead and I can't quite figure out which thing in my code that might be causing this. World actor: <Code Omitted>PIP actor: <Code Omitted>and the tile actor with the selection/move script aka my Sword actor <Code Omitted>
Issue with switch
By theiam79, with 4 replies.
Last reply by theiam79, about 10 years ago:
Figured it out. Simple ordering, respawn before removing the old asteroids (duh). What happens when two collide is the picture changes, for effect, a new asteroid respawns 10 pixels in from the left at a random height, and then the two old asteroids disappear.
UserInfo.getTop(10)
By karolis, with 2 replies.
Last reply by davmac, about 10 years ago:
You just need to loop through the users (the list returned by UserInfo.getTop(...)), and print their name and score.
Creating a grid in a non-grid world
By Zzimon, with 89 replies.
Last reply by Zzimon, about 10 years ago:
I don't quite understand what you mean with the Actor field, could you give an example of how to use it?
gif images
By Greenfootnoob, with 1 reply.
Replied to by davmac, about 10 years ago:
Probably you should import the GifImage class and read its documentation.
help with random spawn
By nc-munk, with no replies.
I am making a game for a school project. I need help a random spawn function it is should spawn an asteroid in top for the screen and move down and i cant make them spawn and move my code look in line 27 to 42 <Code Omitted>
Lag in my game
By poon, with no replies.
Hello i'm making a game for my object oriented programming class , i have a world with a scroll based on a project named "Scrolling Man" . that´s the code for the scroll : public void scroll(int cX, int cY) { x = x +cX; y = y +cY; getBackground().drawImage(Background,x, y); } the method is called when an arrow is pressed and it works, but i have a problem. the method makes very slow my game, i tried to reduce the size of the background but that no solves the problem, i removed the method call, and the game have not more lag. Please help me, how can i make the scroll without lag???
Challenge || May 2014 voting
By JetLennit, with 30 replies.
Last reply by JetLennit, about 10 years ago:
This
is where the Challenge page is
HealthBar not losing health.
By Than4tos, with 18 replies.
Last reply by Than4tos, about 10 years ago:
Cheers m8 rly thx alot for the help it's working did not know you could chek it like that hmm nice. just made a quick run through the game and it's working looks like it's done now for the report the boring part. Again thx alot that was the last bit and it was driving me crazy
How do I get my enemy to chase my actor?
By Fang, with 1 reply.
Replied to by danpost, about 10 years ago:
Use the Actor class method 'turnTowards'. You will need to locate the player for that. You can use the Actor class method 'getObjectsInRange' which returns a List object; use the List class method 'isEmpty' with the NOT character ( '!' ) to ensure that at least one element is returned in the list; then, use the List class method 'get' on another instance of the list to get that element from the list and cast that element as an Actor object, saving it in a local variable. With that, you can use the Actor class methods 'getX' and 'getY' to get the location of the actor to use in the 'turnTowa
Storing, retrieving and printing high scores
By karolis, with 4 replies.
Last reply by danpost, about 10 years ago:
There is no way to change the current user while the project is running.
681
682
683
684
685
686
687
X