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
Gravity Physics Engine Troubles
By h123n, with 1 reply.
Replied to by h123n, almost 11 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, almost 11 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, almost 11 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, almost 11 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, almost 11 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, almost 11 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, almost 11 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, almost 11 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, almost 11 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, almost 11 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.
Help Needed! creating an exception to getOneIntersectingObject
By TheGoldenBucket, with 7 replies.
Last reply by TheGoldenBucket, almost 11 years ago:
Never mind. Managed to get it fixed, and now I should be able to use this to create a directional system. Thanks! -TheGoldenBucket
Actors not turning correctly
By pypenko, with 3 replies.
Last reply by pypenko, almost 11 years ago:
My apologies. The i Actor is an intersection and I have managed to figure out what I did wrong. The RIGHT, LEFT, UP and DOWN are rotation values, RIGHT = 0, LEFT = 180, UP = 270, DOWN =90. It helps me to keep things in perspective. Anyway, thanks for replying even when I didn't make things clear.
Help, im a noob!
By Pr0grammer, with 2 replies.
Last reply by danpost, almost 11 years ago:
To remove the error, change line 13 to this: <Code Omitted>which ensures the actor is still in the world before checking world edges. To also remove the asteroid collided with, insert the following at line 8: <Code Omitted>
Whats Wrong?
By Pr0grammer, with 1 reply.
Replied to by danpost, almost 11 years ago:
The main thing that is wrong is that you cannot pass more than one actor to the 'removeObject' method (see line 2). The only thing you want to do if either condition in line 1 is true is remove the shot. This means that if colliding with an asteroid, the asteroid should be removed within the method that checks for its intersection::
Help? My graphics are blurring...
By petepasan, with 7 replies.
Last reply by petepasan, almost 11 years ago:
Oh its fixed. Just one of the spawns, thank you so much for your help.
601
602
603
604
605
606
607
X