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
Says actor not in world HELP!!!!!!
By Tm030703, with 1 reply.
Replied to by danpost, over 9 years ago:
You cannot use collision checking methods in the constructor of an Actor subclass. The constructor is what creates the object -- it must be created before being added into any world. Usually, the act method is where collision checking should be done.
Adding A Counter...
By IVortexTwisterz, with 1 reply.
Replied to by danpost, over 9 years ago:
Internal or external counter (value shown on screen or hidden)? What have you tried? Show some attempted code. The "end game screen" can be either an actor object that is added at the end or a separate world. Which do you prefer and what have you tried?
Switch Statement, But For Non-Integers
By PJaymz, with 2 replies.
Last reply by davmac, over 9 years ago:
I have tried doing if isKeyDown && getWorld == QuMaj
You can do: <Code Omitted> Alternatively: <Code Omitted> However, from a design perspective it is better to use polymorphism (as danpost suggests). You don't need to check for "a" and "A"; they would be the same key.
need help making terrain
By ninjaFI, with 3 replies.
Last reply by danpost, over 9 years ago:
There are multiple collision checking methods provided in the Actor class. I would start by using one of them. Check the greenfoot.Actor class API documentation to see what methods are available.
How to call int from another class?
By joshuadswa, with 15 replies.
Last reply by joshuadswa, over 9 years ago:
Alright gonna try it right away :) thx a lot :D
serious lagging
By tmargaret, with 10 replies.
Last reply by tmargaret, over 9 years ago:
Great, thanks both of you!
Move pawn (player) from dice roll
By NicoZorlo, with 4 replies.
Last reply by NicoZorlo, over 9 years ago:
WoW thank you very much
Putting down a platform
By SachaTb, with 3 replies.
Last reply by danpost, over 9 years ago:
SachaTb wrote...
I haven't try'd anything with having a platform, i only have the actor called Platform
There are two places where you will need to check for touching a platform. After line 14. where you move vertically and after line 29, immediately after possibly moving horizontally left or right. You will need to use the value of 'gravity' to determine whether touching from above (when 'gravity' is less than zero) or from below (when 'gravity' is greater than zero).
package
By Nosson1459, with 38 replies.
Last reply by Nosson1459, over 9 years ago:
Nosson1459 wrote...
I can change the name of the class and change around whatever I want in the class (but when I change the name there are two methods that get errors isDefaultButton and removeNotify) so now the pre-existing package is my own new one.
When I change the name I get a lot of errors in the other classes.
Timer doesn't work
By JokeNotFound, with 4 replies.
Last reply by Nosson1459, over 9 years ago:
JokeNotFound wrote...
Ok so im not sure if I fully understand what you mean with proper ints on line 5. My knowledge about programming is very limited due to absence at school. I found this code in another program. Can you help me out? What do I need to enter to make the timer work? Thank you very much in advance for your help and time!!!
You would need to enter something like <Code Omitted> as line 5 and you need to make sure that the method name on line 3 matches the class name. +
danpost wrote...
JokeNotFound wrote...
I found this code in another program.
If yo
Help with having 2 Gif's in code
By SachaTb, with 9 replies.
Last reply by SachaTb, over 9 years ago:
Ok i got it now thx!
Help with error message
By Pinkfle, with 2 replies.
Last reply by Pinkfle, over 9 years ago:
Thank you VERY much!!!
movement and world edge
By jaycee1021, with 3 replies.
Last reply by danpost, over 9 years ago:
Use a combination 'if' statement; use both the direction and position in determining whether to change directions or not (for both sides). Something like this: <Code Omitted>
Performance problems while playing sound.
By elroxar, with 2 replies.
Last reply by elroxar, over 9 years ago:
Super_Hippo wrote...
Any chance you are creating multiple Intro objects?
Could be. I will have a look. Thanks a lot.
Need help with counting objects
By TheMemeMachine, with 10 replies.
Last reply by Nosson1459, over 9 years ago:
TheMemeMachine wrote...
Does that mean that I am supposed to write your code in the world sublass act() method or where if not there?
If you write that code in the act method then the lives will be decreased once every act cycle which means that after a few seconds the lives will be -500. That code you put in the place that you want the lives to be decreased (same as where you put the code for re-setLocation of the fly).
388
389
390
391
392
393
394
X