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
Can not find symbol - error message
By sanjayrajure, with 1 reply.
Replied to by danpost, over 6 years ago:
sanjayrajure wrote...
I am getting this error message while trying to run sample code from tutorials. <Image Omitted>
Cannot help without seeing the codes producing the error.
Find out if an integer has been defined
By Starlord_20, with 3 replies.
Last reply by danpost, over 6 years ago:
No worries. Your line 2 declares it as the primitive type,
int
, which automatically, by default, is assigned a value of zero. Side note: had you declared it as type
Integer
(which is an object reference type), only then would its default value be
null
,.
2D Aimbot
By Voly007, with no replies.
Ich würde gerne für mein Spiel eine künstliche Intelligenz einbauen, die den Spieler abschießt. Die Waffen und Spieler sind bereits im Spiel implementiert. Jedoch weiß ich nicht wie man ein 2D Aimbot programmiert. Hilfe wäre wirklich super! Danke I would like to incorporate artificial intelligence into my game that shoots the player down. The weapons and players are already implemented in the game. However, I don't know how to program a 2D aimbot. Help would be really great! Thank you
Ping Pong Game
By _kr_696, with 2 replies.
Last reply by _kr_696, over 6 years ago:
I've only made the bats and the ball. I have the ball moving and I can move the bats with the keyboard.
Need Help with Arrays
By samnan22, with 3 replies.
Last reply by samnan22, over 6 years ago:
never mind, i got it!
reset except counter of the highscore
By realsaifalrawie, with 2 replies.
Last reply by realsaifalrawie, over 6 years ago:
ok thank you
How do i make one specific actor follow my mouse?
By Yuuki, with 10 replies.
Last reply by danpost, over 6 years ago:
Yuuki wrote...
What does constructor mean?
It is the block of code that is executed when you create a new instance of a class (a new object). The block looks similar to a method, but it does not have a return type given (nothing where "
void
" usually is) and its name is the same as the class. Your World subclass constructor starts with: <Code Omitted>My Fish class constructor above will execute when <Code Omitted>is found in your codee. Constructors automatically return the new object created. So, you would either assign the new object to a variab
Making a Counter
By mattstg, with 6 replies.
Last reply by mattstg, over 6 years ago:
danpost wrote...
danpost wrote...
Add a boolean to track touching the line and use it to regulate the scoring.
mattstg wrote...
How would I do that? Sorry I am a beginner
Perform checking car crossing line in your Car class (remove the checking from FinishLine class): <Code Omitted>
Thank you so much!
Adding a changing Scoreboard
By Carbon_Raven, with 2 replies.
Last reply by danpost, over 6 years ago:
In
changeScore
, create a text
GreenfootImage
object and set it to the image of the
Score
actor.
BB-Tan
By phipsi21, with 2 replies.
Last reply by Super_Hippo, over 6 years ago:
I once thought of creating a copy of it here but never did. But go ahead. You can do it. :)
How do I remove one object from the world?
By Bourgeoisie_Bird, with 8 replies.
Last reply by Bourgeoisie_Bird, over 6 years ago:
Hi, I think I might have come up with a solution but I'm having difficulty implementing it into code. I want to assign a value to the customer when it is added to the world increasing the assigned value by one every time a new customer is added. I also want to do the same for the drink. so if the customer with the assigned value of 1 intersects with a drink with assigned number 1 the assigned values go down by one and remove the intersecting drink .customer2 would become customer1 and drink2 would become drink1. If customer1 assigned value was zero it will ignore other drinks that interse
How to add multiple instances with animations coming from the both sides of the screeen
By Adrian26, with 1 reply.
Replied to by danpost, over 6 years ago:
Will need to see World subclass and Bat class codes.
How to add gravity when you only jump
By SPIDERVERSEE, with 1 reply.
Replied to by danpost, over 6 years ago:
SPIDERVERSEE wrote...
Do you guys know how to code gravity so that, it will only be in use when you actually jump? And that it will fall to the place where you jumped? I made a game like crossy road, but I don't know how to code the jump.
Instead of
getKey
, use
isKeyDown
with a
boolean
field to track the state of the "space" key. That way, you can regulate it so that the key is released between each jump.
what is wrong with my code
By SanjiNaha, with 4 replies.
Last reply by SanjiNaha, over 6 years ago:
i have already solved the problem thank you so much though
Dark mode ?
By uniqe1, with 1 reply.
Replied to by SanjiNaha, over 6 years ago:
no
149
150
151
152
153
154
155
X