My pongball won't move!!
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)
(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);
}
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| simple function to move an object not doing as wanted | burrows111 | 11 | 3,783 |
Apr 16, 2010 11:33 PM Last Post: StealthyCoin |
|
| Why won't my dot move? | nmartin | 12 | 4,190 |
Nov 30, 2003 04:00 PM Last Post: Fenris |
|

