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
Communicating actor to actor
By Harrypotamus, with 3 replies.
Last reply by Spock47, over 2 years ago:
If the order of creation of car and cannon can be either way (car before cannon OR cannon before car), still a similar solution like the one RcCookie presented can be used, that works in any case (any number of cars/cannons in the world): <Code Omitted>This will work for multiple cars in the world, too. It would work for multiple cannons
Scrolling World
By jdkdoen05, with 36 replies.
Last reply by danpost, over 2 years ago:
jdkdoen05 wrote...
Can you give me an example?
<Code Omitted>or just place the dimension required in the constructor call. For example: <Code Omitted>If dimensions given is larger than image, the image will be tiled onto the background.
Ending a programm
By jdkdoen05, with 44 replies.
Last reply by danpost, over 2 years ago:
jdkdoen05 wrote...
That doent works. It also stoped after 2 seconds.
So, no errors. Correct?
Variable for all worlds
By jdkdoen05, with 14 replies.
Last reply by danpost, almost 3 years ago:
jdkdoen05 wrote...
This code doesn't work for us. Maybe it's because we have a ScrollWorld (the one they helped me with in another discussion). Do you maybe have a suggestion for a solution?
You will need to show your current ending code and be specific and complete as to what you want to happen.
Help. How do i turn my actor with the right angle??
By Claudiu, with 1 reply.
Replied to by danpost, almost 3 years ago:
Claudiu wrote...
I want to turn my actor(ball) with the right angle, like when it hits the wall or the brick to turn with the same angle but in the opposite direction.. but i have to know the angle between the actor and the wall it hits
The reflecting angle is always 180 minus twice the normal to the (tangent at the point of) surface hit minus the current rotation of the ball. So, vertical walls, or hitting a rectangle on its side, (with horizontal normals) would be: <Code Omitted>Horizontal walls, or hitting a rectangle on top or bottom, (with vertic
Help! i get error from a line of code thats not even ran :c
By Aaron-aid, with 7 replies.
Last reply by danpost, almost 3 years ago:
Aaron-aid wrote...
I realize it looks confusing but the enemy spawner is used in multiple levels and thus needs to change and adapt to each use (its used on lv 2 & 5) and I feel like it would be better management to make the code more flexible and have more opportunity's to be used but I can try to convert each l that uses it to the world exclusively
Maybe you need an intermediate class between
World
and your level worlds. Then you can put the spawning code there and use the
instanceof
conditional to check which type level world it actually is.
IsTouching issue
By Claudiu, with 4 replies.
Last reply by Claudiu, almost 3 years ago:
Thanks. Can you help me again please? I want to turn my actor(ball) with the right angle, like when it hits the wall or the brick to turn with the same angle but in the opposite direction.. but i have to know the angle between the actor and the wall it hits
how do i use a variable from actor to a world
By dedsec, with 1 reply.
Replied to by danpost, almost 3 years ago:
dedsec wrote...
i need help figuring out how to get a variable froma an actor to 9 different worlds
What is the reason for the variable? What does it represent? Maybe you just have it in the wrong place.
Changing photo from another class
By NielsProgamer, with 13 replies.
Last reply by danpost, almost 3 years ago:
NielsProgamer wrote...
So if 2 class touches 3 class i want 1 class to change image. These are all different classes. In class 1 i can change it but i need a code for if 2 class touches 3 class.
That is exactly what the code given above does. Apple detects collision with banana, which in turn changes counter actor image.
The bullet hits multiple times
By jdkdoen05, with 2 replies.
Last reply by danpost, almost 3 years ago:
I believe line 40 should be outside the method.
Greenfoot(3.5.4) source code
By Roshan123, with 4 replies.
Last reply by Roshan123, almost 3 years ago:
Somehow I managed to download it by using an alternative way. Don't know why it still doesn't work on my device.
Error greenfoot.ActorRemovedFromWorld fix?
By asiwi, with 3 replies.
Last reply by AbdulrazaqAS, almost 3 years ago:
I just got the error and after trying the solution provided, it worked. Thank you.
GreenfootImage: Drawing Strings on JPGs vs. PNGs
By lehrerfreund, with 4 replies.
Last reply by lehrerfreund, almost 3 years ago:
danpost, you are right, I am using macOS. Have to try it on Windows. Thanks for you support!
Remove actor from world
By NielsProgamer, with 3 replies.
Last reply by NielsProgamer, almost 3 years ago:
Thanks! it works. Didnt think about that.
Checking if 2 Strings are equal
By Kwantum, with 3 replies.
Last reply by Kwantum, almost 3 years ago:
Ah, thanks. This helped me understand the problem and I managed to fix it!
38
39
40
41
42
43
44
X