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
Add Actors through actor.
By NUKES, with 9 replies.
Last reply by NUKES, almost 3 years ago:
danpost wrote...
NUKES wrote...
But that does not do what I want it to do. I have a second actor which is "ball2". 2 of those should be added when bullet touches the actor "Ball". You mentioned using the split method in ball class but the above mentioned split code just creates millions of balls right when I click run.
Sorry. I should have stated that the
split
method should be as
Hippo
wrote it above. Adjust it to create
ball2
objects as required. If still getting millions of
ball2
objects, post entire class codes for review.
I was able to make
Moving World
By PetrusderEchte, with 1 reply.
Replied to by danpost, almost 3 years ago:
PetrusderEchte wrote...
My game has a big world. The image goes to the right and left. But when i place my testperson und you walk in one direction, he moves out the image. So my question is, is it possible that the world moves with the charakter?
Please refer to my
Scrolling Tutorial
scenario, which refers to a class that is demonstrated in my
Scroller Class Demos
scenario.
Act() cycles per minute
By m.legere1323, with 2 replies.
Last reply by m.legere1323, almost 3 years ago:
Thank you! =)
I have been trying to figure out how to do something like ray casting but I ran into a problem
By Triangluminati, with no replies.
For starters I just started learning to code about 4 or 5 months ago for my school so I'm sorry if I get terminology or something wrong. I have been trying to learn how to code ray casting in Greenfoot so I can apply it to the project I have been working on. I have been following a tutorial somewhat (https://sinepost.wordpress.com/2012/06/16/raycasting/) but I have been trying to come up with my own solutions in areas. I have gotten a useable, but not very playable, version of ray casting to work but the rays have to travel far enough that once they reach an object, the distance between them is so large and the result comes out very blocky/chunky. My main question is if there is a way to shoot out more rays to make the objects appear more smooth or if there is a different approach to reach the same effect. I will add my code here for my player:<Code Omitted>and I will add my world code <Code Omitted>
how do I set an actors rotation to another actors rotation?
By ThatsCrispy, with 2 replies.
Last reply by danpost, almost 3 years ago:
Where is the method
drawMaze
(in the
Corridor
class) called from? Show code block.
how do I make it so I only shoot 1 bullet when space is pressed?
By NUKES, with 2 replies.
Last reply by NUKES, almost 3 years ago:
works perfectly, thank you very much!
Object does not get removed when at Edge.
By NUKES, with 2 replies.
Last reply by NUKES, almost 3 years ago:
danpost wrote...
NUKES wrote...
This might just be a stupid mistake by me, but I cant for the love of god figure out why it does not work. In the following code, I made it so, if my "Bullet" object, touches either the Edge or the "Ball" class, it should get removed, but for some reason it just stays?
Is the
remove
method being called from anywhere? If so, from where? If not, then why not?
As I thought im just Stupid lol. I had to call the remove method. works now, thanks.
Lamda expression and double colon operator
By Roshan123, with 5 replies.
Last reply by RcCookie, almost 3 years ago:
Roshan123 wrote...
Thanks a lot to both of you @RcCookie can it be also written as <Code Omitted> ?
No, because Button is not the interface with one method. But you could write <Code Omitted>
laser collision detection not removing the laser when a hit is detected
By roonie01, with 1 reply.
Replied to by Spock47, almost 3 years ago:
Can some one plz give me code to make a score counter according to how much seconds the actor is alive
By apcode, with 1 reply.
Replied to by danpost, almost 3 years ago:
apcode wrote...
make a score counter according to how much seconds the actor is alive
In class of actor: <Code Omitted>
WHY WONT BY WORLD BUILD
By Damste22, with 1 reply.
Replied to by danpost, almost 3 years ago:
Damste22 wrote...
the program's not creating my world
<Code Omitted>and <Code Omitted>The iterators,
i
, remain at zero (no increments given). So, it is stuck in a loop.
World
object never completes initializing. In fact,
Key
objects are created for the first white key multiple times, repeatedly, until memory runs out, whereby you will get a
OutOfMemoryException
.
cant get the zombie boss lives to go down
By Soop__, with 2 replies.
Last reply by Soop__, almost 3 years ago:
hi danpost finally got it working thanks for the help :)
Screen change
By tomzz, with 4 replies.
Last reply by danpost, almost 3 years ago:
tomzz wrote...
But do you know a way I can add a world on a world? Like a little screen on my current World?
Two ways to do that (at least). One is to create a world whose background mimics the real world, like in a paused state. It is not a world in a world, but it could be made to appear as such. Another way, which does not involve another world altogether, is to just use an actor for the "little screen". Just have all operations suspended while that actor is in the world. For further details, just ask.
Screen
By tomzz, with no replies.
Also, how can I add a screen to my world? So I was doing a chess game. Whenever the pawn reaches the end I wanted a little screen to appear. How do I do that? Please Help.
Greenfoot.mouseclicked doesn't reacts after a click
By stefco05, with 4 replies.
Last reply by stefco05, almost 3 years ago:
Thank you! I’ll try it later.
40
41
42
43
44
45
46
X