⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jiaose.java

📁 HappyTreeFriends手机游戏的源代码
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
        }


      
        int tile_index_top = row_top * s_bufferWidth;
        int tile_index_bottom = row_bottom * s_bufferWidth;
        int tile_index;
        byte tile_value;
        int row, col;


        tile_index = tile_index_bottom + col_center;
        tile_value = s_phyHuanchong[tile_index];
        if ( tile_value == PHY_H_WALLING)
        {
            m_bHWallingable = true;
        }

     
        tile_index = tile_index_bottom + col_front;
        tile_value = s_phyHuanchong[tile_index];
        if ( tile_value == PHY_V_WALLING)
        {
            tile_index += faceDir;
            tile_value = s_phyHuanchong[tile_index];
            if ( tile_value >= PHY_SOLID)
            {
                m_bVWallingable = true;
                m_vWallingLineX = (col_front * Xiyou.TILE_WIDTH + patch_x) << 8;
            }
        }


      
        tile_index = tile_index_top + outer_col_front;
        row = row_top - 1;
        while ( row != row_bottom )
        {
            ++row;
            tile_value = s_phyHuanchong [ tile_index ];

            if ( tile_value == PHY_WALL_EDGE )
            {
                if ( s_phyHuanchong [ tile_index - s_bufferWidth ] < PHY_SOLID )
                {
                    m_bCanClimbUp = true;
                    m_climbupPointX = (col_front * Xiyou.TILE_WIDTH + patch_x) << 8;
                    m_climbupPointY = (row * Xiyou.TILE_HEIGHT - 1) << 8;
                }
            }


            if (tile_value >= PHY_SOLID)
            {
                m_bBlockedFront = true;
                if (row == row_bottom)
                {
                    m_bReboundable = true;
                }
            }

            tile_index += s_bufferWidth;
        }


     
        tile_index = tile_index_bottom + col_front;
        if (outer_row_bottom > row_bottom) tile_index += s_bufferWidth;
        col = col_front + faceDir;
        while (col != col_back)
        {
            col -= faceDir;
            tile_value = s_phyHuanchong[tile_index];

            if (tile_value == PHY_WALL_EDGE)
            {
                m_bCanClimbDown = true;

                m_climbdownFaceDir = s_phyHuanchong[tile_index + faceDir]
                    < PHY_SOLID
                    ? -faceDir : faceDir;

                m_climbdownPointY = (outer_row_bottom * Xiyou.TILE_HEIGHT - 1) << 8;
                m_climbdownPointX = (col * Xiyou.TILE_WIDTH + (m_climbdownFaceDir > 0 ? -1 : Xiyou.TILE_WIDTH)) << 8;
            }

            if (tile_value >= PHY_SOLID)
            {
                m_bBlockedBottom = true;
                if (col == col_front)
                {
                    m_bBlockedBottomFront = true;
                }
                if (col == col_back)
                {
                    m_bBlockedBottomBack = true;
                }
                if (col == col_center)
                {
                    m_bBlockedBottomCenter = true;
                    if (tile_value == PHY_DEAD)
                    {
                        m_bInDeadZone = true;
                    }
                }
            }

            tile_index -= faceDir;
        }

     
        tile_index = tile_index_top + outer_col_back;
        row = row_top - 1;
        while (row != row_bottom)
        {
            ++row;
            tile_value = s_phyHuanchong[tile_index];

            if (tile_value >= PHY_SOLID)
            {
                m_bBlockedBack = true;
            }

            tile_index += s_bufferWidth;
        }


      
        tile_index = tile_index_top + col_front;
        if ( outer_row_top < row_top ) tile_index -= s_bufferWidth;
        col = col_front + faceDir;
        while ( col != col_back )
        {
            col -= faceDir;
            tile_value = s_phyHuanchong [ tile_index ];

            if ( tile_value == PHY_WALL_EDGE )
            {
                if ( s_phyHuanchong [ tile_index + faceDir ] >= PHY_SOLID
                     && col != col_back )
                {
                    m_bCanClimbUp = true;

                    m_climbupPointY = ( outer_row_top * Xiyou.TILE_HEIGHT - 1 ) << 8;
                    m_climbupPointX = ( col * Xiyou.TILE_WIDTH + ( faceDir > 0 ? -1 : Xiyou.TILE_WIDTH ) ) << 8;
                }
            }
        

            if (  tile_value >= PHY_SOLID )
            {
                m_bBlockedTop = true;
            }

            tile_index -= faceDir;
        }
    	
    }

    static int s_indexStep1;
    static int s_indexStep2;
    static int s_linesCount;
    static int s_tilesCount;
    static int s_startTileIndex;

    static int GetUnblockedLines ()
    {
        int index1 = s_startTileIndex;// + _indexStep2;
        int shumu1 = 0;

        while ( shumu1 < s_linesCount )
        {
            index1 += s_indexStep1;
            int index2 = index1;
            int shumu2 = 0;
            while ( ++ shumu2 <= s_tilesCount )
            {
                int value = s_phyHuanchong [ index2 ];

                if ( value >= PHY_SOLID ) break;

                index2 += s_indexStep2;
            }

            if ( shumu2 <= s_tilesCount ) break;

            ++ shumu1;
        }

        return shumu1;
    }


  


    static Jiaose s_indicator;
    static Jiaose s_toothy;
    static Jiaose s_launcher;    
    static Jiaose s_princess;   	

    static Jiaose s_toothyInterface;	
    static boolean s_isLaunched = false;
    static boolean s_isInTheAir = false;
    static boolean s_isClosed = false;
    static int s_ctrCloseTick = 0;	

   
   public static boolean s_isActiveGameScene = false;

   

    static int s_level = 0;
    static int s_levelSaved = 0;	
    static final int MAP_UP_BY_LEVEL = 3;	

    static boolean s_isNewCrow =false;

  
    static final int ZHEN_IN_THE_AIR = 100;

   

    static final int POWER_MAX = 4;
    static final int POWER_OK_TO_WALL = 3;	
    static final int POWER_OK_SEE_WALL = 1;		
    static final int INDICATOR_MOVE_STEP = 2;
    static final int POWER_STATUS_CHANGE = 20;	
	
    static int s_power = 0;

     

    static boolean s_isLoadInWall = false;	
    static int s_desX = 0;
    static int s_desY = 0;

    public static boolean s_cutBlood = false;	

    static boolean s_collideJiaoses = false;		
 

    static int s_desPrinX = 0;
    static int s_desPrinY = 0;


   static int s_loadX = 0;
   static int s_loadY = 0;
 

   static final int HEALTH_MAX = 100;
   
   static int[] s_lifeValue = {HEALTH_MAX , HEALTH_MAX};
   static int s_collideTime = 0; 


   static boolean s_isIntersect = false;


   static int MAP_EDGE_LEFT = 0;
   static int MAP_EDGE_RIGHT =  0;   
   static int MAP_EDGE_TOP = 0;
   static int MAP_EDGE_BOTTOM = 0;  



   
      //cuddles's position
   static final int LAUNCHER_SCREEN_X = 70 << 8;
   static final int LAUNCHER_SCREEN_Y = PINGMUDDD.sssCHUANNN_HEIGHT - 20 << 8; // 175 << 8;

         //launch position
   static final int LAUNCHER_SCREEN_OFFSETX = 20 << 8;
   static final int LAUNCHER_SCREEN_OFFSETY = 18 << 8;
     //band offset
   public static final int LAUNCHER_BAND_OFFSETX = 10 << 8;
   public static final int LAUNCHER_BAND_OFFSETY = 10 << 8;
     //toothy offset
   public static final int LAUNCHER_TOOTHY_OFFSETX = 25 << 8;
   public static final int LAUNCHER_TOOTHY_OFFSETY = 20 << 8;	 

   public static boolean s_startSlide = false;

   public static boolean s_fire = false;

   public static int s_preLideId = 0;
   public static int s_lideId = 0; // -3 , -2, -1, 0 , 1 , 2 , 3
   public static boolean s_sliding = false;

 
   //for fly screen position

   static final int FLY_SCREEN_X = 100 << 8;
   static final int FLY_SCREEN_Y = 100 << 8;  

   //for magnify
   static final int MAGINIFY_RATE = 4;

   //for diTU posiion
   static final int TOTAL_SCENE = 5;



   //for diTU change
	
   static final int SMALL_MAP_CENTER_X = 47 << 8;
   static final int SMALL_MAP_CENTER_Y = 66 << 8;

   static final int BIG_MAP_CENTER_X[] = {84 << 8, 100 << 8, 116 << 8};
   static final int BIG_MAP_CENTER_Y[] = {116 << 8, 180 << 8, 236 << 8};

   static final int SMALL_MAP_W = 48 << 8 ;
   static final int SMALL_MAP_H = 69 << 8;

   static final int BIG_MAP_W[] = {152 << 8, 168 << 8, 200 << 8};
   static final int BIG_MAP_H[] = {168 << 8, 264<< 8, 376 << 8} ;

   
