BlitzMax Collision Barrier
Hello could someone send me a piece of code that when an image collides with another it stops moving
i think you will have to ask in the blitzmax forums, as your question may be too language specific
i don't know how many here at the forums know blitzmax, but i think seeking help in the official forums is your best bet for help
i don't know how many here at the forums know blitzmax, but i think seeking help in the official forums is your best bet for help
Hello could someone send me a piece of code that when an image collides with another it stops moving
How do you think something like this would work? Well, you need to know the height and width of the images. I assume Blitzmax can provide that information once you've loaded them. Then you need to know the locations of the images on the screen. You control that, so you know where they are. Then you simply check if the X, Y and Height, Width of Image 1 overlaps the X, Y, and Height, Width of image 2, like this (pseudo-code):
bool IsCollision(Image image1, Image image2)
{
if (image1.x + image1.width < image2.x ||
image1.x > image2.x + image2.width ||
image1.y + image1.height < image2.y ||
image1.y > image2.y + image2.height) {
return false;
}
return true;
{
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement