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
Help needed car simulator
By Luisam21, with 2 replies.
Last reply by Luisam21, over 1 year ago:
danpost wrote...
Luisam21 wrote...
Hello, can someone help me? I am programming a simple car simulator and want the user to put in the destination and depending on where the destination is I want a object (little flag) to appear on The map but I doesn’t appear,’. ( Destination is the class of the flag) << Code Omitted >>
The input value might be the same as the literal string given; however, it is not the same object (two different strings containing similar character string sets). To compare the two, use: <Code Omitted>
Thank you so much! It
cant jump while holding two buttons
By Mauckenweg, with 2 replies.
Last reply by danpost, over 1 year ago:
Mauckenweg wrote...
In my jumpnrun you can use a/d to move and m to sprint. this works fine but i cant jump (space) while sprinting. is it possible to fix this?
It is not possible to jump at all without any code for jumping.
Issues with transfering values of counters
By Kolala, with 16 replies.
Last reply by danpost, over 1 year ago:
Kolala wrote...
Is there a way tho how I can change the counters image depending on the world?
It might be best to have the
Menu
world change the
Counter
object image explicitly.
Question about Minesweeper
By katenech, with 4 replies.
Last reply by katenech, over 1 year ago:
" is not good programming" - I agree with you :) It was... for simplicity)) Thank you for explanation
I'm having trouble with using two separate counters.
By Wish10940, with 5 replies.
Last reply by danpost, over 1 year ago:
Wish10940 wrote...
I've got this error after touching the hive << Error Trace Omitted >> it says it's a problem with the line bg.getPollen().stored += bg.getCounter().pollen;
Either the bee is being removed from the world before the
act
method calls this
empty
method or one of your world methods (
getPollen
or
getCounter
) is not returning a counter object.
Delay a method on a single actor
By FALAFFI, with 2 replies.
Last reply by FALAFFI, over 1 year ago:
thank you
My hp isn't decreasing in subsequent order ;-;
By Bee, with 4 replies.
Last reply by Bee, over 1 year ago:
Thank you so much!
How do i stop my Mario from jumping to high?
By Ima_pan_cake, with 1 reply.
Replied to by danpost, over 1 year ago:
Ima_pan_cake wrote...
<< Code Omitted >> It does work when you press space to jump but when you hold space he wont stop until you let go. How do i stop this?
You need to add another condition to jump -- mainly, is the actor standing on the ground (or on top of an object). Easiest way to check this is to apply gravity and fall first; then, check for obstacles. If the vertical speed is positive and an obstacle is found, than the on ground state is met and you can then check for the jump key. My
Jump and Run Demo w/Moving Platform
i
Image doesn't switch
By Hitsheep, with 2 replies.
Last reply by Hitsheep, over 1 year ago:
danpost wrote...
Hitsheep wrote...
I'm trying to make a bar that switches to 3 other images as time goes while the button C is held down. However, the image doesn't switch. Can someone explain what went wrong? << Code Omitted >>
Using a
SimpleTimer
is making things more difficult than they need to be. You can just count act steps to time the
fishingBar
:
Unable to add object to world
By Hitsheep, with 2 replies.
Last reply by Hitsheep, over 1 year ago:
danpost wrote...
Hitsheep wrote...
Can someone explain why the class Rod is unable to add the object fishingBar into the World? << Code Omitted >>
Sure. Line 12 declares a field (instance variable member) named
curWorld
, which is assigned an initial value by calling the
getWorld
method. Problem is that this assignment is done before the
Rod
actor is placed into a world, meaning the field is assigned a
null
value (that is, no
World
object is assigned to the field). There seems to be no logic to your codes, on a whole. Most of the fields are not use
ice attack
By Magzlum, with 12 replies.
Last reply by danpost, over 1 year ago:
Magzlum wrote...
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.
How to draw integers
By Deepfist, with 1 reply.
Replied to by danpost, over 1 year ago:
Deepfist wrote...
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, over 1 year ago:
MyProject wrote...
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
GreenfootImage
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, over 1 year 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, over 1 year 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!
14
15
16
17
18
19
20
X