0
爲什麼不通過此代碼讓我向上或向左移動?SDL x和y移動
while(quit == false)
{
apply_surface(0,0, back,screen);
apply_surface(playerx,playery,player, screen);
SDL_Flip(screen);
//While there's an event to handle
while(SDL_PollEvent(&event))
{
if(event.type == SDL_KEYDOWN)
{
switch(event.key.keysym.sym)
{
case SDLK_UP:playery=playery-10;
case SDLK_DOWN:playery=playery+10;
case SDLK_LEFT:playerx=playerx-10;
case SDLK_RIGHT:playerx=playerx+10;
}
}
是的,確實有效ty(在我問之前,真的需要更加小心和閱讀) – yorde