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
Creating an instance Variable?
By jstofer2, with 2 replies.
Last reply by jstofer2, almost 7 years ago:
Thank you!
Spawning character on key press & sound playing
By MLGwarfare, with 1 reply.
Replied to by albertlai431, almost 7 years ago:
You'll have to put those if statements in the act method of the world, since the constructor is only called once when the world is declared. You'll want to be continuously checking if the space button is pressed, not only once.
Collection System
By HEISENBERG, with 4 replies.
Last reply by danpost, almost 7 years ago:
HEISENBERG wrote...
No, I don't think so... I'm calling the collect method, and in there is the Actor
Please show entire class codes.
Trying to minimize lag on Greenfoot website?
By albertlai431, with 12 replies.
Last reply by danpost, almost 7 years ago:
It would probably take a member of the greenfoot team to confirm, but I get the distinct feeling the answer is no. Before they went to javascript and having their own
Color
and
Font
classes, my
TextImage
support class would allow
GreenfootImage
objects to be created using a specified font. Unfortunately, it is now pretty much obsolete.
Greenfoot Bug??? (Again)
By ITStudent, with 3 replies.
Last reply by ITStudent, almost 7 years ago:
Okay, so i had made a new static int PO and now its working fine. Maybe it was a bug from Greenfoot
Where can I get a copy of crab2.png?
By Hal_cat, with 1 reply.
Replied to by danpost, almost 7 years ago:
Download the
book scenarios
. All crab scenarios in
chapter02-04
have it.
mirrorVertically problem
By Hundmat, with 1 reply.
Replied to by danpost, almost 7 years ago:
The line: <Code Omitted>mirrors the current image. When executed again, it mirrors that mirrored image. Etc. You will either have to keep track of whether each image in each array is already mirrored or not OR keep and use the mirrored images in separate arrays.
Sound = playing a sound of a World, if no other Sound is playing
By ITStudent, with 4 replies.
Last reply by ITStudent, almost 7 years ago:
Finally it works. Thank You I just typed public static final before GreenfootSound and now everything works fine. Chapter closed! :D
Adding increasing levels to game.
By AVH, with 3 replies.
Last reply by danpost, almost 7 years ago:
AVH wrote...
Is there a better or easier way to add levels after the orcs are removed. I'm getting confused with the code.
??? Better or easier than what? I do not see any codes either checking for no orcs or for changing levels?
Problem about BGM
By MianBao_Bread, with 2 replies.
Last reply by ITStudent, almost 7 years ago:
Code 1 : U can use GreenfootSound bgm = new GreenfootSound("bgm.wav"); if(!bgm.isPlaying()){bgm.play();} Code 2 should work fine! Afterall i have a SoundProblem too (see Discussions)
Switching between Worlds
By ihjufaeshiju, with 2 replies.
Last reply by ihjufaeshiju, almost 7 years ago:
Thanks, this worked very nicely.
Reflection law calculate new direction (Tank Game)
By SushiLlama, with 32 replies.
Last reply by SushiLlama, about 7 years ago:
Tried all of them. It made the amount of disappearing shells even larger, im afraid.
danpost wrote...
See if a larger value than 99 (and -99) will do the trick. Try 100, 150, 199 (I would not think more than 199 would be needed. The initial 99 was for the fact that the QActor is not placed at its Q-location (cannot be placed between pixels on the screen). The additional amount I am suggesting now is for the change in rotation of the actor (the center of the image along an even sized dimension is a half pixel off from where the actor is actually placed on the screen). These values are on the
Animation
By Hundmat, with 1 reply.
Replied to by danpost, about 7 years ago:
Hundmat wrote...
I have seen several ways to animate images in greenfoot, but which is the most convenient way of coding it. Right now I'm using this << Code Omitted >>
Convenient? ... probably what you have is most convenient for you. However, convenient is not necessarily best. Use of the array is an excellent choice. Using a double value for an integer index does not seem appropriate. In fact, it is not possible for a computer to store the value of one-fifth exactly. And, although it may seem like a moot point, computations using double values takes longer than when using int v
Newtons Project - Greenfoot Textbook
By VanishingDog, with 1 reply.
Replied to by danpost, about 7 years ago:
Use get
K
ey instead of
isKeyDown
. It could start as follows: <Code Omitted>Do not put your line 146 in the loop.
How to make a ball bounce back from a object?
By ouyoood, with 1 reply.
Replied to by danpost, about 7 years ago:
Try this: <Code Omitted>
162
163
164
165
166
167
168
X