microsoft-------hope----kingsoft
they all call this no 1. in china.

解决方案 »

  1.   

    下面是中国方块(不想叫俄罗斯方块)的OnTimer事件处理程序:
    ***************************************************************
    MoveTo( CurFangkuai, GetLeft( CurFangkuai ), GetTop( CurFangkuai ) + 30 )
    temp = Touched( CurFangkuai )
    if temp > 0
      MoveTo( CurFangkuai, GetLeft( CurFangkuai ), GetTop( CurFangkuai ) - 30 )
      if GetTop( CurFangkuai ) = 0
        EndTimer()
        CurFangkuai = 0
        NextFangkuai = 0
        CurType = 0
        NextType = 0
        SetSelection( 0 )
        MoveTo( 38, GetLeft( 38 ), 600 )
        SetVisible( 38, 1 )
        SetSelection( 38 )
        if GetText( 37 ) = ''
          SetText( 38, "游戏结束,对不起,您没有赚到一分钱!" )
        else
          SetText( 38, "游戏结束,恭喜您赢得" + GetText( 37 ) + "元大奖!" )
        endif
        BringToFront()
        SetSelection( 0 )
        StartGongxi()
      else
        if CurType = 6 .OR. CurType = 7 .OR. CurType = 8
          SetPolyY( CurFangkuai, 0, GetTop( CurFangkuai ) )
        endif
        py = GetTop( CurFangkuai ) + GetHeight( CurFangkuai ) - 15
        pb = GetTop( CurFangkuai )
        fenshu = 10000
        while py > pb
          px = GetLeft( 1 ) + 15
          ct = 0
          while px < GetLeft( 1 ) + GetWidth( 1 )
            if UnitAtPoint( px, py ) > 0
              ct = ct + 1
            endif
            px = px + 30
          endwhile
          if ct = GetWidth( 1 ) / 30
            px = GetLeft( 1 ) + 15
            while px < GetLeft( 1 ) + GetWidth( 1 )
              ct = UnitAtPoint( px, py )
              i = 0
              while i < 10
                if GetPolyY( ct, i ) > py
                  SetPolyY( ct, i, GetPolyY( ct, i ) - 30 )
                endif
                i = i + 1
              endwhile
              if GetHeight( ct ) = 0
                SetSelection( 0 )
                SetSelection( ct )
                DeleteSelection()
              endif
              px = px + 30
            endwhile
            i = 0
            ct = UnitCount()
            while i < ct
              Index = GetUnit( i )
              if GetTop( Index ) < py .AND. Index > AllUnit .AND. Index <> NextFangkuai
                MoveTo( Index, GetLeft( Index ), GetTop( Index ) + 30 )
              endif
              i = i + 1
            endwhile
            pb = pb + 30
            py = py + 30
            SetText( 37, Str( Val( GetText( 37 ) ) + fenshu, 0 ) )
            fenshu = 2 * fenshu
          endif
          py = py - 30
        endwhile
        NewFangkuai()
      endif
    endif