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
I need help with how to read a txt file in greenfoot
By protocolUnknown, with 5 replies.
Last reply by protocolUnknown, about 7 years ago:
I was able to fix it by moving everything to the world class. I think the issue was something else and not with the txt file reading method I had. I was able to fix it though, so thank you
Understanding how to handle the game mechanics in which classes
By protocolUnknown, with 1 reply.
Replied to by danpost, about 7 years ago:
protocolUnknown wrote...
Is the World class meant for just the initial setup of what the screen/level will look like and nothing else after that?
A class, whether
World
,
Actor
or any other, is a blueprint (or part of one) for a type of object. Its fields maintain the different states that its objects can have and its methods provide the behavior for its objects (things these type objects can do). For each object, its states can be change and its behaviors can be utilized throughout the object's life (or its existence -- until all references to that object are lost). I s
Problem using canSee method
By kml008, with 1 reply.
Replied to by danpost, about 7 years ago:
kml008 wrote...
some time this method works and some time it doesnt
It will only work in an
Actor
subclass that extends the
Animal
class or one that has a
canSee
method within itself. As an alternative, you can use the
isTouching
method.
2D Array
By Fargesia, with 14 replies.
Last reply by Super_Hippo, about 7 years ago:
Swap lines 16 and 17 in the unJoueur class. Or replace the class code with this: <Code Omitted>
getObjectsInRange does not work...
By Proprogrammer04, with 1 reply.
Replied to by danpost, about 7 years ago:
Proprogrammer04 wrote...
<< Code Omitted >> It sais Always true, even if the Player is About 900 cells away from the object…
It should be obvious as to why it always says "true".
Making a pause menu help
By lyliux, with 3 replies.
Last reply by lyliux, about 7 years ago:
I just realised I never called the resume() method in act(), easy fix! Thank you! I should of realised that sooner haha :')))))
h timer
By liverpoolfc, with 3 replies.
Last reply by Proprogrammer04, about 7 years ago:
You could implemet this in your world class: <Code Omitted>You have to paste that under the <Code Omitted>
ObjectCounter..
By nicpatel, with 7 replies.
Last reply by danpost, about 7 years ago:
nicpatel wrote...
<< Code Omitted >> i want to update location matrix when object stop to move.... is it possible.
I think we will need to see more of the squirrel class code.
Trying create an id
By divinity, with 1 reply.
Replied to by danpost, about 7 years ago:
First, you cannot mix alpha characters with numeric character outside of double quotes (to make them strings). Second, you cannot list multiple things under the same field name (
custID
) -- unless it is an array or list. Third, those listed items on line 11 appear to be account ids, not customer ids (maybe the field name should be changed). Fourth, the listed values are not all checking accounts. I do not know why you would put them all in a class called
CheckingAccount
(probably should be in
Account
class).
Remove an actor when touching another
By Fargesia, with 4 replies.
Last reply by Fargesia, about 7 years ago:
Thanks danpost! Works just fine!
sound
By liverpoolfc, with 13 replies.
Last reply by Super_Hippo, about 7 years ago:
<Code Omitted>
sound
By liverpoolfc, with 2 replies.
Last reply by liverpoolfc, about 7 years ago:
ok thanks.
Dematerializing image
By GingaSnap, with 1 reply.
Replied to by danpost, about 7 years ago:
You could use a for loop to remove multiple pixels at a time. However, the two big problems would be (1) as pixels get removed, the chance lessens in hitting one that needs removed; and (2) determining when ALL pixels have been removed would not be an easy matter. Fading might be a favorable alternative -- gradually diminishing the transparency of the entire image. Or, maybe a combination of the two -- that way, at least the time for total removal is limited to a specific amount.
drawOval move
By ronald, with 16 replies.
Last reply by ronald, about 7 years ago:
thank you
Jumping
By ¿ques♫, with 33 replies.
Last reply by danpost, about 7 years ago:
¿ques♫ wrote...
Hi Danpost, was wondering, how can I edit your Scroller class or the MyWorld class to disable backwards scrolling? I want Mario to still be able to move towards the left edge of the screen, but for backwards scrolling to be disabled (doing this so that any objects that pass the left edge can be removed to reduce lag). << Code Omitted >>
The
Scroller
class should never need modification. My tutorial shows how to allow
scrollActor
roaming before scrolling using specific code in the
scroll
method in your
MyWorrld
class. It should be a simple m
171
172
173
174
175
176
177
X