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 to make bullets stop when ammo is 0
By Alex20, with 1 reply.
Replied to by danpost, about 4 years ago:
You not only need to stop when no ammo is available, but you also must only fire when the key is initially pressed (not supposed to fire continually while the key is in the down state -- aka "pressed"). Therefore, you need to track the state of the key so that you can determine when its state actually changes. You will need a boolean field to retain the current state of the firing key:
how do ik make the timer work?
By Jip_maris, with 6 replies.
Last reply by danpost, about 4 years ago:
Jip_maris wrote...
how can i stop the actor from jumping without touching the solid ground?
First check if touching ground. Then only jump if touching ground. The order that I prefer to do things is: (1) fall (move vertically regardless of objects); (2) collision check (is it touching anything it should not or, possibly, is it at the bottom of the window); Note: if vertical speed is positive (in downward direction) and a collision with platform or ground occurs, then the on-ground state is
true
. (*) upon collision, adjust vertical position of actor so that the two a
how do i start and stop a backgroundsong?
By Jip_maris, with 1 reply.
Replied to by danpost, about 4 years ago:
You
would use: <Code Omitted>These methods and more can be found
here
.
why do my scenarios crash the browser
By BOTchad, with 3 replies.
Last reply by RcCookie, about 4 years ago:
"Space Game" does work for me, maybe you are using an outdated browser?
java heap error
By Aaron-aid, with 7 replies.
Last reply by Aaron-aid, about 4 years ago:
RcCookie wrote...
Another thing to always do with images (and gifs even more, even more memory expensive) is to only load them once and store them in a static variable. That way you can use as often as you want, but only ever load a single instance
this would help a ton, the only yhing is i dont know how to do that, could u show me?
Incompatible types: greenfoot.actor cannot be converted into boolean.
By 200263, with 1 reply.
Replied to by AbdulrazaqAS, about 4 years ago:
It should be <Code Omitted>As in line 24
getLifeCounter undeclared even though I have a actor called LifeCounter
By 200263, with 4 replies.
Last reply by Spock47, about 4 years ago:
Well, if the getLifeCounter method is in the MyWorld class, you need to call it on a MyWorld object, e.g. <Code Omitted>
run Problem
By Omar6489, with 1 reply.
Replied to by Super_Hippo, about 4 years ago:
Show your code.
timer doesnt change value
By Aaron-aid, with 3 replies.
Last reply by Aaron-aid, about 4 years ago:
nah i figured it out, it ran i just forgot to add the bullet to the world
Animation freezes on last image
By SlayGirlSlay, with 6 replies.
Last reply by SlayGirlSlay, about 4 years ago:
No worries!
Need help with a "Greenfoot.MouseClicked" code
By Puffshroom, with 1 reply.
Replied to by Puffshroom, about 4 years ago:
Nevermind, I fixed it by putting the code in the world, not create a seperate actor for it.
Greenfoot Actors not touch each other?
By TimQ1704, with 4 replies.
Last reply by AbdulrazaqAS, about 4 years ago:
some corrections
simulation covid
By beghalia97, with no replies.
l'ai besion un expmle pour simuler les épidemie de covid
using TrueTypeFont for GreenfootImage
By SammyFORreal, with 1 reply.
Replied to by SammyFORreal, about 4 years ago:
Okay I found the solution by myself. By creating a new GreenfootFont, it just stores a java.awt.Font inside, which is private. So by simply doin' Reflections stuff, I'm able to load a font from a .TTF file.
(Can't be .OTF!)
Collision
By Davidson, with 2 replies.
Last reply by Davidson, about 4 years ago:
Thank you
42
43
44
45
46
47
48
X