亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? hero.java

?? 這是一款豎版射擊手機游戲
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/*
 * Hero.java
 *
 * Created on 2006年4月15日, 下午5:16
 *
 * To change this template, choose Tools | Options and locate the template under
 * the Source Creation and Management node. Right-click the template and choose
 * Open. You can then make changes to the template in the Source Editor.
 */
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.game.*;
import javax.microedition.lcdui.Image;
import java.util.Random;
import java.io.*;

/**
 *
 * @author Administrator
 */
public class Hero extends Sprite {
    
    /** Creates a new instance of Hero */
    public int hero_live_num = 2;
    public static int hero_image_w;
    public static int hero_image_h;
    public static boolean Is_Continue = false;//標志是否要繼續玩家的生命
    private long Start_Continue_Time;//要繼續游戲必需在規定的時間內按下規定的按鍵方能進行,這里計下開始的時間
    
    public int hero_ph;//玩家的生命值
    private int hero_arrow_sort;//弓箭的類型
    private int hero_arrow_gunshot;//弓箭的射程
    private int hero_arrow_power;//弓箭的殺傷力
    private int hero_rocket_num;//玩家火箭的最大使用次數
    private int hero_arrow_speed;//弓箭的速度
    private int hero_speed;//玩家的移動速度
    private int hero_rocket_power;//玩家火箭的殺傷力
    private int hero_rocket_radius;//玩家火箭的殺傷半徑
    public int hero_currently_live_num;//玩家當前剩余生命數
    public int hero_servant_space;//玩家跟隨者移動范圍即是玩家的殺傷半徑
    
    private int horse_live_num=5;
    
    private long frame_start;
    /**
     *玩家的屬性397203247
     */
    private static final int PROPERTY = 29;
    public int[] hero_property = new int[PROPERTY];//各各參數參照文檔說明
    
    /**
     *玩家的幀序列
     */
    //private int[] Up_FrameSequence = {9,10,11};
    private int[] Up_Stop = new int[1];//{22};
    //private int[] Left_FrameSequence = {0,1,2};
    private int[] Left_Stop = new int[1];//{6};
    //private int[] Right_FrameSequence = {3,4,5};
    private int[] Right_Stop = new int[1];// {6};
    //private int[] Down_FrameSequence = {6,7,8};
    private int[] Down_Stop = new int[1];// {22};
    private int[][] Fire_FrameSequence = {//左中右
        {13,14,15},{16,17,18},{19,20,21}
    };
    private int[] Hero_FrameSequence;//
    private int[] Hero_Fire_FrameSequence;//攻擊幀
    private int[] hero_walk_framesequence = {//上下左右3788
        17,22,18,22,
                17,22,18,22,
                6,7,8,9,10,11,
                6,7,8,9,10,11,
    };
    private int[] hero_fire_framesequence = {//變身前的攻擊幀左中右;;;;上下左右
        //攻擊方向為左
        //23,24,24,
        //23,24,24,
        34,35,35,
                34,35,35,
                13,14,14,
                36,37,37,//要翻轉
                //攻擊方向為中
                22,21,21,
                22,21,21,
                4,5,5,
                4,5,5,//要翻轉
                //攻擊方向為右,全部翻轉
                //23,24,24,
                //23,24,24,
                34,35,35,
                34,35,35,
                36,37,37,//這個不用翻轉
                13,14,14
    };
    private int[] hero_change_walk_framesequence ={//上下左右
        2,1,3,1,
                2,1,3,1,
                26,27,28,29,30,31,
                26,27,28,29,30,31
    };
    private int[] hero_change_fire_framesequence = {//變身后的攻擊幀左中右;;;;上下左右
        //攻擊方向為左
        19,20,20,
                19,20,20,
                32,33,33,
                12,25,25,//要翻轉
                //攻擊方向為中
                0,1,1,
                0,1,1,
                15,16,16,
                15,16,16,//要翻轉
                //攻擊方向為右,全部翻轉
                19,20,20,
                19,20,20,
                12,25,25,//不用翻轉
                32,33,33
    };
    private int[] Change_FrameSequence = {//變身幀
        38,38,38
    };
    //public int hero_property[24] = 1;//移動的方向
    public boolean hero_fire;//標志玩家是否要開火
    private int hero_fire_num;//一定時間后開火
    private boolean is_move = true;
    public boolean is_change =false;//標志玩家是否要變身
    private boolean is_play_frame=false;//標志是否要播放玩家變身幀
    //-----------------------------------------------------跟隨者信息-------
    public HeroServant hero_servant;
    public Image servant_image;
    public static Foe servant_attack_target;//讓跟隨者去行攻擊的對象
    //----------------------------------------------------------------------
    
    public int award_money_num;//要獎勵玩家的金錢數
    
    
    public Hero(Image image,int width,int height,int hero_live,int hero_ph,int arrow_sort,int arrow_gunshot,int arrow_power,int rocket_num,int arrow_speed,int speed,int rocket_power,int rocket_radius) {
        super(image, width, height);
        defineReferencePixel(width/2, height/2);
        ini_array();
        this.hero_image_h = height;
        this.hero_image_w = width;
        this.hero_live_num = hero_live;//玩家的生命次數
        this.hero_ph = hero_ph;
        this.hero_arrow_sort = arrow_sort;
        this.hero_arrow_gunshot = arrow_gunshot;
        this.hero_arrow_power = arrow_power;
        this.hero_rocket_num = rocket_num;
        this.hero_arrow_speed = arrow_speed;
        this.hero_speed = speed;
        this.hero_rocket_power = rocket_power;//火箭的殺傷力
        this.hero_rocket_radius = rocket_radius;//火箭的殺傷半徑
        hero_fire = false;
        this.hero_currently_live_num = this.hero_live_num;
    }
    
    public void ini_array(){
        for(int i = 0;i<PROPERTY;i++){
            hero_property[i] = 0;
        }
    }
    /**
     *得到玩家的坐標
     */
    public int get_hero_x(){
        return getX();
    }
    public int get_hero_y(){
        return getY();
    }
    /**
     *初始化玩家的必要屬性
     */
    public void ini_import_property(){
        hero_property[0] = this.hero_ph;
        hero_property[1] = this.hero_arrow_sort;
        hero_property[2] = this.hero_arrow_gunshot;
        hero_property[3] = this.hero_arrow_power;
        hero_property[4] = this.hero_rocket_num;
        hero_property[8] = 2;//初始化為箭向上射擊
        hero_property[9] = 0;
        hero_property[10] = 0;
        hero_property[11] = 0;
        hero_property[12] = 0;
        hero_property[13] = 0;
        hero_property[14] = 0;
        hero_property[15] = 0;
        hero_property[16] = 0;
        hero_property[17] = 0;
        hero_property[18] = this.hero_arrow_speed;
        hero_property[19] = 0;
        hero_property[20] = this.hero_speed;
        hero_property[21] = 5;
        hero_property[22] = 0;
        hero_property[23] = 0;
        hero_property[24] = 1;
        hero_property[25] = 0;
        hero_property[26] = 0;
        hero_property[27] = hero_rocket_power;
        hero_property[28] = hero_rocket_radius;
        
        Hero_FrameSequence = hero_walk_framesequence;
        Hero_Fire_FrameSequence = hero_fire_framesequence;
        Up_Stop[0] =hero_walk_framesequence[3];
        Left_Stop[0] =hero_walk_framesequence[8];
        Right_Stop[0] = hero_walk_framesequence[8];
        Down_Stop[0] = hero_walk_framesequence[3];
        
        hero_servant_space = 50;
        //this.hero_currently_live_num = this.hero_live_num;
    }
    
