Hello! I am trying to learn how to create a simple game following some nice tutorials on Youtube. I have two questions:

1. There is nothing wrong with the "moving code" I use. It does exacly what I tell it to do. I want to learn how to NOT make the player stop moving to the left or right when I click the spacebutton to shoot

Qt Code:
  1. void Player::keyPressEvent(QKeyEvent *event){
  2. // move the player left and right
  3. if (event->key() == Qt::Key_Left){
  4. if (pos().x() > 0)
  5. setPos(x()-10,y());
  6. }
  7. else if (event->key() == Qt::Key_Right){
  8. if (pos().x() + 100 < 800)
  9. setPos(x()+10,y());
  10. }
  11. // shoot with the spacebar
  12. else if (event->key() == Qt::Key_Space){
  13. // create a bullet
  14. Projectile * projectile = new Projectile();
  15. projectile->setPos(x()+35,y());
  16. scene()->addItem(projectile);
  17. }
  18. }
To copy to clipboard, switch view to plain text mode 

2. How to play add and play a simple .gif-animation. I use the following code (a sample) with no errors, but nothing appears in my window:
Qt Code:
  1. QLabel *gif_anim = new QLabel();
  2. QMovie *movie = new QMovie("C:/Users/Technopia/Desktop/banana.gif"); //Everybody love bananas :cool:
  3. gif_anim->setMovie(movie);
  4. movie->start();
To copy to clipboard, switch view to plain text mode 

Thanks