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
How do I make seperate controls for each object (player)
By Zweeg, with 1 reply.
Replied to by danpost, over 8 years ago:
What have you tried? Show the class code of your players.
How do I make an object keep track of which object number they are?
By Zweeg, with 1 reply.
Replied to by danpost, over 8 years ago:
What have you tried? Show your Gym class code.
Music
By Heet_Patel, with 10 replies.
Last reply by danpost, over 8 years ago:
Maybe you can take example from my
BgMusic Actor Class Demo
scenario, which you can run to view the code. It is also down-loadable.
Start Button
By Heet_Patel, with 1 reply.
Replied to by nolttr21, over 8 years ago:
in your Start_Button class you could write, <Code Omitted>
Make things come out!!
By Heet_Patel, with 3 replies.
Last reply by Heet_Patel, over 8 years ago:
dont bother
X & Y arrays
By Miguel.Valdez, with 4 replies.
Last reply by Miguel.Valdez, over 8 years ago:
I understand and agree with you 100 % Danpost. But what I'm being asked to do is. From the 2 arrays for X & Y position, use the array length as part of a while loop to populate 100 objects (ex: apple) using coordinates generated in from the arrays. I've been going crazy, making a Picasso painting on my whiteboard(from making examples of the code), but can't come up with anything :T
Does anybody have the greenfoot file for this Danpost scenario?
By maboidanpost, with 1 reply.
Replied to by danpost, over 8 years ago:
Just run the scenario and click the buttons along the bottom to view the codes.
Level Select
By student1, with 19 replies.
Last reply by danpost, over 8 years ago:
Yehuda wrote...
to change to a new world you should do "
Greenfoot
.setWorld" not "getWorld" (like you were wrongly told).
That must of been a senior moment when I posted this:
danpost wrote...
Change "Greenfoot" to "getWorld" on lines 7 and 12 (
getWorld
is a
World
object method -- not a
Greenfoot
class method).
I should not have included line 12 and neither line uses the getWorld method and that method is an Actor object method , not a World object method. It should have said:
Change "Greenfoot" to "getWorld" on lines 7 (
removeObject
is
having a bit of trouble with setvolume
By ohwooow, with 3 replies.
Last reply by danpost, over 8 years ago:
You still have issues (1) and (2). You only fixed (3).
Turn left, Move, Turn right - In a sequence
By Applez, with 11 replies.
Last reply by danpost, over 8 years ago:
Applez wrote...
please tell me the code to make the actor move upwards.
<Code Omitted>will move the actor upward by one pixel. You could also do something like this: <Code Omitted>
Removing an object when a value is met
By Yomi, with 3 replies.
Last reply by danpost, over 8 years ago:
Yomi wrote...
I think that 235 is getting the value of totalCount from the hp class and bringing it from the hp class into the Player_1_1 class and 236 is telling Player_1_1 if the totalCount is -1, that it should remove Player_1_1 from the world.
Actually, you should get a
method not found
error on line 235 as you are executing the method on "
this
" (a Player_1_1 object) by default, and there is no method called
getCount
in the
Player_1_1
class. Next, all line 26 is doing is declaring a new
Object
reference of type
Actor
called
Player
Clicking on an actor from another actor
By FarEalm, with 3 replies.
Last reply by FarEalm, over 8 years ago:
Thank you very much my code works as intended now. Thank you or all of the help.
problem with setting image on click
By TheGoldenProof, with 8 replies.
Last reply by TheGoldenProof, over 8 years ago:
Once again, it is not working. For whatever reason it mysteriously stopped working. I tried changing it to rightclick to flag a box and it still doesn't work. this is what I have:
nullPointerException when calling function that returns void
By TheGoldenProof, with 4 replies.
Last reply by TheGoldenProof, over 8 years ago:
It worked! Its funny how it really does just take a fresh pair of eyes sometimes. It's not like its a complicated solution, its just another simple way to attempt the same thing.
Text
By student1, with 17 replies.
Last reply by danpost, over 8 years ago:
student1 wrote...
sorry i'm really bad at this so i don't know even though i'm thinking about it a lot
HINT: basically, you always use the
new
keyword to create an object.
266
267
268
269
270
271
272
X