?? flygencavans.java
字號(hào):
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("當(dāng)前的生命值為:"+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已經(jīng)死亡
hero_sprite.hero_property[6]+=1000;
System.out.println("當(dāng)前的關(guān)卡共用時(shí)為:"+game_each_time+"~~~~~~~~~~~~~~~~~~~~~~~~~~~~`");
if(this.Labelling == 5){
//通關(guān)
this.Game_Two_State = 3;
}else{//過(guò)關(guān)
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;
}
}
//當(dāng)玩家的火箭爆炸時(shí)則進(jìn)入此語(yǔ)句
//if(hero_bullet.is_explosion){//已經(jīng)爆炸
//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();//更新物品類(lèi)
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://通關(guān)
//
//清空所有的變量
this.Destroy_Object();
this.Game_State = 1;
//重置當(dāng)前狀態(tài)為開(kāi)始菜單
break;
case 4://玩家是否要繼續(xù)游戲
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;//設(shè)置為游戲進(jìn)行狀態(tài)
hero_sprite.hero_currently_live_num = -1;
if(!hero_sprite.Is_Continue){
hero_sprite.Is_Continue = true;
}
}
break;
case 5://游戲結(jié)束,進(jìn)入菜單選項(xiàng)
gg.setColor(0,0,0);
gg.fillRect(0, 0, this.Screen_W, this.Screen_H);
switch(is_write){
case 1://檢查記錄是否符合存儲(chǔ)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;//設(shè)置為游戲進(jìn)行狀態(tài)
//在這里進(jìn)行判斷,若得分大于發(fā)前記錄則進(jìn)入存儲(chǔ)菜單,反之則進(jìn)入菜單選項(xiàng)
Game_State = 3;//進(jìn)入菜單選項(xiàng)
is_write = 0;
//所有對(duì)象清空~~~~~
Destroy_Object();
}
}
break;
case 2://記錄的存儲(chǔ)
gg.drawImage(storage_img, (Screen_W-storage_img.getWidth())/2, (Screen_H-storage_img.getHeight())/2, Graphics.TOP|Graphics.LEFT);
//畫(huà)指針
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){//已經(jīng)保存數(shù)據(jù)
String pName="無(wú)名";
if (playerNameChar[0]!=' '){
pName=String.valueOf(playerNameChar);//轉(zhuǎn)換
pName=pName.trim();
}
HighScoreComparator.saveRec(pName,10);
this.Game_State = 3;
this.Game_Two_State = 0;
this.is_write = 0;
//所有對(duì)象清空~~~~~
Destroy_Object();
}else if(keyPre && v_keyCode==-7){//數(shù)據(jù)放棄保存
this.Game_State = 3;
this.Game_Two_State = 0;
this.is_write = 0;
//所有對(duì)象清空~~~~~
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://撤銷(xiāo)
playerNameChar[j_status]=' ';
if (--j_status<0) j_status++;
break;
case 5://確定
if(playerNameChar[j_status]!=' '){
if(++j_status>4) j_status--;
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -