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
Snap to
By KiwiMC1482, with 8 replies.
Last reply by danpost, over 10 years ago:
Ben&Sam wrote...
it was a joke..
Please refrain from creating non-constructive posts. davmac might reply with something like this:
what if Ben&Sam was banned
How to move up and down with just one button.
By Jellyfish, with 12 replies.
Last reply by Jellyfish, over 10 years ago:
nvm
Animations
By Jellyfish, with no replies.
Hi how do I create moving animations for my character(s)?
game levels
By javaisanart, with 13 replies.
Last reply by danpost, over 10 years ago:
The code I gave was supposed to be in your world subclass -- not in your new Hud actor subclass. In fact, the code as given will work in your world subclass without any changes. If you create a basic Actor subclass for HUD objects, make it a very basic class, like this: <Code Omitted>and change my line 5 to: <Code Omitted>Yes. That first line of code in this post is the entire class code.
Shooting problem
By Hawx_, with 10 replies.
Last reply by danpost, over 10 years ago:
AmericanaStorm wrote...
This might be weird but would be the coding for the bullet to shoot in the actual bullet class and not the shooter class. Thanks
It sure does sound weird. It is not the behavior of a bullet to shoot a bullet. That behavior belongs to that of the shooter. The usual behavior of the bullet is to fly through the air until a target is reached or until it goes 'beyond' the end of the world (rather, reaches the edge of the world). Sometimes, instead of the bullet having the behavior to 'reach a target', the target will consume the bullet and lose health or die. Th
Gravity Physics Engine Troubles
By h123n, with 1 reply.
Replied to by h123n, over 10 years ago:
Sorry guys, I found I didn't use the if statement correctly, instead of if (Ground = true) it is if (Ground == true)
How to make a Block disappear when I click on it.
By Jellyfish, with 6 replies.
Last reply by danpost, over 10 years ago:
Jellyfish wrote...
I had to do getWorld().removeObject(this); and it works!
good job.
Adding an object of itself please help!
By h123n, with 5 replies.
Last reply by danpost, over 10 years ago:
h123n wrote...
I wasn't sure what the actuall method was called, I've changed it now to .addObject (Not sure if it even is a method)
To be sure, check the documentation. For code in an Actor subclass, refer to the Actor class documentation, where you will find the 'getWorld' method that returns a World object; then, check the World class documentation, where you will find the 'addObject' method. You will always be able to follow this pattern for any 'dot' operated statement (each part returns an object reference or a value; and for any object reference, you can refer to the documenta
adding/subtracting integers?
By h123n, with 4 replies.
Last reply by h123n, over 10 years ago:
Thanks! sorry for being a total noob, I am trying to make a physics engine
Quote of the Day:
By ShaunThompson12, with 3 replies.
Last reply by davmac, over 10 years ago:
The best way to spell banned is
banned
. Do you think that's useful?
Iframe Greenfoot game to present on my own site?
By trias95, with 13 replies.
Last reply by lordhershey, over 10 years ago:
it looks like it is trying to call out to both the greenfoot.org site as well as yours - we are getting a security Exception of some sort. if you want to go a sub frame route that would be doable - you could possibly also use a dynamic script tag - or maybe the classes can be extracted and added to a dummy project - basically make a fake project with same class names and then patch in the classes you want over the dummy ones.
Programming
By Express88, with 1 reply.
Replied to by danpost, over 10 years ago:
Constantly check for obstacles (walls) and keep off them. Refer to the Actor class documentation and see what methods are available for accomplishing this task.
display string from actor in world
By Nizuka, with 1 reply.
Replied to by Super_Hippo, over 10 years ago:
'showText' is a method of world, not actor. (Just in case this is used in an Actor subclass, I can't see this in your code snippet.) In front of the word "Bullets" you need another double quote. <Code Omitted>
FOR loop explanation
By chamuzi3, with 1 reply.
Replied to by danpost, over 10 years ago:
Apparently, it is used to step, pixel by pixel (or, rather, cell by cell), through the entire move distance. The horizontal and vertical movements are also done individually. By doing so, the object actor will stop moving in either direction upon intersecting a Wall object and no backing off is required (although, backing up once could still be added when a Wall object is contacted to prevent any intersection with the Wall object).
A simple "wall"
By darkmist255, with 17 replies.
Last reply by chamuzi3, over 10 years ago:
YOU CAN ALSO USE SOMETHING LIKE THIS FOR COLLISION AND WHEN YOU WHAT TO MOVE THE CHARACTER TO DIFFERNET DIRECTION WITHTOUT PASSING THROUGHT CHARACTERS SUCH AT THE WALL.
600
601
602
603
604
605
606
X