I have been able to get the orb to bounce off the floor and the right wall but not the roof and left wall, working on that. Will post update when I do.
Still stuck on the bouncing thing but here are two new things:
1. I added sound to play but keep getting an error screen even though it compiles.
2. When I try to populateWorld(); with Orbs it will not compile even though it is copied exactly from one of my earlier programs that did work substituting orb for worm. (won't compile with or without capital letter)
Will keep working!
A new version of this scenario was uploaded on Sat May 12 21:19:49 UTC 2012
You need to put the sound file in the 'sounds' folder within the scenarios folder.
Make sure, when you add Orb objects into the world, that you use 'addObject(new Orb(int, int), int, int);', supplying both the x and y speeds and the x and y locations.
For top and left bounce, you need to compare <= 0, not >= getWorld().getHeight() or >= getWorld().getWidth(). You will also need an offset value for the checks as the image of the object is smaller than the image itself (I thought 15 was about right). So the checks would be
left: <= -15
right: >= getWorld().getWidth() + 15
top: <= -15
bottom: >= getWorld().getHeight() + 15
The only other thing I saw, was the need for an 'addedToWorld(World world)' method in the Orb class to initialize the exactX and exactY values to getX() and getY().
2012/5/12
2012/5/12
2012/5/13
2012/5/13