//big
   static final int BAND_SIDE_Y [][] = {{212 << 8, 256 << 8},{325 << 8,360 << 8},{437<< 8 , 472 << 8}};

    

   static final int CAM_START_X = 0;
   static final int CAM_START_Y = 0;
   

   static final int MAP_ID_SMALL = 0;
   static final int MAP_ID_LARGE = 4;
//small
//   static final int BAND_SIDE_Y [][] = {{457 << 8, 535 << 8},{682 << 8,750 << 8},{890<< 8 , 974 << 8}};


   static final int RIVER_UP = 0;
   static final int RIVER_DOWN = 1;
   static int s_side = RIVER_UP;


   //for ajiaose reaction
   static final int BANNER_REBOUND_VY = 2 << 8;

   //for ajiaose active need active right now ,ignore active zone
   static final int ID_ACTIVE_NO_ACTOR = -1;
   static int  s_forceActiveID = ID_ACTIVE_NO_ACTOR;

   //for if in the groud
       public static boolean s_inGround = false;
       public static boolean s_inGroundP = false;
   

   //after toothy get the princess and move down for some distance the rope will do some action.
    public static boolean s_isGetPrincess = false;

    public static final int GET_PRINCESS_CHEERS_ZHEN  = 40;

    public static boolean s_lostHold = false;



   //for game over
   public static boolean s_gameOver =false;

   public static final int GAME_OVER_DURATION = 50;

   //for hit duration
   public static final int HIT_STAY_DURATION = 20;


   //for prelude

   public static final int PRELUDE_HORSE = 0;
   public static final int PRELUDE_FIRE = 1;
   public static final int PRELUDE_PRINCESS = 2;
   public static final int PRELUDE_SKY = 3;
   public static final int PRELUDE_ROPE = 4;


   public static int PRELUDE_MAP_W;
   public static int PRELUDE_OFFSET_X = 0;

   public static final int PRELUDE_MAP_OFFSET = 0 ;

   public static final int PRELUDE_SCENE_ZHEN = 30;

   public static int s_preludeSceneSquence = 0;
   
   public static int s_preludeMapId = PRELUDE_HORSE;
  public static int s_preMapId = PRELUDE_HORSE;   

     public static boolean s_isTralier = true;



   

   public static final int MIMI_OFFSET_X = 20 << 8;
   public static final int MIMI_OFFSET_Y = 60 << 8;
   //for score
   public static final int TYPE_TOOTHY = 0;
   public static final int TYPE_PRINCESS = 1;   
   public static int[] s_score = new int[2];  //0 is toothy , 1 is princess
   public static boolean s_isHighScore = false;

   //for interface
   public static final int FACE_ANI_X = 5;
   public static final int FACE_ANI_Y = 10;

   //for burnt in the air
   public static boolean s_isBurntInAir = false;

   //for rope


       public static final int ROPE_ACTION_MOVE_DIS = 40; 
       public static final int TWO_BODY_DIS = 30;
  
	   public static final int ROPE_NUM = 6;
	   public static final int ROPE_HEIGHT = 20;

	   public static final int ROPE_OFFSET_X = -6;
	   public static final int ROPE_OFFSET_Y = 0;


   public static boolean s_isRopeBroken = false;


   //for fly hurt
   public static final int FLY_HURT_FLY_DURATION = 15;
   public static final int FLY_HURT_HIT_DURATION = 50;

   //for game over credit
   public static final int END_GAME_DURATION = 500;
   
   

   
	
    /**
     * Init Jiaoses's AI when it is actived
     */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -