Vyriesene
Zdar,
mam dajme tomu taky obrazok ako v prilohe a chcem aby sa cez tie silno sive pixely nedalo pohybovat s obdlznikom. Cize nejako
if(podmienka){
ball.speedx = 0- ball.speedx;
ball.speedy = 0- ball.speedy;
Neviem, co by som mal dat do podmienky. Skusal som to takto
int getpixelred(SDL_Surface* surface, int x, int y)
{
Uint32 *pixels = (Uint32 *)surface->pixels;
Uint8 r, g, b;
SDL_PixelFormat *fmt;
fmt=surface->format;
int lineoffset = y* (screen->pitch/ 4);
SDL_GetRGB(pixels[lineoffset+ x], fmt, &r, &g, &b);
return r;
}
...
if(getpixelred(s_bckground, ball.x-1, ball.y-1)== 59)...
ale nejako to blblo. Ako by ste to riesili vy?