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
Need help setting image in act()
By Game4Lols, with 2 replies.
Last reply by Game4Lols, almost 7 years ago:
I changed the order of line 8, and I don't know why line 5 was static. I got rid of it but iam exists because I want to have digit2 and digit3 all the way to 27, hence the array with 27+ values. But regardless, I moved my digits code to my world subclass, and used ((IntOF)getWorld()).getValue(iam) to get the Array value. It worked PERFECTLY. Thanks so much :)
Need help with inheriting the traits to offspring...
By Kang, with 8 replies.
Last reply by Kang, almost 7 years ago:
danpost wrote...
Kang wrote...
<< Codes Omitted >> These are the codes that I have copied. DId I make a mistake here?
Looks good. One thing I just noticed is that the size is set before you changed the width and height. Call: <Code Omitted>at the end of the new constructor. If you think "still not working", explain how.
Thank you so much : ) It is working perfectly now.
how to shoot
By jack_tolladay, with 1 reply.
Replied to by danpost, almost 7 years ago:
jack_tolladay wrote...
how do u make a character shoot
Vague (auto or user controlled, directions unknown, etc.) and without given attempted code.
Need Help rotating image made by an array
By SillyBilly, with 1 reply.
Replied to by danpost, almost 7 years ago:
Yes -- it would be difficult to rotate a group of actors as a unit without an object representing that unit. That is, it would be easier if you had a
Tetromino
class that consisted of the individual blocks (the
Block
class would be inside the
Tetrromino
class and a Tetromino object would create, and place its blocks into the world and then control the location and rotation of the unit as a whole).
How to access variables of subclass while calling the super
By Zweeg, with 1 reply.
Replied to by danpost, almost 7 years ago:
I cannot be sure without actually seeing the
FoodItem
class codes, but I have a feeling the array is not in the right class.
All images disappeared
By katenech, with 1 reply.
Replied to by danpost, almost 7 years ago:
katenech wrote...
Greenfoot 3.5.1 (or 3.5.3) Suddenly << URLs Omitted >> What happened?
Do you have default images assigned to your
Actor
subclasses? If so, you may need to show your codes. Start with
World
subclass and one
Actor
subclass whose image appears as a greenfoot icon.
gif image
By Dr.Dre, with 2 replies.
Last reply by danpost, almost 7 years ago:
Dr.Dre wrote...
ps. the problem is when I try to compile it, it says cannot find symbol- class GifImage
Remove line 3 (just not needed). Import the
GifImage
class into your project (use menubar:
Edit>>Import class...
).
Turn the object to 60 degrees if its rotation value is greater than its Y-coordinate else remove it from the world.
By I_am, with 1 reply.
Replied to by danpost, almost 7 years ago:
I_am wrote...
How do I do it Turn the object to 60 degrees if its rotation value is greater than its Y-coordinate else remove it from the world.
You basically have to write what you just wrote using proper syntax.
if else paired with isKeyDown() issues
By D_S, with 8 replies.
Last reply by danpost, almost 7 years ago:
D_S wrote...
that error was produced on a new project so the world code is totally blank. all i did was make a world with the space background so i had a place to put the blackhole. but otherwise i never even opened the editor for it.
Can you upload the basic world with source for review?
Error: non-static method cannot be referrenced from a static context
By PolarBear123, with 12 replies.
Last reply by PolarBear123, almost 7 years ago:
Thank you! that fixed my error.
NullPointerException when trying to get mouseX/Y
By Zestix, with 5 replies.
Last reply by Zestix, almost 7 years ago:
danpost wrote...
Zestix wrote...
I fixed it, it just seemed like the coordinates caused the error( I don't know why) and I should have given more background information to help you understand what I wanted to do.
I was not the coordinates. It was the
mouse
reference. If no mouse action occurs between one act and the next, no
MouseInfo
object is created and
getMouseInfo
will return a
null
value (which you cannot get coordinates from).
Ah thanks for explaining that to me
fsd
By susu123123321, with 2 replies.
Last reply by danpost, almost 7 years ago:
Don't hold it in -- let it out (let 'r rip).
Prevent overlap of objects
By Çðæyœn, with 1 reply.
Replied to by danpost, almost 7 years ago:
Override the
addedToWorld(World)
method to re-position a ball until not touching another: <Code Omitted>
Change World Image from inside the Actor
By xandreas_1, with 8 replies.
Last reply by xandreas_1, almost 7 years ago:
ah yes thx
displayImage.drawOval won't draw a completely full circle
By Abwatts, with 3 replies.
Last reply by danpost, almost 7 years ago:
Abwatts wrote...
It worked like a charm, thanks! Would you mind explaining why you did so, please?
When drawing a shape, using the rectangle given, (int x, int y, int width, int height), the shape will be (width+1, height+1) in size. When filling, it will be of size (width, height) -- (just the way it is).
206
207
208
209
210
211
212
X