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
Help with my game....
By virginia001, with 3 replies.
Last reply by danpost, over 10 years ago:
Basically, you want to hold the change in location in local fields (so you can negate the move if necessary), make the move, check for intersections, and move back if intersector(s) are present. As an alternative, you could save the location of the actor, move, and reset to saved location if intersector(s) present.
Increasing another class' interger in another class
By JasonZhu, with 16 replies.
Last reply by danpost, over 10 years ago:
JasonZhu wrote...
I have trouble with the Rocket portion of the code
Without more to go on, it would be difficult to help you.
Small Problem
By csr1010, with 2 replies.
Last reply by GreenHouse, over 10 years ago:
<Code Omitted> is useless; because 'this' can not be null. You want to check whether the object still exists in the world, right? So use instead: <Code Omitted>
Error message keeps coming up
By Affan, with 2 replies.
Last reply by Affan, over 10 years ago:
Gevater_Tod4711 wrote...
When your object touches the worlds edge it get's removed. After that you execute the can see method. To execute this method your object needs to be in the world to check whether your object is touching the asteroid. So you get the error message. You could try adding a return statement after line 5 or just check whether the object is still in the world (if (getWorld() != null) before executing the canSee method.
Thanks for that. It solved my problem, clear explaination. If there was some kind of karma system I would give you some.
How to make a class the criteria for a method?
By Affan, with 1 reply.
Replied to by bourne, over 10 years ago:
First, getObjects returns a List which cannot be assigned to the variable actor of type Actor. Second, are you wanting something like this? : <Code Omitted>
getOneObjectAtOffset not working?
By VincentG, with 3 replies.
Last reply by VincentG, over 10 years ago:
I figured out what was happening, I miss understood getOneObjectAtOffset method. Thanks for the reply too :)
Steady image
By Chaveron, with 15 replies.
Last reply by Chaveron, over 10 years ago:
Yea sorry, I forgot that part. public void setLocation(int x, int y) { int width = getWorld().getWidth(); int height = getWorld().getHeight(); while (x >= width) { x -= width; } while (x < 0) { x += width; } while (y >= height) { y -= height; } while (y < 0) { y += height; } super.setLocation(x, y); } But I found my problem already. I just
change the order of acting objects
By Jtlie, with 1 reply.
Replied to by danpost, over 10 years ago:
You would have to link the pairs so that one 'knows' about the other. By their x locations and the direction of user input, you can determine which to move first. Move both at the same time (do not have both moved individually by their own act method calls).
zombie game
By jubyfollower, with no replies.
so ive plugged in a health for my player and i seems to work decently but when the zombie hits the player the health does not seem to go down? any ideas
Limit the movement of an actor
By Aaron91, with 1 reply.
Replied to by danpost, over 10 years ago:
This is just a matter of doing what you want: if the value of the coordinate is below the lower limit, set it to that lower limit; and, if the value of the coordinate is above the upper limit, set it to that upper limit
Cannot find symbol - method getWidth()
By shern91, with 14 replies.
Last reply by danpost, over 10 years ago:
You should probably review the Actor class documentation (double click on the 'Actor' icon) or use
this link
. See what methods are available to use in your Actor subclasses (besides those you may write yourself). Make use of them to get other objects you may want to run methods on.
Need help with GetObjectsInRange
By Rickboy26, with no replies.
So i got a Hero Actor (Garp), And a enemy (Gnomus) How can i let Gnomus follow garp trough the map? i got this <Code Omitted>
My for loops are ignored
By Vacrin, with 3 replies.
Last reply by Vacrin, over 10 years ago:
Thanks!
Problem with enemy
By Nooyi, with 3 replies.
Last reply by danpost, over 10 years ago:
The method you provided will return the correct boolean value. Your problem is elsewhere. You may have to show the entire class for help.
How to control external device?
By Yogibaer, with no replies.
Inspired by the scenario "pico board" within the documentation site I started a scenario to control the K8055D-Board of Velleman. The board is connected via USB and comes with a fully documentated .dll-file. The concerned uploaded scenario is "GF KD8055". The critical lines are put to comment in the moment. If they are activated it happens that: during compiling it says: no syntax errors; but it doesn`t come to an end and the word "Panel" doesn`t come. Due to this behavior the scenario can not be started. Hi, Michael Berry, or others please help kind regards Yogibear
743
744
745
746
747
748
749
X