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
im trying o make this car constantly move forward
By hockeydude1155, with 3 replies.
Last reply by Saladman0, about 9 years ago:
u need to do dank meme
Random direction movement
By JarJarBanks7, with 5 replies.
Last reply by danpost, about 9 years ago:
I must have accidentally deleted a substring from my last post. This sentence:
The only thin in the act method of the ball class (at least for now) is line 9.
should have read like this:
The only thing that should be in the act method of the Ball class (at least for now) is line 9.
Replace lines 21 through 26 above with the following: <Code Omitted>
JarJarBanks7 wrote...
if you see anyway to add all those bricks via for loop please tell me.
A 'for' loop would easily work. A 'while'
Calling World public method from Actor subclass
By EGrant, with 2 replies.
Last reply by EGrant, about 9 years ago:
Thanks Dan. I haven't taken advantage of World subclasses much yet. The explanation is totally reasonable since, after all, the method belongs to the subclass not World, unlike the addObject method.
Actor not in world error, when bullet touches edge.
By JonnyB7, with 2 replies.
Last reply by JonnyB7, about 9 years ago:
I thought I pasted it to the code section. But yes that was the issue thanks.
Fuel, Altitude text
By mmoodle, with 1 reply.
Replied to by danpost, about 9 years ago:
mmoodle wrote...
I'm constructing a game where I want to display the fuel and altitude during the game (like a timer). Does any body know how I can do that?
These are both value displays and are discussed in my
Value Display Tutorial
scenario.
Flipping continuously error :(
By regwang, with 8 replies.
Last reply by Nosson1459, about 9 years ago:
yeah just sayin
Need Help in designing a weight balance.
By Shrey007, with 1 reply.
Replied to by danpost, about 9 years ago:
Start by creating the Actor subclasses needed for the project (the rocker arm and pan classes). If you want the weight balance to tilt gradually to any new setting (or settle into the new setting by swaying back and forth over what will be the new setting), then you may require a smooth rotating system. The class for the rocker arm should keep a reference to the two pans attached to it so it can easily acquire the weight values and determine what rotational forces that need applied. A slight drag factor should also be implemented to create the settling on a new value. This was just to gi
Remove object when ate another object.
By casper4444, with 4 replies.
Last reply by danpost, about 9 years ago:
@theyoshiguyREAL, you should not reopen old discussion threads like this; but, start a new one dealing with your issue. However, the lines starting with: <Code Omitted>to the second to last line posted are not within a method. Try moving the line above it, the '}', to below that set of code (so that you have three consecutive closing brackets at the end and said code is within the act methodd.
How do I make my life meter animate?
By ginger--ale, with 9 replies.
Last reply by ginger--ale, about 9 years ago:
it works now, thank you
How do i get camera to move with character?
By FutureCoder, with 4 replies.
Last reply by FutureCoder, about 9 years ago:
thanks
isTouching being Private
By Psychpsyo, with 20 replies.
Last reply by danpost, about 9 years ago:
Psychpsyo wrote...
But a square shape can't be higher than wide.
No, it cannot. However, there are other things you can do using one or more of these methods. For example, you can relocate the actor, temporarily, and check collision at various nearby locations using one of them. Here is one possible way:
I'm getting an actor not in world error plz help
By hockeydude1155, with 19 replies.
Last reply by Nosson1459, about 9 years ago:
k, thanks for sharing
problem
By Nosson1459, with 3 replies.
Last reply by danpost, about 9 years ago:
Nosson1459 wrote...
yeah but i need that in case theres something in the way bec if move is false then it goes back to the penguin moving then the penguin "sees" somethings there and stops moving
I think you should dispense with the 'moving' field altogether and just use the current conditions to determine whether it can move or not at that moment. If you need to (so that you do not check the same thing multiple times during the same act cycle), you can set a local variable to the results of the check on current conditions; but, conditions can change from act to act, so it makes little
Help! Press space once to start game
By j.moseley99, with 1 reply.
Replied to by Super_Hippo, about 9 years ago:
If you just want it to start the game with it, you could use this in your world: <Code Omitted>In the Ball class, you let it move without a condition.
Moving an actor with a mouse click
By Justinh, with 1 reply.
Replied to by Super_Hippo, about 9 years ago:
Do it step by step. Check for a mouse click and save the x and y position of the mouse in the actor. Use the turnTowards method (to the saved x and y), move and set the rotation back to 0.
434
435
436
437
438
439
440
X