My pongball won't move!!

clapton541
Unregistered
 
Post: #1
I'm making my first game and I wanted to make a Pong remake. But for some reason the ball won't move. I'll show you the function I used for drawing the ball.
(All the variables you see are global variables and all the DrawIMG(etc.) functions work)

Code:
inline void DrawBall()
{
    if(bxpos>swidth-bwh)
    {
        bdx=1;
        }
    if(bxpos<0)
    {
        bdx=0;
        }
    switch(bdx){
        case 0:
            bxpos+=badv;
            break;
        case 1:
            bxpos-=badv;
            break;
            }
    DrawIMG(back, bxpos-badv, bypos-badv, bwh+badv*2, bwh+badv*2, bxpos-badv, bypos-badv);
    DrawIMG(ball, 0, 0, bwh, bwh, bxpos,bypos);
    }
Quote this message in a reply
clapton541
Unregistered
 
Post: #2
badv is the balls speed and bdx is the direction its going in.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  simple function to move an object not doing as wanted burrows111 11 4,160 Apr 16, 2010 11:33 PM
Last Post: StealthyCoin
  Why won't my dot move? nmartin 12 4,429 Nov 30, 2003 04:00 PM
Last Post: Fenris