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

📄 flygencavans.java

📁 这是一款竖版射击手机游戏
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
                                                hero_sprite.hero_property[6]+=100;
                                                gongqb_foe[i].is_over = true;
                                                //gongqb_foe[i].setVisible(false);
                                            }
                                            if(gongqb_foe[i].foe_property[10] == 1){
                                                gongqb_foe[i].foe_property[10] = 0;
                                                hero_bullet.set_foe_bullet_point(gongqb_foe[i].getX()+gongqb_foe[i].getWidth()/2, gongqb_foe[i].getY()+gongqb_foe[i].getHeight()/2, gongqb_foe[i].foe_property[9], gongqb_foe[i].foe_property[0], gongqb_foe[i].foe_property[6]);
                                                hero_bullet.set_foe_bullet_speed(gongqb_foe[i].foe_property[9], gongqb_foe[i].foe_property[8], gongqb_foe[i].foe_property[7]);
                                            }
                                        }
                                    }
                                    //int tem_direction = Math.abs(randoms.nextInt()%100);
                                    if(boss_foe.isVisible()){
                                        System.out.println("当前的生命值为:"+boss_foe.foe_property[2]);
                                        this.boss_foe.update(0, hero_sprite);
                                        this.hero_bullet.check_attack_foe(boss_foe);
                                        hero_sprite.set_hero_rocket_blast(boss_foe,hero_rocket_zoubiao);
                                        if(boss_foe.foe_property[2]<=0 && !boss_foe.is_over){//Boss已经死亡
                                            
                                            hero_sprite.hero_property[6]+=1000;
                                            System.out.println("当前的关卡共用时为:"+game_each_time+"~~~~~~~~~~~~~~~~~~~~~~~~~~~~`");
                                            if(this.Labelling == 5){
                                                //通关
                                                this.Game_Two_State = 3;
                                            }else{//过关
                                                this.Labelling=Labelling+1;
                                                this.Game_Two_State = 6;
                                                move_direction = 6;
                                                fire_rocket = true;
                                                hero_sprite.hero_property[6]+=hero_sprite.hero_property[5];
                                                this.game_each_time = game_each_times[Labelling-1];
                                                this.wait_time = System.currentTimeMillis();
                                            }
                                            boss_foe.is_over = true;
                                            boss_foe.setVisible(false);
                                        }
                                        if(boss_foe.foe_property[2]>0 && !boss_foe.is_over){
                                            if(p_status-boss_foe.foe_property[2] >=500){
                                                //Boss召唤
                                                vocation_time = System.currentTimeMillis();
                                                
                                                p_status = boss_foe.foe_property[2];
                                                this.Game_Two_State = 2;//Boss召唤
                                                this.boss_x = boss_foe.getX();
                                                this.boss_y = boss_foe.getY();
                                            }
                                        }
                                        if(boss_foe.foe_property[10] == 1){
                                            boss_foe.foe_property[10] = 0;
                                            hero_bullet.set_foe_bullet_point(boss_foe.getX()+boss_foe.getWidth()/2-5, boss_foe.getY()+boss_foe.getHeight()/2+5, boss_foe.foe_property[9], boss_foe.foe_property[0], boss_foe.foe_property[6]);
                                            hero_bullet.set_foe_bullet_speed(boss_foe.foe_property[9], boss_foe.foe_property[8], 4);
                                        }
                                    }
                                    //剧情NPC
                                    if(this.shop_foe.isVisible()){
                                        shop_foe.check_npc_hit(hero_sprite);//.update(0, hero_sprite);
                                        if(shop_foe.foe_property[10]==1){
                                            this.Game_Two_State = 7;
                                            shop_foe.foe_property[10] =0;
                                            this.move_direction = 0;
                                        }
                                    }
                                    //当玩家的火箭爆炸时则进入此语句
                                    //if(hero_bullet.is_explosion){//已经爆炸
                                    //hero_sprite.set_hero_rocket_blast(boss_foe,hero_rocket_zoubiao);
                                    // }
                                    if(hero_sprite.hero_property[9]==1 && hero_sprite.hero_property[22] == 0){//玩家跟随者之弓箭跟随者的攻击
                                        if(hero_sprite.hero_servant.hero_servant_property[5] == 1){
                                            hero_sprite.hero_servant.hero_servant_property[5] = 0;
                                            hero_bullet.set_bullet_point(hero_sprite.hero_servant.getX()+hero_sprite.hero_servant.getWidth()/2-5, hero_sprite.hero_servant.getY(), 2);
                                            hero_bullet.set_bullet_speed();
                                        }
                                    }
                                    if(hero_sprite.isVisible())
                                        hero_bullet.check_attack_hero(hero_sprite);
                                    //update_award();//更新物品类
                                    fire();//玩家攻击
                                    draw(gg);
                                    if(hero_sprite.hero_currently_live_num<0){
                                        continue_time = System.currentTimeMillis();
                                    }
                                    input();
                                    if(this.game_each_time<=0)
                                        this.Game_Two_State = 5;
                                    break;
                                case 2://其它情况Boss召唤
                                    boss_call_effect(gg);
                                    break;
                                case 3://通关
                                    //
                                    //清空所有的变量
                                    this.Destroy_Object();
                                    this.Game_State = 1;
                                    //重置当前状态为开始菜单
                                    break;
                                case 4://玩家是否要继续游戏
                                    if(System.currentTimeMillis() - continue_time >=1000){
                                        hero_sprite.hero_currently_live_num--;
                                        continue_time = System.currentTimeMillis();
                                    }
                                    gg.setColor(0,0,0);
                                    gg.fillRect(0, 0, Screen_W, Screen_H);
                                    gg.setColor(255, 0, 0);
                                    gg.drawString("Continue...", (Screen_W-font.charWidth('C')*11)/2, (Screen_H-font.getHeight())/2, Graphics.TOP|Graphics.LEFT);
                                    gg.drawString(""+hero_sprite.hero_currently_live_num, (Screen_W-font.charWidth('C')*4)/2, (Screen_H-font.getHeight())/2+font.getHeight(),Graphics.TOP|Graphics.LEFT);
                                    if((v_GameCode == Canvas.FIRE) && keyPre){
                                        keyPre = false;
                                        Game_Two_State = 1;//设置为游戏进行状态
                                        hero_sprite.hero_currently_live_num = -1;
                                        if(!hero_sprite.Is_Continue){
                                            hero_sprite.Is_Continue = true;
                                        }
                                    }
                                    break;
                                case 5://游戏结束,进入菜单选项
                                    gg.setColor(0,0,0);
                                    gg.fillRect(0, 0, this.Screen_W, this.Screen_H);
                                    switch(is_write){
                                        case 1://检查记录是否符合存储hero_sprite.hero_property[6]
                                            if (2500>HighScoreComparator.getMaxPoint()){//比较最高分
                                                this.is_write = 2;
                                            }else{
                                                gg.setColor(255,0,0);
                                                gg.drawString("GameOver", (Screen_W-font.charWidth('C')*8)/2, (Screen_H-font.getHeight())/2, Graphics.TOP|Graphics.LEFT);
                                                if((v_GameCode == Canvas.FIRE) && keyPre){
                                                    keyPre = false;
                                                    Game_Two_State = 0;//设置为游戏进行状态
                                                    //在这里进行判断,若得分大于发前记录则进入存储菜单,反之则进入菜单选项
                                                    Game_State = 3;//进入菜单选项
                                                    is_write = 0;
                                                    //所有对象清空~~~~~
                                                    Destroy_Object();
                                                }
                                            }
                                            break;
                                        case 2://记录的存储
                                            gg.drawImage(storage_img, (Screen_W-storage_img.getWidth())/2, (Screen_H-storage_img.getHeight())/2, Graphics.TOP|Graphics.LEFT);
                                            //画指针
                                            gg.drawImage(hand_img, (Screen_W-storage_img.getWidth())/2+hand_array[i_status], (Screen_H-storage_img.getHeight())/2+82,Graphics.TOP|Graphics.LEFT);
                                            gg.setColor(212,212,141);
                                            gg.drawString(""+String.valueOf(playerNameChar), (Screen_W-storage_img.getWidth())/2+60, (Screen_H-storage_img.getHeight())/2+46, Graphics.TOP|Graphics.LEFT);
                                            if (keyPre && v_keyCode==-6){//已经保存数据
                                                String pName="无名";
                                                if (playerNameChar[0]!=' '){
                                                    pName=String.valueOf(playerNameChar);//转换
                                                    pName=pName.trim();
                                                }
                                                HighScoreComparator.saveRec(pName,10);
                                                this.Game_State = 3;
                                                this.Game_Two_State = 0;
                                                this.is_write = 0;
                                                //所有对象清空~~~~~
                                                Destroy_Object();
                                            }else if(keyPre && v_keyCode==-7){//数据放弃保存
                                                this.Game_State = 3;
                                                this.Game_Two_State = 0;
                                                this.is_write = 0;
                                                //所有对象清空~~~~~
                                                Destroy_Object();
                                            }else if (keyPre && v_GameCode==Canvas.LEFT){
                                                if (--i_status<0)
                                                    i_status++;
                                            }else if(keyPre && v_GameCode==Canvas.RIGHT){
                                                if(++i_status>5)
                                                    i_status=5;
                                            }else if(keyPre && v_GameCode==Canvas.FIRE){
                                                switch(i_status){//j_status  控制字符的位置
                                                    case 0://"A"
                                                        playerNameChar[j_status]='A';
                                                        break;
                                                    case 1://B
                                                        playerNameChar[j_status]='B';
                                                        break;
                                                    case 2://C
                                                        playerNameChar[j_status]='C';
                                                        break;
                                                    case 3://D
                                                        playerNameChar[j_status]='D';
                                                        break;
                                                    case 4://撤销
                                                        playerNameChar[j_status]=' ';
                                                        if (--j_status<0) j_status++;
                                                        break;
                                                    case 5://确定
                                                        if(playerNameChar[j_status]!=' '){
                                                            if(++j_status>4) j_status--;
     

⌨️ 快捷键说明

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