Sections
Timeline
Sub-Sections
Download
Unified Diff
Zip Archive
Metanav
Preferences
About Trac
Links
Slowchop Studios
Gerald Kaszuba
Advertisement

Changeset 17

Show
Ignore:
Timestamp:
20/11/07 21:58:59 (14 months ago)
Author:
gak
Message:

nds pong

Location:
nds/trunk
Files:
1 removed
1 modified

Legend:

Unmodified
Added
Removed
  • nds/trunk/comp_peter_pong/source/main.cpp

    r15 r17  
    3535    float balldy; 
    3636 
     37    player1 = player2 = 0; 
     38 
    3739    powerON(POWER_ALL); 
    3840 
     
    7880 
    7981// straight to paddle 
    80     balldx = 0.002f; 
    81     balldy = 0.f; 
     82//    balldx = -0.002f; 
     83//    balldy = 0.f; 
    8284 
    8385    while (1) { 
     
    199201    float playerX; 
    200202    playerX = getPlayerPos(player); 
    201 //    if ( 
    202 //        playerY - PADDLE_HEIGHT2 > yBall && 
    203 //        playerY + PADDLE_HEIGHT2 < yBall 
    204 //    ) { 
    205  
    206     if (player) { 
    207         if ( 
    208             playerX - REAL_PADDLE_WIDTH > xBall && 
    209             playerX + REAL_PADDLE_WIDTH < xBall 
    210         ) { 
    211             *xxBall = -*xxBall; 
     203    if ( 
     204        playerY - PADDLE_HEIGHT2 < yBall && 
     205        playerY + PADDLE_HEIGHT2 > yBall 
     206    ) { 
     207        if (player) { 
     208            if (playerX - REAL_PADDLE_WIDTH < xBall && playerX + REAL_PADDLE_WIDTH > xBall) { 
     209                *xxBall = -*xxBall; 
     210            } 
     211        } else { 
     212            if (playerX - REAL_PADDLE_WIDTH < xBall && playerX + REAL_PADDLE_WIDTH > xBall) { 
     213                *xxBall = -*xxBall; 
     214            } 
    212215        } 
    213216    } 
    214  
    215217} 
    216218