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
Is there an easy way to do side scrolling
By n1nikko, with 4 replies.
Last reply by n1nikko, about 11 years ago:
danpost wrote...
Well, no scroller is easy and unfortunately, that (specifically) is one type I do not have an example of on the site (although I have several scrollers with source available -- some side-scrollers and some universal). My
Timed Scrolling
scenario is the closest thing I have up; but, it is a universal scroller. I would, however, contain everything you would need to learn from.
thanks
Danpost this is my problem
By docinkc, with 2 replies.
Last reply by docinkc, about 11 years ago:
danpost wrote...
You copied line 12 incorrectly.
Thank you!
Need help switching spirtes when i change directions
By n1nikko, with 5 replies.
Last reply by n1nikko, about 11 years ago:
Thanks a lot it worked, and do you know how to do side scrolling?
Farrukh stole my scenario.
By Entity1037, with 7 replies.
Last reply by davmac, about 11 years ago:
There was no response from Farrukh and I have had to disable the account.
Help with 2048
By midnightocean, with 6 replies.
Last reply by danpost, about 11 years ago:
An easier way to go about executing a move is to keep track of (1) how many blocks have been moved; and (2) the value of the last block moved. If moving up, then, for each column. start at the top and working down (a) check for a block and if encountered, if the last block value equals this block value, remove this block and double the last block value (the block can be located by the value of the number of blocks moved or it can be held in a field). Once a combining has occurred, set the last block value to zero. If not combining, set its location, bump number of blocks moved and set last
Method cannot be applied
By Hutanoi, with 6 replies.
Last reply by lordhershey, about 11 years ago:
@danpost I still have a Tandy 1000 SX , the thing still works, I was thinking of pulling it out a doing some basic programming on it for kicks. It has no mouse, I did upgrade it several times, put a 20 Meg Hardcard in it, ram up to 640K, replaced 1 of the 5 1/4 inch drives with a 3 1/2 720k drive. Only thing I did not do was put extended memory in.
Objects so einfügen dass sie einen Abstand zu dem oberem und unterem Rand haben
By skaterboy88, with no replies.
Hallo ich habe sogenannte Fliegen implementier mit der Methode public void verteileFliegen() { List listeFrosch, listeKescher, listeKescher1,listeKescher2, listeKaktus; int x,y; for (int i=0; i<25; i++) { addObject(new Fliege(), Greenfoot.getRandomNumber(getWidth()-40), Greenfoot.getRandomNumber(getHeight()-40)); } do{ x = Greenfoot.getRandomNumber(10); y = Greenfoot.getRandomNumber(10); listeFrosch = getObjectsAt(x,y,Frosch.class); listeKescher = getObjectsAt(x,y,Kescher.class); listeKescher1 = getObjectsAt(x,y,Kescher1.class); listeKescher2 = getObjectsAt(x,y,Kescher2.class); listeKaktus = getObjectsAt(x,y,Kaktus.class); } while(! (listeKescher.isEmpty() && listeKescher1.isEmpty() && listeKescher2.isEmpty()&& listeFrosch.isEmpty() ) ); } Doch leider setzt es die Fliegen ab und zu auf den Rand meines Spielfeldes was ziemlich kacke ist... was kann man da machen?
Remove all Objects
By skaterboy88, with 2 replies.
Last reply by skaterboy88, about 11 years ago:
Vielen Dank
Platformer Blocks
By docinkc, with 1 reply.
Replied to by lordhershey, about 11 years ago:
There are many examples where people have published their code, some are better than others, you can see
http://www.greenfoot.org/scenarios/11302
or
http://www.greenfoot.org/scenarios/10770
The second scenario the creator has a youtube channel where he explains everything he did, just invest an hour or 2 and watch all parts of it.
Need help switching spirtes when i change directions
By n1nikko, with 1 reply.
Replied to by lordhershey, about 11 years ago:
In you move right and left turn tthe last else if statement to be just an else statement, this is so if none of the previous tests assign an image it will take a default.
How to make a multiplier game like cookie clicker?
By HBMC, with 2 replies.
Last reply by HBMC, about 11 years ago:
Im just started now..... Cookie:
How to remember certain int's after new worlds
By SAAEngineer, with 44 replies.
Last reply by danpost, about 11 years ago:
Again, you need to pass the BackgroundLvL1 world on to the next world. <Code Omitted>
ClassNotFound
By dan11, with 2 replies.
Last reply by davmac, about 11 years ago:
Does
this discussion
help?
Avoid collision with walls
By sansarion, with no replies.
Hello, im trying to make a single player tron game.Here is an example i found
link
What im trying to do is to avoid hitting the walls ( on the actor that i cant control ,who is being played from the computer).Here is the code that i have so far <Code Omitted> I tried some things but i just managed to move it diagonally . Thank you in advance.
timer based movement
By dale1, with no replies.
public int timer = 10; public void act() { checkKeypress(); Time(); Pipetouch(); } public void Time(){ if(timer < 0) { timer= timer -1; } } public void Pipetouch() { if (isTouching(Upipie.class)){ { setLocation(getX(), getY()+3); } } if (isTouching(Spipe.class)){ //if (timer 10){ //setLocation(getX()+3, getY()); //} if ( time>=5){ setLocation(getX()-3, getY()); } } //if (isTouching(Spipe2.class)){ // setLocation(getX()-3, getY()); } i am trying to do is making a timer if the time is less than 5 move left if greater move right but only touching one object.
674
675
676
677
678
679
680
X