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
Hit method assitance
By StoveAteMe, with 6 replies.
Last reply by StoveAteMe, over 10 years ago:
Oh okay, the issue was your second suggestion, it's working as I want now. Thanks for your help!
Animated pictures
By The_Shados, with 1 reply.
Replied to by danpost, over 10 years ago:
The_Shados wrote...
Is it possible to use animated pictures in greenfoot.
The extend of which animation is possible in greenfoot is demonstrated in my
Animation Suport Class
scenario. Of course, the images in my demo were created within the demo, but you can use any set of images to create an animation.
sound keeps playing wont stop
By Solidchainss, with 1 reply.
Replied to by danpost, over 10 years ago:
On line 33, you are creating a new GreenfootSound instance of the same song. This is not the instance that is already playing -- so stopping it will not stop the sound from playing. You need to keep a reference of the one that is playing and stop it: <Code Omitted>Removing the preceding 'GreenfootSound' from line 23 allows 'sound' to refer to the instance field instead of creating a local variable with th
Snake type game
By IL3107, with 1 reply.
Replied to by danpost, over 10 years ago:
IL3107 wrote...
I'm trying to create a snake-type game but I can't work out how to make a new spot appear when the first one is eaten (I am very bad at coding, sorry).
Instead of removing the first dot, just relocate it.
Prevent Collision With Transparent Object
By SnapDraggen, with 1 reply.
Replied to by danpost, over 10 years ago:
I would suggest using what is called perfect pixel collision, which checks the color of the map. I do not know if this is possible with your scenario and it is quite elaborate and CPU time consuming. Better might be to add transparent Intersection objects that tell the actors which directions are available at its location. One at each possible turn location is all that is required.
I need to make a speedometer
By AngelusNeko13, with 3 replies.
Last reply by AngelusNeko13, over 10 years ago:
okay, thanks ill see what i can do
Switching images
By RedBird420, with 2 replies.
Last reply by RedBird420, over 10 years ago:
I'll try it out. Thanks! I
Sound not playing?
By xlRenn, with 1 reply.
Replied to by danpost, over 10 years ago:
There does not appear to be anything wrong with the code. Do other sounds work? have you checked your sound setting (volume and mute)?
How to access a variable of another Object if more than one Object exists
By Cheiron3000, with 3 replies.
Last reply by danpost, over 10 years ago:
Cheiron3000 wrote...
Thanks danpost, now it works. But I had do put a "(Bullet)" before the getOneIntersectingObject method to ajust the types;P
Apparently, I missed that -- sorry. Good job fixing it, however.
mouseClick function
By GreenMan15, with 8 replies.
Last reply by GreenMan15, over 10 years ago:
After hours of trying to figure this out, I finally understand what to do. I did what you said and use two buttons one for high volume and one for low volume and it works perfectly. Thanks a bunch and Cheers!
why is skipping the whole of the first round
By divinity, with 11 replies.
Last reply by danpost, over 10 years ago:
You should probably get the random numbers for the problem before the for loop where the user attempts to answer it.
Health for Actors
By bintin125, with 1 reply.
Replied to by danpost, over 10 years ago:
All you need is an instance int field for the number of hits required to kill the actor. Lower its value each time the actor is hit. When the value is lowered to the value of zero, remove the actor. If the enemy is not removed when touching the actor, you will need to track the touching state to determine when the touch occurs (as opposed to knowing if it is currently touching or not). This is so that you are not be constantly decrementing the value of health while the same occurrence of the touch continues.
Help With an Error?
By nathanathan, with 14 replies.
Last reply by danpost, over 10 years ago:
I forgot to mention, setting 'vSpeed' to zero should be done when found on ground (in the 'onGround' method); and for falling, use something like this: <Code Omitted>
Help with some programming
By madarnt, with 6 replies.
Last reply by danpost, over 10 years ago:
The boolean is to track the state of the "e" key -- so you can detect when it is initially pressed or released: <Code Omitted>
How to Check Very Specific Collision for Platformer
By Geotan, with 7 replies.
Last reply by danpost, over 10 years ago:
Geotan wrote...
Thanks for pointing that out. Luckily in this game the pictures are just squares, but I may make something using this code later.
Later, you may end up improving the code even more. To see my way of creating a jump-n-run type movement, check out my
Jump and Run Demo w/Moving Platform
scenario.
476
477
478
479
480
481
482
X