Sign Up, Lost Password
You need to login to take part
By Magzlum, with 12 replies.
Last reply by danpost, about 5 hours ago:
https://www.greenfoot.org/scenarios/31564 this is my game in case you didnt understand what it looked like, and what i have so pls give me some things i can put in my game and a better ice code
Cannot better codes unseen. It would help if you uploaded your scenario again (update it), but with the
Publish source code
check box checked.
Delay a method on a single actor
By FALAFFI, with 1 reply.
Replied to by danpost, about 5 hours ago:
im trying to delay a method on a actor so the actor should walk over a route but not to quickly can someone help me with developing a delay that is like 500 milli seconds long but only goes delays the next action this is the code: << Code Omitted >> this is a part of the code in reality its much longer but how do I program now a delay that makes him delay before the next action?
I think you misunderstand the way greenfoot works. The
method is being called by greenfoot repeatedly at a regular rate (usually around 50 to 60 times a second). The rate has a "
How to draw integers
By Deepfist, with 1 reply.
Replied to by danpost, 3 days ago:
I have a player actor who has multiple integer values, such as the amount of medkits, the amount of multishots left, the amount of bullets left in a specific magazine, the remaining speedUp time and the score. These integers work fine, but I am not sure how to show them on screen with their right amount. These integers are in the player.class, but their values are changed by different actors; so when you pick up a medkit then the medkit.class will add 1 medkit to the count, not the player.class itself (this is done with a getOneIntersectingObject code, not sure if that's import
How to Make Drawing Game
By MyProject, with 1 reply.
Replied to by danpost, 3 days ago:
Can we make a drawing application with greenfoot? For Example, if we want to make a program to draw letters of the alphabet for students. If it's possible, please show me how the algorithm is?
Of course, it is possible. However, what you need to do is attempt to do it yourself. Then, if you have issues, post what you had tried and explain how it is not what you want. Since you will be dealing with images, you should familiarize yourself with the
class. Look over what constructors and methods are provided in the class.
Changing the order of subclasses of World (or Actor)
By doctorbeep, with 1 reply.
Replied to by Deepfist, 3 days ago:
I am not sure if there is an option for choosing the order, but I do (kinda) know how the order is decided It depends on the word/character. If you have a subclass that starts with an A and a subclass that starts with a B, then the A will be the top one. If you have a subclass that starts with an a and a sublclass that starts with a B, then the B will be the top one. Not sure why but it's like that. If you have Level 1 and Level 2, then the top one should be Level 1, unless your Level 1 starts with a small L, then it will be Level 2 Say you have Level Start and Level end, then Level End
Help with game
By Lilia, with 10 replies.
Last reply by Lilia, 8 days ago:
YAY! I just figured it out myself! Thank you very much for your help though @danpost; you really made my day. Without you, i probably would have really panicked very hard!
Interaction between 2 characters and spawning a new one
By vachiotis, with 1 reply.
Replied to by danpost, 14 days ago:
I have a program where I want a character, lets say a male fish, interacts with a female fish and I want them to spawn another fish (either male or female, it doesnt really matter). I am new to programming and I can't find a solution to this problem. Can I get some help?
objects have a "
" state, you should have a variable for male/female: <Code Omitted>Let's say that male =
and female =
. Now, you can add the following to the
help with if statement
By Psg1223, with 4 replies.
Last reply by danpost, 16 days ago:
it returns as getobjects is always equaling zero and never changes the string variable
It does set a
" -- just not the one you think it should. Line 35 declares a new variable called
which is not the variable you declared on line 10. Remove the "
" from line 35 so the one on line 10 gets set.
By r0b75hg7, with 2 replies.
Last reply by r0b75hg7, 17 days ago:
Thanks, I got it.
Pollinating Bees Lab
By r0b75hg7, with 1 reply.
Replied to by r0b75hg7, 17 days ago:
Trying to get the physics in my platformer right
By Nextonic, with 17 replies.
Last reply by danpost, 17 days ago:
Looks something like this java.lang.RuntimeException: The gif file "images/RunRight.gif" doesn't exist.
Double check the file name and suffix. All characters must be in the proper upper/lower case.
trying to get radio button in java to work
By divinity, with 15 replies.
Last reply by danpost, 22 days ago:
I see the error and put in the curly (}) that I had miss out but now am getting another error << Code Omitted >>
Looks like you are trying to treat the
object as a
object, which, as coded, it is not.
Enemy wave system
By Deepfist, with 2 replies.
Last reply by Deepfist, 22 days ago:
The code is amazing, my DelayTimer is a bit different however. Nonetheless it's still wonderful and it has helped a lot (was stuck on this for a while). Thx a lot :D
Programing an endless route with 2 gifImages
By Ururu, with 7 replies.
Last reply by danpost, 23 days ago:
thats right. I managed to simplify it based on whats within my knowledge and it works now :)
Please provide what you simplified it to.
Moving an actor towards another without rotating
By VOiDBABY, with 1 reply.
Replied to by danpost, 29 days ago:
I'm creating a 2D game in which enemies on the right side chase after the player on the left side. I was wondering if there's another way for the enemies to chase after the player as they move without rotating as it flips the images (has animations) upside down and backwards. I'd appreciate any suggestions or feedback! Here's my current code: << Code Omitted >>
Just reset the rotation back to zero after moving: <Code Omitted>