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
Steam Group
By JetLennit, with 16 replies.
Last reply by JetLennit, almost 10 years ago:
Anyone else interested?
How to get an OK Button?
By Rudolf, with 12 replies.
Last reply by danpost, almost 10 years ago:
Maybe the last method in
this example
might help.
Error..
By mcGreen, with 18 replies.
Last reply by mcGreen, almost 10 years ago:
The problem is that the boolean "onGround" is false for one or two act-cycles while walking. I dont know why it is and if you do not either its not really that important. You really helped me here danpost
Using Y position values from other classes
By qwakery, with 8 replies.
Last reply by Super_Hippo, almost 10 years ago:
Actually, it is useless to use them as two classes since you can decide in the constructor, which color it should be and in which team he is. So something like <Code Omitted>Or use int instead of boolean if you may want to use more teams later. Add a Counter to the world like this then. <Code Omitted> To jump, you can orientate on this code. (not tested, coul
Rain drop game, removing objects that fall to the ground
By Akimb, with 17 replies.
Last reply by Akimb, almost 10 years ago:
Works now, thanks. :)
Strange lag?
By Unicus, with 7 replies.
Last reply by Unicus, almost 10 years ago:
The lag is gone now; If I change the code to the second one, it keeps removing and adding the object gameover, so I guess I'll leave it as it is. It no longer fills my memory, so it's ok. I just published the game (beta version still), so if you want to take a look, you can find it here:
http://www.greenfoot.org/scenarios/11355
adding a shield
By davemib123, with 31 replies.
Last reply by GamesGrinder1998, almost 10 years ago:
vonmeth wrote...
Add checks for that boolean. If that boolean is true, don't let certain things happen (like take a hit). For example to make it so enemy fire doesn't harm your Hero. First make your boolean shieldActive static.
Can't get powerup to appear on screen
By GamesGrinder1998, with 34 replies.
Last reply by GamesGrinder1998, almost 10 years ago:
danpost wrote...
GamesGrinder1998 wrote...
danpost wrote...
With a 'lifespan' of 400, maybe about 7 to 8 seconds, if your scenario is running at normal speeds (about midway on the speed slider).
ok, if i want to implement a shield powerup, can i just use setImage a new image if a fireball collects it and then the shield starfighter can just eat the enemies bullet, if so, what could the code look like
It would make more sense to have a separate actor for the shield. The starfighter object should have a field to reference it when it is active (null when not). If the collision code
Wondering about efficiency.
By avatarcolin, with 4 replies.
Last reply by avatarcolin, almost 10 years ago:
Oh! Thanks, didn't realize it was.
Having some problems with removeObject.
By Than4tos, with 8 replies.
Last reply by Than4tos, almost 10 years ago:
Thank's alot m8
seems to be working as i wanted it.
Background music for multiple levels
By Rubric94, with 7 replies.
Last reply by Rubric94, almost 10 years ago:
problem with file itself, will fix
exercise 6.1
By Jaimie, with 11 replies.
Last reply by danpost, almost 10 years ago:
You will probably need to use 'new java.util.Vector(2.2, 3.1)' (if you are using the java.util.Vector class); or, 'new Vector(2.2, 3.1)' if you are using your own Vector class.
Can I have some help explaining this?
By 327458, with 1 reply.
Replied to by danpost, almost 10 years ago:
Let us break it down: We are using a for loop to iterates through a collection of object. This collection is created by calling 'getWorld().getObjects(Pins.class)'. 'getWorld()' (Actor class method) returns the world that the actor, referred to by 'this', is in. 'getObjects' (World class method) returns a list of objects of the specified class (Pins.class) Each iteration will set 'obj' to a different Pins object that is in the world. The 'obj' variable holds a reference to an Object type object. '(Pins) obj' on line 3 casts the referenced object as a type of Pins object. It is then ass
Help with mouse info
By bizzard, with 16 replies.
Last reply by danpost, almost 10 years ago:
'ba.ll.getImage().getWidth()'. Outside the Ball class, 'ball' will have to be assigned a Ball object; inside the ball class, you can just drop the 'ball.' part.
power ups?
By programmer22, with 127 replies.
Last reply by GamesGrinder1998, almost 10 years ago:
danpost wrote...
Which class of Actor is this enemy that isn't respawning in the players 1 box ? and, is it not spawning at all or spawning in the players 2 box?
it's spawning in the players 2 box when my starfighter 2 shoots an enemy but when my starfighter1 shoots it, it doesn't respawn
683
684
685
686
687
688
689
X