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
flip verticle?
By jbiser361, with 7 replies.
Last reply by danpost, over 6 years ago:
jbiser361 wrote...
<< Code Omitted >> tried that
If you are flipping vertically, then the x value should not change -- just the y's need swapped. Also, your bottom-up values are wrong. The coordinate of the maximum height is one less than the given height. Nonetheless, it would be easier to create a new image of the same size as that which you want to "flip" and do a standard nested loop:
Level 1 problem
By R0b1n, with 2 replies.
Last reply by R0b1n, over 6 years ago:
thank you :D
Can't Open Greenfoot Projects
By MrMinestrone, with 6 replies.
Last reply by MrMinestrone, over 6 years ago:
Super_Hippo wrote...
While Greenfoot is not running, open the project.greenfoot file of your project with a text editor and find the lines with
xPosition
and
yPosition
at the bottom. Remove those lines or set the variables to 0.
It worked! Thank you so much.
Back and forth loop for countdowns
By Notted, with 12 replies.
Last reply by Super_Hippo, over 6 years ago:
I think you should add the bullet in the elseif-block and not in the if-block. There is also no reason to have lines 3-5 executed when they are not needed.
Can't delete projectile when hitting Bricks
By Ni3ls, with 1 reply.
Replied to by danpost, over 6 years ago:
Ni3ls wrote...
I have a projectile Class Bullet, which should be deleted when it hits anything. I also have a wall that can't be passed through by any object using setLocation(int x, int y) << Code Omitted >> I want to delete the bullet when it "hits" the Bricks, but the Bullet never hits the bricks due to the code above.
Then change what the code above does when a
Brick
object is hit.
I have already tried putting this in my Bricks Class, but it didn't work << Code Omitted >> And I have also tried putting this in Bullet Class, but this didn't work either << Code Omi
Need help setting image in act()
By Game4Lols, with 2 replies.
Last reply by Game4Lols, over 6 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, over 6 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, over 6 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, over 6 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, over 6 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, over 6 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, over 6 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, over 6 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, over 6 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, over 6 years ago:
Thank you! that fixed my error.
205
206
207
208
209
210
211
X