天地之灵学习小组
我们学习小组的OpenGL学习笔记 大家一定要互相折磨呀~~
posts - 150,  comments - 156,  trackbacks - 0

    
void move( void )
    {
        
int i,j;
        
bool flag = true;
        
switch( d_direct )
        {
        
case DD_DOWN:
            
if ( d_state )
            {
                
if ( bottle->empty( d_x, d_y+1 ) )
                {
                    
++d_y;
                    
break;
                }
            }
            
else
            {
                
if ( bottle->empty( d_x, d_y+1 ) && bottle->empty( d_x+1, d_y+1 ) )
                {
                    
++d_y;
                    
break;
                }
            }
            
/*************这里没写完,预计是个while(true)的循环*********************/
            
while ( flag )
            {
                flag 
= false;
                
if ( d_state )
                {
                    bottle
->set( d_color[0], d_x, d_y );
                    
if ( d_y-1 != 0 )
                        bottle
->set( d_color[1], d_x, d_y-1 );
                }
                
else
                {
                    bottle
->set( d_color[0], d_x, d_y );
                    bottle
->set( d_color[1], d_x+1, d_y );
                }

                
for ( i = 14; i >= 0++i )
                {
                    
for ( j = 0; j < 8++j )
                    {
                        
if ( bottle->)
                    }
                }

                delay( 
500 );
            }
            
break;
        
case DD_UP:
            
if ( d_state )
            {
                
if ( bottle->empty( d_x+1, d_y ) ) d_state = false;
                
else if ( bottle->empty( d_x-1, d_y ) ) { --d_x; d_state = false; }
            }
            
else
            {
                
if ( bottle->empty( d_x, d_y-1 ) )
                {
                    d_state 
= true;
                    Color tmp 
= d_color[0];
                    d_color[
0= d_color[1];
                    d_color[
1= tmp;
                }
                
else if ( bottle->empty( d_x+1, d_y-1 ) )
                {
                    
++d_x;
                    d_state 
= true;
                    Color tmp 
= d_color[0];
                    d_color[
0= d_color[1];
                    d_color[
1= tmp;
                }
            }
            
break;
        
case DD_LEFT:
            
if ( d_state && bottle->empty( d_x-1, d_y ) && bottle->empty( d_x-1, d_y-1 ) ) --d_x;
            
if ( !d_state && bottle->empty( d_x-1, d_y ) ) --d_x;
            
break;
        
case DD_RIGHT:
            
if ( d_state && bottle->empty( d_x+1, d_y ) && bottle->empty( d_x+1, d_y-1 ) ) --d_x;
            
if ( !d_state && bottle->empty( d_x+1, d_y ) ) --d_x;
            
break;
        
default:
            
break;
        }
    }


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   博问   Chat2DB   管理



<2008年10月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

常用链接

留言簿(6)

随笔分类(149)

随笔档案(150)

同道中人

搜索

  •  

积分与排名

  • 积分 - 46150
  • 排名 - 475

最新随笔

最新评论

阅读排行榜

评论排行榜