1 Aug 2006 18:07
Re: Why is this programme bad
Michael Bonfils <murlock <at> free.fr>
2006-08-01 16:07:36 GMT
2006-08-01 16:07:36 GMT
Krzysztof Pos?uszny wrote:
1/ you use klaw but it is not allocated
2/ you never use it in SDL_BlitSurface
3/ you don't check if event is a keyboard event
try something like that
bool quit = false;
while( !quit ) {
if ( SDL_PollEvent( &event ) {
if ( event.type == SDL_KEYDOWN ) {
switch(event.key.keysym.sym) {
case SDLK_UP:klaw.x=20;break;
case SDLK_LEFT:klaw.y=20;break;
}
}
}
SDL_BlitSurface(kula,NULL,screen, &klaw );
SDL_Flip(screen);
}
--
--
Michael Bonfils ( http://www.murlock.org )
membre de http://www.guses.org
RSS Feed