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
stop certain classes for game over screen
By Steven.Z., with 12 replies.
Last reply by danpost, over 11 years ago:
@chandan03, please do not revive old discussion thread with new issues. Start a new one and please include relevant codes and information with regards to your project.
String as parameter?
By jackandjim, with 11 replies.
Last reply by Super_Hippo, over 11 years ago:
davmac wrote...
No, your revised code still deals with both Gegner1 and Gegner2 instances at the same time. It's supposed to be parameterised so that you can choose which one you want to deal with - either Gegner1 instances, or Gegner2 instances.
He was calling the method once for each enemy. It didn't look like he needed it separately.
Whenever I try to set the paint order, it keeps giving me <identifier>. What do I do?
By mendg025, with 4 replies.
Last reply by davmac, over 11 years ago:
Super_Hippo wrote...
So without the 'public void' ...
Damn, I missed that.
How to make the background "wrap" and repeat in Space Shooter Game by Azhar Chaudhry?
By Kendall, with 9 replies.
Last reply by mendg025, over 11 years ago:
yea me too @shabs
Player not resetting
By Salcrainia, with 2 replies.
Last reply by danpost, over 11 years ago:
You could simplify things by just setting the location of the player already in the world (instead of removing it and adding a new one): <Code Omitted>
getX() and getY() when you got multiple objects of the same class
By jackandjim, with 1 reply.
Replied to by danpost, over 11 years ago:
That is no different than getting coordinates from two objects of different classes, Let us say we had an Actor subclass called Guy. Then, in the Guy act method: <Code Omitted>
Firing projectile
By jmstinson221, with 4 replies.
Last reply by davmac, over 11 years ago:
You're not saving the 'fromCharacter' parameter value (in the Projectile constructor) into the 'fromCharacter' instance variable. You need a line something like: <Code Omitted>
Collisions between objects of the same class...
By sergeantjackson, with 2 replies.
Last reply by sergeantjackson, over 11 years ago:
Okay, thank you for the fast answer, I'll try it out! :)
how to make an object move a specific distance when the right or left key button is pressed
By dyl_fisher, with 13 replies.
Last reply by danpost, over 11 years ago:
There is still the problem, however, that you could have both horizontal and vertical movements going at the same time because you kept the codes for each separated from the other. I mean that you could end up with movement, for example, moving up 4, then moving diagonally to the right 6 and then moving the final 4 to the right (which would then be 10 up and 10 to the right).
Set a Score counter
By dyl_fisher, with 5 replies.
Last reply by danpost, over 11 years ago:
Insert my 4 and 5 at your line 11. Insert my 8 through 10 at your line 20. Insert my 20 through 23 at your line 24. After what you inserted at line 24, add an act method: <Code Omitted>and insert my lines 13 though 17 at line 3 in the act method. Make sure that 'Player.class' is adjusted to the class name for your main character (I did not know, and still do not know, the name of the class for your main character -- maybe it should be 'Runner.class' -- but I cannot be sure).
Saving?!?!?
By xGRxImmortal, with 4 replies.
Last reply by danpost, over 11 years ago:
Currently, due to java security restrictions, writing to a file is only allowed locally. That is, you will not be able to save your game on the site. However, if you are still interested in finding out how to save your game locally, there are several discussions on that as well as a support class or two. You just have to search for them (which could be tedious -- trying to figure out what search words will bring up what you want).
Question about random spawn in "false" world,
By Zakuza, with 6 replies.
Last reply by Zakuza, over 11 years ago:
Thank you, now I fully understand how it works.
How to setup a table in greenfoot?
By teng, with 4 replies.
Last reply by danpost, over 11 years ago:
By you mentioning swing, it would appear the you want the data to be input by the user during run-time. You
can
use swing in greenfoot. There are several scenarios on the site the uses swing -- mostly using the JOptionPane class which can be used for simple messages, confirmations, choices, and even data input (to name the most common uses). If you would prefer not to use swing, you could create your own gui objects to gather the information for the table. With more information about the table and what kind of data and choices for that data, it may be possible to make more, or even
random number within a range
By dyl_fisher, with 2 replies.
Last reply by dyl_fisher, over 11 years ago:
Thanks so much it worked :)
Need help with my healthbar :D
By Yurey, with 8 replies.
Last reply by Yurey, over 11 years ago:
thank you for the help and excuse my low programming and english skill ^^ it works know u are great :D
577
578
579
580
581
582
583
X