    /**
     *設置玩家的坐標
     */
    public void set_hero_point(int current_x,int current_y){
        setPosition(current_x, current_y);
    }
    /**
     *@parameter yview 當前屏幕的頂點坐標.foe 進入攻擊范圍的敵人.g 畫筆
     */
    public void update(int yview,Graphics g){
        if(hero_property[12]==1){//穿心箭
            hero_property[1] = 1;//更改當前弓箭的類型
            hero_property[12] = -1;//改變當前屬性的值
        }
        if(hero_property[12]==2){//多重箭
            hero_property[1] = 2;//更改當前弓箭的類型
            hero_property[12] = -1;
        }
        if(hero_property[13] == 1){//讓玩家的箭的威力加倍
            hero_property[3] *=2;
            hero_property[13] = -1;
        }
        if(hero_property[14] == 1 && hero_property[1] !=1){//讓玩家的射程加倍
            hero_property[14] = -1;
            hero_property[2] *=2;
        }
        if(hero_property[15] == 1){//讓玩家弓箭速度加倍
            hero_property[15] = -1;
            hero_property[18] *=2;
        }
        if(hero_property[16] == 1){//召喚馬匹
            hero_property[19] = horse_live_num;
            hero_property[20] *=2;
            this.Hero_FrameSequence = this.hero_change_walk_framesequence;
            this.Hero_Fire_FrameSequence = this.hero_change_fire_framesequence;
            Up_Stop[0] =this.Hero_FrameSequence[3];
            Left_Stop[0] =this.Hero_FrameSequence[8];
            Right_Stop[0] = this.Hero_FrameSequence[8];
            Down_Stop[0] = this.Hero_FrameSequence[3];
            hero_property[16] = -1;
        }
        if(hero_property[19]<=0 && hero_property[16]==-1){
            hero_property[16] =0;
            hero_property[20] /=2;
            this.Hero_FrameSequence = this.hero_walk_framesequence;
            this.Hero_Fire_FrameSequence = this.hero_fire_framesequence;
            Up_Stop[0] =this.Hero_FrameSequence[3];
            Left_Stop[0] =this.Hero_FrameSequence[8];
            Right_Stop[0] = this.Hero_FrameSequence[8];
            Down_Stop[0] = this.Hero_FrameSequence[3];
        }
        if(hero_property[26] == 1){
            hero_property[26] = 0;
            hero_property[5] +=award_money_num;//增加玩家的金錢數
        }
        if(hero_property[17] == 1){//加生命值
            hero_property[0] = hero_ph;
            hero_property[17] = 0;
        }
        if(hero_property[22] == 1 && hero_property[9] == 1){//生成玩家跟隨者
            hero_property[22] = 0;
            //hero_property[24] = 50;//跟隨者可移動的范圍
            if(hero_property[11] == 1){//弓箭跟隨者
                hero_servant = new HeroServant(FlyGenCavans.gongjian_servant, 22,22);
                hero_servant.setPosition(getX() - getWidth(), getY());
                //hero_servant.ini_import_property();
            }else if(hero_property[11] == 2){//刀箭跟隨者
                hero_servant = new HeroServant(FlyGenCavans.daojian_servant, 20, 29);
                hero_servant.setPosition(getX() + getWidth()/2, getY()-getHeight());
            }
                hero_servant.ini_import_property();
        }
        if(hero_property[9]==1){
            hero_servant.update_servant(yview, this);
            hero_servant.paint(g);
        }
        if(is_change){//播放變身動畫
            //System.out.println("開始變身!!!!!!!");
            this.setFrameSequence(Change_FrameSequence);
            frame_start = System.currentTimeMillis();
            this.is_play_frame = true;
            this.hero_property[24] = 1;
            this.is_change = false;
        }
        if(is_play_frame){
            if(System.currentTimeMillis()-frame_start > 50){
                nextFrame();
                frame_start = System.currentTimeMillis();
            }
            if(this.getFrame()==2){
                is_play_frame =false;
            }
        }
        set_hero_fire();
    }
    /**
     *向上運動
     */
    public void up_movie(int yview){
        if(!is_play_frame){
            if(hero_property[24] !=1 || !is_move){
                change_direction(1);
            } else
                move(0,-hero_property[20]);
            if(getY() < yview + 45){
                setPosition(getX(), yview+45);
            }
            nextFrame();
        }
    }
    /**
     *向下運動
     */
    public void down_movie(int yview){
        if(!is_play_frame){
            if(hero_property[24] != 2 || !is_move){
                change_direction(2);
            } else
                this.move(0, hero_property[20]);
            if(getY() > yview + 158){
                setPosition(getX(),(yview + 158));
            }
            nextFrame();
        }
    }
    /**
     *向左運動
     */
    public void left_movie(){
        if(!is_play_frame){
            if(hero_property[24] != 3 || !is_move){

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久99精品久久久久久| 91网站视频在线观看| 欧美一区二区三区公司| 在线91免费看| 久久久久青草大香线综合精品| 人人精品人人爱| 在线电影院国产精品| 亚洲中国最大av网站| 欧美日韩mp4| 国产高清视频一区| 依依成人精品视频| 欧美色电影在线| 国产一区二区网址| 国产精品久久久久一区二区三区共| 亚洲欧美电影一区二区| 555夜色666亚洲国产免| 欧美激情在线看| 精品一区二区三区不卡| 精品久久国产字幕高潮| 国产精品一二三在| 亚洲美女视频在线| 欧美丰满一区二区免费视频| 麻豆91精品91久久久的内涵| 久久综合久久综合亚洲| 91网站在线观看视频| 五月激情综合婷婷| 中文字幕+乱码+中文字幕一区| 99国产精品久| 激情五月激情综合网| 国产精品成人免费精品自在线观看 | 欧美va天堂va视频va在线| 国产精品一区二区不卡| 欧美美女激情18p| 精品国产免费一区二区三区香蕉| 国产iv一区二区三区| 七七婷婷婷婷精品国产| 亚洲卡通动漫在线| 国产欧美综合在线观看第十页| 欧美三级日韩三级| 国产不卡免费视频| 丰满亚洲少妇av| 成人午夜av影视| 国产成人在线看| 国产盗摄一区二区三区| 国产资源精品在线观看| 亚洲成人精品一区二区| 一区二区高清免费观看影视大全| 国产亚洲欧美在线| 日韩精品在线看片z| 欧美久久一二区| 欧美日韩激情一区二区| 色综合色综合色综合色综合色综合| zzijzzij亚洲日本少妇熟睡| 成人免费高清在线观看| 91麻豆国产精品久久| 奇米在线7777在线精品| 日韩欧美中文字幕一区| 欧美三日本三级三级在线播放| 91麻豆免费看片| 91精品国产美女浴室洗澡无遮挡| 欧美日韩国产另类一区| 26uuu国产一区二区三区| 中文子幕无线码一区tr| 亚洲综合色网站| 国产一区二区三区av电影 | 国产精品国产自产拍高清av| 亚洲色图另类专区| 免费高清视频精品| 色激情天天射综合网| 在线精品国精品国产尤物884a| 欧美丰满嫩嫩电影| 一区二区三区影院| 国产伦精一区二区三区| 制服丝袜av成人在线看| 亚洲蜜桃精久久久久久久| 国产一区二区在线视频| 欧美精三区欧美精三区| 欧美videofree性高清杂交| 亚洲视频中文字幕| 成人黄色电影在线 | 风流少妇一区二区| 91精品国产aⅴ一区二区| 欧美激情一区二区三区| 美腿丝袜一区二区三区| 色94色欧美sute亚洲线路二| 国产免费成人在线视频| 国产一区二区成人久久免费影院| 7878成人国产在线观看| 天天做天天摸天天爽国产一区| 99久久精品国产导航| 亚洲美女一区二区三区| 色狠狠色狠狠综合| 视频一区欧美日韩| 日韩免费看网站| 国产精品亚洲人在线观看| 久久综合色天天久久综合图片| 蜜臀99久久精品久久久久久软件| 欧美高清视频www夜色资源网| 日韩国产欧美视频| 久久久久久久av麻豆果冻| 风间由美一区二区av101| 亚洲一区二区欧美日韩| 日韩欧美美女一区二区三区| 日韩精品一二三四| 日韩精品一区二区三区中文精品| 成人激情文学综合网| 青青草国产精品97视觉盛宴| 久久只精品国产| 欧洲一区二区三区在线| 精品国产不卡一区二区三区| 日本女人一区二区三区| 国产精品久久久久久久蜜臀| 日韩一区二区在线观看视频| 99热这里都是精品| 麻豆成人91精品二区三区| 亚洲日本青草视频在线怡红院| 精品1区2区3区| 不卡的av电影在线观看| 精品一二三四在线| 亚洲一卡二卡三卡四卡无卡久久 | 91亚洲大成网污www| 国产精品影音先锋| 蜜桃av噜噜一区| 午夜精品一区二区三区三上悠亚| 国产精品久久久久久久久免费相片 | 婷婷久久综合九色国产成人| 亚洲免费观看在线视频| 精品奇米国产一区二区三区| 欧美三级电影一区| 欧美日韩亚洲综合一区二区三区| 成人av网站免费| 色老汉av一区二区三区| 欧美性xxxxxxxx| 欧美性欧美巨大黑白大战| 欧美色窝79yyyycom| 7777精品伊人久久久大香线蕉的| 在线成人午夜影院| 久久婷婷色综合| 国产精品丝袜一区| 亚洲午夜日本在线观看| 天堂va蜜桃一区二区三区 | 亚洲欧洲精品成人久久奇米网 | 日韩欧美一卡二卡| 91精品中文字幕一区二区三区| 欧美日韩一区二区三区高清| 欧美一区二区在线不卡| 精品粉嫩超白一线天av| 国产精品家庭影院| 午夜精品久久久久久| 国产mv日韩mv欧美| 欧美日韩国产a| 国产性天天综合网| 免费在线看一区| 色婷婷综合五月| 精品黑人一区二区三区久久| 国产精品不卡在线| 久久99国产精品久久| 色播五月激情综合网| 国产视频一区二区三区在线观看| 一区二区三区精品| 色综合久久精品| 久久久蜜臀国产一区二区| 天天色天天爱天天射综合| 91免费版在线| 亚洲黄色性网站| 国产资源在线一区| 91精品国模一区二区三区| 亚洲一区二区三区四区在线免费观看 | 中文字幕制服丝袜一区二区三区 | 99久久久精品免费观看国产蜜| 日韩欧美第一区| 免费看欧美美女黄的网站| 一本一道久久a久久精品| 国产精品久久久久久久久快鸭| 国产一区二区三区久久久| 欧美日韩专区在线| 婷婷成人激情在线网| 日韩免费视频一区二区| 国产91精品在线观看| 亚洲国产精华液网站w| 一本一本久久a久久精品综合麻豆| 国产精品久久久久久久久免费桃花 | 久久激情五月激情| 国产精品全国免费观看高清| 国产98色在线|日韩| 国产精品美女久久久久久久久久久| 一区二区三区波多野结衣在线观看| 成人在线一区二区三区| 日韩精品在线看片z| 91视视频在线直接观看在线看网页在线看 | 欧美一级精品在线| 免费久久99精品国产| 欧美国产精品劲爆| 91精品在线免费| 色综合天天性综合| 国产综合一区二区| 性欧美大战久久久久久久久| 337p粉嫩大胆色噜噜噜噜亚洲| 91片在线免费观看| 国产精品一区免费在线观看|