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
Smooth Mover class
By allens, with 1 reply.
Replied to by danpost, almost 8 years ago:
allens wrote...
can someone please explain me how smooth mover class actually works, and how it is changing the movement of our actor? It is kinda more teoretical question but I was realy curious how our actor can move for example 0.5 pixel, and how is this class really changing the behaviour of our actors.
You cannot have the actual location coordinate be anything other than whole numbers. What a smooth moving support class will do is track a location of an actor more precisely -- and place the actor at the "nearest" pixel to that stored location. This essential removes the loss of f
what the heck am I doing wrong?? (netwon project)
By Toodumbtocode, with 2 replies.
Last reply by Toodumbtocode, almost 8 years ago:
oh my goodness, thank you so much. I just felt a wave of relief come over me. Can't believe I forgot to add that!
Urgent Question
By cesarinstalled, with 1 reply.
Replied to by danpost, almost 8 years ago:
cesarinstalled wrote...
I was wondering if it is possible to have an gif image change when coming in contact with another subclass, for example I have a gif that is idle it moves a little but i want it to change to another gif when coming in contact with another gif.
Yes -- it is possible. Your terminology is suspect, however. I take what you said to mean:
I have an actor in the world whose image is to change when it intersects the image of an actor of a different type.
Basically: <Code Omitted>It is be
NEED HELP WITH NEWTON PROJECT
By Toodumbtocode, with 1 reply.
Replied to by danpost, almost 8 years ago:
Import statements must be provided before the class code (starting at line 1 in your class editor, in your case).
what is wrong with my if and else statement
By divinity, with 4 replies.
Last reply by danpost, almost 8 years ago:
With a fresh look at the code, I see you have a text field called
txt_cash
. If that is for the requested withdraw amount, then it would need to be used somewhere in your
btn_widthActionPerformed
method.
addObject method not working and I don't know why?
By potatosnix, with 2 replies.
Last reply by potatosnix, almost 8 years ago:
danpost wrote...
potatosnix wrote...
I'm trying to add an object but the addObject method isn't working for some reason, not sure what I've done to accomplish that << Code Omitted >>
The
addObject
method is not an
Actor
class method.
Thank you, I didn't even think of that! All fixed and working, thank you so much!!
What is the meaning of prefix?
By MB12345, with 1 reply.
Replied to by danpost, almost 8 years ago:
MB12345 wrote...
What is the meaning of prefix? << Code Omitted >>
prefix
is the label you wish to give to the value the counter is to display. Some possible examples "Score: ", "Worms Eaten: ", "Level ", "Time remaining: " etc. The prefix is displayed, as a label, in front of the value.
What does this code do?
By iamdsd, with 1 reply.
Replied to by danpost, almost 8 years ago:
iamdsd wrote...
What does this code do? << Code Omitted >>
It appears to animate an actor in such a way as to go forward in some way (maybe change or grow or progress and then go backward (maybe revert or shrink or regress). This action is done one time and the actor is them removed from the world. Lines 3 and 5 iterate through the images in the array. The first
if
block reverses the direction that the images in the array are being used. The second
if
block removes the actor after the last image going in reverse is used. To make more clear, the code could be used
Is there any way to spawn ememies at an interval?
By CharBun, with 5 replies.
Last reply by danpost, almost 8 years ago:
CharBun wrote...
<< Code Omitted >> I have this right but it doesn't work?
Lines 10 and 11 should go in a constructor and line 9 should go in the
newWave
method. Remove lines 9 through 11 and add/edit the following blocks of code: <Code Omitted>
I get an error message every time the rocket hits an asteroid. Does anybody know what the problem is?
By Cheerioman25, with 1 reply.
Replied to by danpost, almost 8 years ago:
Cheerioman25 wrote...
I get an error message every time the rocket hits an asteroid. Does anybody know what the problem is?
The actor loses its location in the world when you remove it from the world. Add the explosion before removing the actor from the world.
Error in Method Call. Why does space have to be infront of gameOver if the game over method is public
By Username45, with 1 reply.
Replied to by danpost, almost 8 years ago:
Username45 wrote...
Error in Method Call. Why does space have to be infront of gameOver if the game over method is public
Because without it, "
this
" (the bullet, I presume, in your case), by default, is the object that the
gameOver
method would be executed on. But, the method is in your Space class and belongs to instances of the Space class. "public" just means you can call the method on an instance of the class from another class. From another class, you need to specify which instance of the class you are calling the method on, noting that you can create multiple inst
How do these numbers result in a specific color?
By QSABC10, with 2 replies.
Last reply by bentondecusin, almost 8 years ago:
There are two ways to set colours. One way is what your font colour is using, which is <Code Omitted>Greenfoot provides several existed colours like Yellow, White, Red, Pink. You can find these colours on Greenfoot Documentation. Another ways is you make a colour. The method is <Code Omitted>or <Code Omitted>int a, int b, int c make up the RGB (red, green, blue) code and int d determines the transparency (0 is transpartent and 1 is opaque Hope this helps
What does it mean when the Brackets are surrounding the i? What does the do for the constructor class?
By Plop, with 1 reply.
Replied to by danpost, almost 8 years ago:
What does it mean when the Brackets are surrounding the i? What does the do for the constructor class?
Please refer to
this page
of the Java tutorials.
why the red squiggly error
By divinity, with 1 reply.
Replied to by divinity, almost 8 years ago:
hi pple i figure out the error
How Do You Remove an Actor?
By CosmicCaleb, with 5 replies.
Last reply by danpost, almost 8 years ago:
For best help results, please show the current complete class and copy/paste the entire error output created from that code.
234
235
236
237
238
239
240
X