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
Help Plz
By DemonsWhiteSoul, with 5 replies.
Last reply by DemonsWhiteSoul, almost 12 years ago:
Thanks^
Help with sprites and sidescrolling
By n1nikko, with no replies.
I want my sprites to move along when i side scroll, but I dont know how to do it. when my character reaches the border to start scrolling, he freezes it place and move along with the screen. Code import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Superclass of all actors. * * @author Bertie Wheen * @version 0.1 */ public class Erm extends Actor { public boolean shouldScroll; //A boolean to determine if scrolling is needed, according to how far left/right across the screen the player is. public int playerX; //The player's x value public Erm(){ } public void act() { updateShouldScroll(100, 900); //This should be in the act method so that the shouldScroll boolean is constantly updated. } /** * This method checks the players x position and sets the shouldScroll boolean accordingly. * @param The x value limits within which scrolling is not required for left/right movement. */ public void updateShouldScroll(int minX, int maxX) { Background theWorld = (Background) getWorld(); Player player = (Player) theWorld.getPlayer(); playerX = player.getX(); if(playerX <= minX || playerX >= maxX) { shouldScroll = true; } else { shouldScroll = false; } if(shouldScroll == true && (playerX >= 900 && Greenfoot.isKeyDown("a")) || (playerX <= 100 && Greenfoot.isKeyDown("d"))) { shouldScroll = false; } } }
how do I make words appear
By kylecompton31, with 7 replies.
Last reply by kylecompton31, almost 12 years ago:
MrGigglez wrote...
What a guy
what a guy
Math/Car Game
By MrGigglez, with no replies.
Im trying to create a math/car. The game asks the user math questions. There is a race track at the top of the world with two car classes. I want one car to start moving towards a finish line at a rate while the other car stays still and every time the user answers the right question the car that is still moves. the goal is to answer the questions faster and get the car towards the finish race faster than the car that is already moving. I don't know how to make the questions appear. Or make the cars move like I want them to. Im very new to programming and this is a school project.
Image won't be set??
By elementa, with no replies.
Hi, I'm trying to set an image to my actor by either <Code Omitted> or by manually doing it in right click, "Set Image". However, the image never appears to be set and when I do it manually, the image file disappears from the images folder. I'm not sure why this is happening??
Generic Type
By Busch2207, with no replies.
Done. Found another solution for my problem.
Is it OK to ask coding help questions here that aren't about greenfoot, like about Eclipse?
By Entity1037, with 4 replies.
Last reply by davmac, almost 12 years ago:
I've tried StackOverflow, but they won't let you post any questions that are like "I don't know what's wrong with my coding, someone help me!"
I've found in general that on StackOverflow it's fine to ask questions as long as you are very precise about what is going wrong and give a
short
but
complete
code sample showing what you've tried. I.e. if you try something and it doesn't do what you expect, it should be ok to ask about it on StackOverflow. If you just want general "tell me how to do xyz" then it's probably not the place. A big part of the process is l
Can't get coordinate (pixel) of actor, help please!
By Socrates, with 6 replies.
Last reply by Socrates, almost 12 years ago:
I wanted to remove collision from a few objects that you could walk by. For example I wanted a portal to the next level and I wanted the player to stand inside of it, but it has collision and it just stands next to it. I posted my scenario, it would be great if you could look at it for me ,thanks. http://www.greenfoot.org/scenarios/13110
Two final bugs with game - help needed
By Dillybar, with 15 replies.
Last reply by Dillybar, almost 12 years ago:
Finally got it working! thank you for your help danpost
My lwjgl buffer to texture code
By Entity1037, with 5 replies.
Last reply by danpost, almost 12 years ago:
DesaGrammer wrote...
I'm not sure how to do something as advanced as this sorry but it could be a simple as when the class is calling the method in line ten you put " }; " not sure if that's going to make a big difference but it probably will if you get erase the " ; " in the 10 it's made a big difference to me before Hope it work
@DesaGrammer, this IS java; and all java statements are to end with a semi-colon; so, it should not be removed.
DesaGrammer wrote...
Also when the class is calling the method in line 4 under " textMatrix = { " you put " ,"\"", " and I'm guessing there shoul
Cannot find symbol-Variable Counter
By Dan123, with 5 replies.
Last reply by Dan123, almost 12 years ago:
thanks for your help
please help. level2 cannot be cast to level1 terminal window error
By khalid11, with 2 replies.
Last reply by khalid11, almost 12 years ago:
i tried but it didnt work
im trying to make a score counter for when the actor kills enemies but doesn't work for some reason
By khalid11, with 36 replies.
Last reply by khalid11, almost 12 years ago:
if it helps ive noticed in the other discussion their error only appears once i hit an enemy in level2
HELP!! sound used to work but not anymore
By Dan123, with 4 replies.
Last reply by Dan123, almost 12 years ago:
dont worry fixed it
score counter not working for me
By Dan123, with 3 replies.
Last reply by xFabi, almost 12 years ago:
the method thats supposed to "count" You didnt include anything into your act() method that could do that, so how can you expect the programm to do it :)? The code above should work Edit: change act() to<Code Omitted> Also you didnt declare the actor, in the code given. If you didnt already do, write this in front of the if <Code Omitted> Oh, and please stop creating new topics, the context is lost, and its confusing,
610
611
612
613
614
615
616
X