   breakout paddle
  well I have managed to draw all the multicolored bricks for my breakout game.Now I am working on moving the paddle left and right.I am trying to keep the code as consice as possible.I would like to thank all who have helped me out. Here is the code I am working on.    if (KEY_DOWN(VK_LEFT)){d3ddev->ColorFill(surface, NULL, D3DCOLOR_XRGB(255,255,255));RECT rect;rect.left = paddle_left--;rect.right = paddle_right--;rect.top = paddle_top;rect.bottom = paddle_bottom;d3ddev->StretchRect(surface, NULL, backbuffer, &rect, D3DTEXF_NONE);}    if (KEY_DOWN(VK_RIGHT)){d3ddev->ColorFill(surface, NULL, D3DCOLOR_XRGB(255,255,255));RECT rect;rect.left = paddle_left++;rect.right = paddle_right++;rect.top = paddle_top;rect.bottom = paddle_bottom;d3ddev->StretchRect(surface, NULL, backbuffer, &rect, D3DTEXF_NONE);}
  Do you have a question?   ;  I am stuck on how to move the  paddle from left to right and right to left.   ;  That's not a question.What's the problem? It's not moving, moving in the opposite direction, program crashes?Is the paddle drawn well?If you adduce something from your previous threads, add a link at least, not everyone reads/remembers your threads.I don't see too much problem with that code snippet, apart from:You increase/decrease the left/right side after calculating the rectangle. So the rectangle will always be drawn in the previous position.Post the whole code.   ;  You'll probably want to make your paddle motion time based.  So if the user presses and hold down the keys then the paddle will move at a fixed rate rather than based on CPU load executed.If you search online you can find many articles on time based motion.  I also created a few videos on the topic on my website in the Physics section.   