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
Numbers smaller than 1
By Nooooob, with 1 reply.
Replied to by danpost, over 9 years ago:
Nooooob wrote...
Can you use numbers smaller than 1?
Not unless the field ('length', in your case) is of type
double
or
float
(not
int
), or your unit of measure for 'length' is changed (instead of units, you assigned -- virtually --, say, 1/100th of a unit as the new unit).
How to change an actor's image directly from the world?
By EdiPosteuca, with 2 replies.
Last reply by danpost, over 9 years ago:
Please show the code used to declare and fill the array and explain, in detail, what each part in the array is for (what the positions in the array represents and all values within the array). Then show the code for the 'for' loop that you have tried. If there are any unknowns within the codes given, explain what they represent.
Greenfoot crashes when program is run with certain actors
By M0N57R0517Y, with 6 replies.
Last reply by danpost, over 9 years ago:
Any variables that need to be maintained through multiple act cycles must be declared outside of any methods. That means lines 24 through 29 and what you have inside the 'Info' method (line 15). You can remove the 'pause' method as the timer will take care of that part. Instead of 'Info' as the name of the field that determines what needs done, I would use something more meaningful -- like 'step'. You can declare constants (outside of any method) to help in what step is what. For example:
Help in making a platformer game?
By haynako, with 4 replies.
Last reply by Nosson1459, over 9 years ago:
Is there a way that I could have found the above link (
here
) on my own, because I have never saw it before until now and it would have helped me (I'm also wondering if there are other things there that I haven't seen).
How can I make a screen-shake effect?
By Gormatrax, with 1 reply.
Replied to by danpost, over 9 years ago:
The code that you would use to make the screen shake is basically the same as what you would use to make the world a scrolling world. The only differences are (1) the scrolling is limited to very short distances (vertically and/or horizontally); (2) what condition(s) are used for scrolling; and (3) the behavior of the scrolling. The third difference is really a result of the second one.
Shaking the world is now included in my
Scrolling Tutorial
scenario and is demonstrated in my
Scroll
@danpost I need help...
By Kokoro, with 2 replies.
Last reply by Kokoro, over 9 years ago:
Yeah i manged to noticed that like after i posted this :D However it worked thanks !!
Greenfoot doesn't start
By Sirgeorges, with 2 replies.
Last reply by Sirgeorges, over 9 years ago:
Thanks man, nailed it.
How to make actor stop
By Nooooob, with 6 replies.
Last reply by Nooooob, over 9 years ago:
danpost wrote...
It means that it does not like that line there. Move it up -- outside the 'act' method (but, still within the class).
I see. Many thanks for your input !
How Do I Change Value Of Actors(cards) Based On Previous Actor Selected?
By zanzabarjones, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
Let's say you have one class Card. And each different card is represented by a different 'type' value. For 5 cards, these values would be 0-4. If you press a card with type 3 and then one with type 2, it will add a certain number of points. The next card's previous is 2 then. The array could look like this:
Greenfoot Images Size
By HardToFindAName, with 2 replies.
Last reply by danpost, over 9 years ago:
The problem is not the amount of storage memory that is being taken up by the image files -- it is the amount of working memory for the project. You are probably creating all the images at the beginning and keeping them as GreenfootImages throughout the running of the project. I will throw around a couple of ideas. Consider creating them (the images) only when needed and not keeping references to them once their on-screen time is done. Using an array in your world class to contain all the necessary data on the states and using a single State object with changeable data would also help. Yo
Solid objects..
By Kokoro, with 5 replies.
Last reply by Super_Hippo, over 9 years ago:
Show what you have tried.
Alternatives
By shannith, with 1 reply.
Replied to by valdes, over 9 years ago:
To do what kind of action ? If you dont want to use the mouse, you can use the keyboard and isKeyDown().
Remove string after the button was pressed.
By AlexandraEn, with 1 reply.
Replied to by valdes, over 9 years ago:
That "string", is it an Actor object, a GreenfootImage object, a Label object,...? in any case, you need a reference variable to have access to that object. That variable should be in your World class as a member variable. In the constructor of your world, you instanciate that variable, and add it to the world. Same with the button. In the button code, you check for the mouse click, get the world from the button and remove the object string. There are several ways to do that, the string as a public variable or a public method inside the world that removes the string. You can also se
Scoreboard doesn't keep score
By Marrryanx, with 1 reply.
Replied to by valdes, over 9 years ago:
On line 10 (class Teste) you declare a member variable Scor. It means that object Scor belongs to ONLY that particular object teste. So each world that is a subclass of teste has its own object Scor. So it is not reseting, it is a different object on each world. The solution is to have only one object Scor, common to all the worlds. So you need a CLASS VARIABLE (static). Change line 10 to: <Code Omitted>
Image scroller
By Alexlazea, with 6 replies.
Last reply by Alexlazea, over 9 years ago:
I think i fixed it, i tried another code from the buggy car, if you know it and it worked for the buggy, now i have to implement it to my actors I honestly feel very bad about copy paste code, but i'm in a rush right now, i will try to understand all of it after i finish my project :D
395
396
397
398
399
400
401
X