this sprite the ball is deleting every thing it touches because of this
dbSprite(SPRITE_BALL, dbMouseX(), dbMouseY(), 1);
int x = dbSpriteCollision(SPRITE_BALL, 0);
if (x > 0) dbDeleteSprite(x);
the problem is that i dont know how to delete the part of the sprite here is the fall code
#include"Level1start.h"
#include"darkGDK.h"
#include"ball.h"
int level1map::Level1()
{
const int ARRAY_ROWS = 8;
const int ARRAY_COLS = 8;
const int SIZE_X = 40; // width of one brick
const int SIZE_Y = 16; // height of one brick
const int TILESET_IMAGE = 100;
//const int SPRITE_BALL = 200;
const int BRICK_TOP_X = 150; // top left corner of brick area on the screen
const int BRICK_TOP_Y = 50;
int map[ARRAY_ROWS][ARRAY_COLS] = {
{2, 2, 2, 2, 2, 2, 2, 2},
{1, 1, 4, 1, 1, 4, 1, 1},
{3, 3, 3, 3, 3, 3, 3, 3},
{4, 4, 4, 4, 4, 4, 4, 4},
{1, 4, 1, 1, 3, 1, 4, 3},
{1, 1, 4, 1, 1, 4, 1, 1},
{1, 1, 1, 4, 4, 1, 1, 3},
{3, 3, 3, 3, 3, 3, 2, 3}
};
dbLoadBitmap("Bricks3.bmp", TILESET_IMAGE);
dbSetCurrentBitmap(TILESET_IMAGE);
// Split the tileset into individual images.
// Images will be numbered from 1 to 4.
int imageID = 0;
for (int y = 0; y < 2; ++y) {
for (int x = 0; x < 2; ++x) {
dbGetImage(++imageID, x * SIZE_X, y * SIZE_Y, (x+1) * SIZE_X, (y+1) * SIZE_Y);
}
}
// Set the current bitmap back to the screen.
dbSetCurrentBitmap(0);
// Create sprites from the images, according to the map.
int spriteID = 0;
for (int y = 0; y < 8; ++y)
{
for (int x = 0; x < 8; ++x)
{
if (map[y][x] > 0)
{
dbSprite(++spriteID, BRICK_TOP_X + x * SIZE_X, BRICK_TOP_Y + y * SIZE_Y, map[y][x]);
}
}
}
return(0);
}
what is the name of the bricks
Always end the name of your child with a vowel, so that when you yell the name will carry. - Bill Cosby
California is a fine place to live - if you happen to be an orange. - Fred Allen