@hoyaduyin, it is a bit hard to explain. Basically, the image itself needs to be rotated to the rotation of the actor to determine where each pixel of the image resides in the world. Only those parts of the image that are inside the largest circle you can draw within the frame of the image are guaranteed to remain within the frame of the image when rotating it. Therefore, the image needs to be drawn onto a larger frame before rotating it to avoid loss of image. That larger frame is what I called the 'image base'.
@hoyaduyin, I cannot be sure what the first part (deciding which image should be 'a_big' or 'a_small') is for or even if it matters. However, the rest is pretty straight-forward. Copy the images only a image base large enough to rotate them without losing any of the image, rotating them to the rotation of the actor the image belongs to and comparing the pixels that overlay each other to see if any set compared are both non-transparent.
@hoyaduyin, there are two 'touch' methods in the project. The one listed above iterates through the actors of the given class. If any of these actors are found to intersect this object, the other 'touch' method is called to check for non-transparent collision between the two objects.
@Collin, let me clarify. Off-line, using the greenfoot application, you can use 'Ctrl-R' to run or restart the scenario; but, this will not work here on the site.
Once the scenario is stopped, no keystroke action will start the scenario back up. Programmatically preventing the actions of your actors is the only way to make the scenario appear to be paused and still have a key detected to lift to prevention.
The movement of the Chased object is directed by the 'wasd' keys and the Chased class is not a subclass of the QActor class. The different bound behaviors are for the Chaser objects. Download the scenario and open it up in the greenfoot application; then, start it and press 'e' until the bound state you want is selected; finally, click on the 'Pause' button, remove the Gun and the Chaser and restart the scenario. You can use the speed slider to check the bounds actions quickly after the previous steps.
2015/12/12
Pixel-perfect collision detection
2015/12/12
Pixel-perfect collision detection
2015/11/25
Pixel-perfect collision detection
2015/11/24
Pixel-perfect collision detection
2015/11/24
Pixel-perfect collision detection
2015/9/19
little-crab
2015/9/19
little-crab
2015/9/19
Zombie Shooter Demo
2015/9/18
little-crab