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
Question about arrays
By Favna, with 15 replies.
Last reply by davmac, over 10 years ago:
Just to expound a bit more, changing the statement to avoid the 'new boolean' doesn't work for me; this workaround might be Java version dependent. A workaround that should work for all Java versions is to declare the field either public or private, eg: <Code Omitted>
Actor not in World Error. I don't know anymore.
By Cookiezero, with 1 reply.
Replied to by danpost, over 10 years ago:
This is the classic 'two methods that remove the actor' problem. If you have two methods that each can remove the actor (the bullet,, in your case) from the world (methods are 'disappear' and 'destroy'), then if one remove the object, the other one will throw either the IllegalStateException or a NullPointerException. This can be solved by testing if the actor is still in the world after the first method is called (checking the return of 'getWorld' for 'null').
GifImage error
By Dalvengyr, with 18 replies.
Last reply by Dalvengyr, over 10 years ago:
I will just share here when I have time. Thanks for helping!
Moving on the y-axis
By ZNAB, with 1 reply.
Replied to by ZNAB, over 10 years ago:
LOL! Never mind, I figured it out. I forgot to use the "setRotation" command. :-P
Get console size
By Kartoffelbrot, with no replies.
Hello guys, does anyone know, how to get the size of the console in Java? I know that you have this possibility in C# and it gives you the size in characters. Thanks for help.
Click on a actor and let it move by clicking
By exhibition, with 9 replies.
Last reply by danpost, over 10 years ago:
At least two things can cause missing the target destination (1) the limitation of rotation to int values and (2) the limitation of pixels on your screen. How fast your actor moves can limit direction because of (2). For example, at a speed of 1, you actor can only go at a multiple of 45 degrees to 8 possible locations at a time -- the pixels to either side, above or below and to the four nearest pixels along the diagonals. At a speed of 2, you cannot add more than 8 new possible directions to go in; so, the number of possible directions your actor can go is still quite limited. You can
<indentifier> expected
By dr_rabbit, with 3 replies.
Last reply by danpost, over 10 years ago:
Line 8 should be: <Code Omitted>with the round brackets after the class name.
Animating Seperate Character Parts
By meazalplaq, with 6 replies.
Last reply by meazalplaq, over 10 years ago:
Fantastic work!
Having trouble leveling up
By cnb8428, with 3 replies.
Last reply by danpost, over 10 years ago:
If the game will be beatable at level 9 then you will have to incorporate another way to exit the levels. Maybe just asking if no boids are in the world is enough. <Code Omitted>You could at that point then just increase the number of boids per level.
Select an object to move
By kevin2106, with 7 replies.
Last reply by sjoerdieman, over 10 years ago:
its fun to see other people asking stuff about the same school project ;)
unreachable statement int
By sjoerdieman, with 3 replies.
Last reply by sjoerdieman, over 10 years ago:
Thanks it worked!
Making objects move problem
By bigdaddyrooster2, with 4 replies.
Last reply by bigdaddyrooster2, over 10 years ago:
Thanks a million man, that fixes it.
Run a method from another object
By Alex1s, with 8 replies.
Last reply by danpost, over 10 years ago:
'getWorld' is a method of the World class, created long before you wrote your subclass of it. It can only return a World object (which can be from any subclass of World). It cannot return your world specifically as a 'RoboterWelt' world object; so, you must inform the compiler that it is indeed one so it knows to look in that class for the method.
Question!
By inkpenKingpin, with 2 replies.
Last reply by inkpenKingpin, over 10 years ago:
I made a method for each of them like you suggested "bCost" wCost" and "bValue" each as integers, bCost and bValue returned 1, and wCost returned 0. I'll cut out a piece of the code for an example. <Code Omitted> ^ Wall class
Still need help on 3d
By wabuilderman, with 3 replies.
Last reply by wabuilderman, over 10 years ago:
Oh, but yes, I do want to do raycast. This project is primarily for the learning experience, and just in general, trying to master the art of 3d rendering. I will probably copy my code and try doing it another way.
622
623
624
625
626
627
628
X