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

📄 screen.java

📁 手机上的SLG游戏
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
import javax.microedition.lcdui.*;
import java.util.Random;
import java.io.*;
import java.lang.*;
import javax.microedition.rms.*;
public class Screen extends EZCanvas implements Runnable{

    int chk_header = 93;

        // 慺嵽撉傒庢傝帪偺buffer
        private static int read_buff = 3000;

        // 夋憸僉儍僢僔儏
        private static int cash_size = 20;

        // 廔椆廃夞
        private static int end_around = 3;

        // 儗儀儖偑忋偑傞宱尡抣検
        private int max_exp = 50;

        // 堦廃偼壗儅僗丠
        private int for_around = 30;

        /* 埲壓丄曄悢媦傃掕悢 */

        // 弌栚攝楍
        private int[] deme = new int[3];

        // 夋憸僉儍僢僔儏梡
        private int[] image_numb = new int[cash_size];
        private Image[] image_cash = new Image[cash_size];

        // 僒僀僐儘偼撈帺僉儍僢僔儏傪帩偨偣傞
        Image[] image_sai = new Image[4];

        // 儌乕僪夝愢
        // 0: 僞僀僩儖
        // 1: 僉儍儔慖戰
        // 2: 儅僢僾
        // 3: 愴摤
        // 4: 僨乕僞撉傒崬傒拞
        private static int mode = 0;

        // 僼僃乕僘夝愢
        // (2) 0:捠忢 1:僒僀僐儘僗僞乕僩 2:夞揮拞 3:僗僩僢僾 4:堏摦拞 5:僀儀儞僩
        // (3) 0:捠忢 1:愢柧
        private static int phase = 0;

        // 帺僉儍儔僗僥乕僞僗
        private int[] status = new int[50];

        // 僒僀僐儘忬懺(1-4)
        private static int sai_st = 1;

        // 僒僀僐儘偺栚
        private static int sai_num = 1;

        // 帺僉儍儔埵抲
        private static int ch_p = 0;

        // 揋僉儍儔僞僀僾
        private static int teki_t = 0;

        // 揋僉儍儔埵抲
        private static int teki_p = 0;

        // 揋僉儍儔偺僷儔
        private static int[][] teki_para = { { 15, 0, -2, 0, 0, 0 }, // 僪僋儘僗椢
                                             { 15, 2, -1, 0, 0, 0 },   // 僪僋儘僗拑
                                             { 20, 3, 2, 0, 0, 0 },   // 僩僎儘僗
                                             { 25, 5, 2, 0, 0, 0 },   // 僸僪乕儔
                                             { 30, 7, 4, 0, 0, 0 },   // 僑儞僝乕儔
                                             { 50, 10, 8, 0, 0, 0 }, // 杺墹
                                          // { 60, 12, 10, 0, 0, 0 } }; // 僂儖僂儖孨(Ver2)
                                             { 60, 15, 15, 0, 0, 0 } }; // 僂儖僂儖孨(Ver3)

        private int[] teki_stat = new int[6];

        // 偍懸偨偣僇僂儞僞乕
        private static int wait_cnt = 0;

        // 夋憸偺僒僀僘孮
        private static int[] image_sizes = { 268,264,125,125,125,252,181,186,207,196,
                              192,254,225,198,347,351,505,353,693,111,
                              2168,2620,231,220,225,233,152,150,155,167,170,174,
                              532,482,648,909,659,259,270,487,270,278,499,244,234,226,
                              330,332,625,372,481,543,498,700,780,507,666,688,544,606,
                              733,288,349,382,111 };

        // 壒惡偺僒僀僘孮
        private static int[] sound_sizes = { 362,390,2922,208,4837,4587 };

        private static int start_sound = 21;
        private static int end_sound = 0;

        //private static AudioPresenter[] sound = new AudioPresenter[ sound_sizes.length + 1 ];

        //private static AudioPresenter bgm = null;

        // hex嵗昗孮(x) 擇師尦偼[pattern][0-6]
        private static int[][] hex_x = {
                          { 40, 58, 58, 76, 76, 94, 94, 94, 94 },
                          { 40, 40, 58, 76, 94, 94, 76, 76, 76 },
                          { 58, 76, 94, 94, 76, 58, 40, 40, 40 },
                          { 58, 40, 40, 58, 76, 94, 94, 94, 94 },
                          { 76, 94, 94, 76, 58, 58, 40, 40, 40 },
                          { 76, 94, 94, 94, 76, 76, 58, 58, 58 },
                          { 94, 76, 58, 40, 40, 58, 58, 58, 58 },
                          { 94, 76, 58, 40, 40, 58, 76, 76, 76 }
                        };

        // hex嵗昗孮(y) 擇師尦偼[pattern][0-6]
        private static int[][] hex_y = {
                          { 0, 12, 36, 48, 72, 84, 108, 132, 156 },
                          { 0, 24, 36, 48, 60, 84, 96, 120, 144 },
                          { 0, 12, 24, 48, 60, 72, 84, 108, 132 },
                          { 0, 12, 36, 48, 60, 72, 96, 120, 144 },
                          { 0, 12, 36, 48, 60, 84, 96, 120, 144 },
                          { 0, 12, 36, 60, 72, 96, 108, 132, 156 },
                          { 0, 12, 24, 36, 60, 72, 96, 120, 144 },
                          { 0, 12, 24, 36, 60, 72, 84, 108, 132 }
                        };

        // hex忋偺event
        private int[] event = new int[9];

        // item偺柤慜
        private String[] item_name = new String[40];

        // item偺埿椡
        private int[] item_pow = new int[49];

        // hex僞僀僾
        private static int hex_t = 0;

        // 愴摤帪偺帺僉儍儔傾僯儊嵗昗
        private static int[][] char_act = { {65,45,25,63,67}, {45,25,15,45,45} };

        // 愴摤帪偺揋僉儍儔傾僯儊嵗昗
        private static int[][] teki_act_x = {
                                              {15,25,25,13,17},
                                              {15,25,25,13,17},
                                              {15,15,40,13,17},
                                              {10,10,10,8,12},
                                              {15,20,15,13,17},
                                              {2,2,2,0,4},
                                              {2,10,10,0,4}
                                            };

        private static int[][] teki_act_y = {
                                              {40,25,25,40,40},
                                              {40,25,25,40,40},
                                              {45,45,45,45,45},
                                              {17,17,17,17,17},
                                              {35,30,35,35,35},
                                              {13,13,13,13,13},
                                              {35,30,30,35,35}
                                            };

        // 僒僀僐儘僀儊乕僕
        private static Image sai = null;

        // 斈梡儊僢僙乕僕
        private static String comm_str;

        // 斈梡int曄悢
        private static int temp_int = 0;

        // 儔儞僟儉僆僽僕僃僋僩
        private Random rand = new Random();

        // 棴傔僼儔僌(愭摢帪)
        private static int tame = 0;

        // 僒僂儞僪儌乕僪
        private static int snd_mode = 0;

        // 夋柺僆僽僕僃僋僩
        private EZGraphics g;// = getGraphics();

        // 僼僅儞僩僆僽僕僃僋僩
        private static Font font;// = Font.getFont( Font.FACE_MONOSPACE | Font.SIZE_MEDIUM );

        // 揋柤慜
        private String[] teki_name = new String[7];

        // 揋嫮偝
        private static int teki_int = 1;

        // 揋弌尰儊僢僙乕僕僼儔僌
        private static int show_teki_name = 0;

        String HelpWord[][]={
        {"[得分评价的要点]","游戏结束时的得分评价","关键在于,是通过]周回","数][打倒魔王的回数]","[级别]这3项来进行统",
        "计计算的。具体是每个","都50点,尤其是当]周回","数]的时候为2倍,[打倒","魔王的回数]为3倍这样","进行合计给得分评价的。"},
        {"但是周回数为99周,级","别也是有一定限制的,","到了一定级别就不能在","升级了,因此这个时候","就需要靠打倒魔王来得",
        "取得分评价了。","[打倒魔王]","与魔王决战的关键是,","要必备厉害武器,是否","持有半月斩,满月斩等"},
        {"攻击类的道具是关键。","如果武器防护没有准备","充实,道具也不是良好","的状态,这种状态下想","要胜利就比较困难了。",
         "[升级]","完成的周回就越能出现","怪物,相对应的级别也","会变强。具体的是2周为","道格拉斯,3-5周为图格"},
        {"斯,6-7周是为黑多拉,","8-9周为钢佐拉,看以后","的周回重复。因此,周","回内,如何提高自己的","级别成为胜负的要点。",
         "[扔掉道具的勇气]","持有的道具是有制限的。","由于有时候根据回数没","有出现敌人,就扔掉与","此敌人相关的道具,相"},
        {"反当有效敌人出现在周","回的时候,是否拿取这","样的选择就很重要。完","成的周回就越能出现怪","物,在上面已经说过了,",
         "黑多拉,能进行状态攻","击,钢佐拉能进行盗取","道具的攻击。甚至这2种","的怪物和魔王还能进行","紧束缚这样的攻击。考"},
        {"虑到这些的话,相对于","状态攻击的是[圣水],","物品不被偷盗的是[十手","],防止金束缚的是[金","之针],进行这样的取",
         "舍可能是不错的。另外,","物品最大的持有数为7","的时候,即使出了新的","物品也不可能将此物品","放入包内。要注意物品"},
        {"的所有数,最好是保持","有6个物品的状态。","[积攒]","战斗时候的[积攒]是非","常有效的指令。如果反",
         "复使用[积攒],这个积","攒的效果就可以几倍的","使出来。对于厉害的对","手不仅是可以使用一次","的,2次,3次的攻击也"},
        {"是可以的。另外,半月","斩和满月斩一起使用也","是可以的。","","",
         "","","","",""},

    };


        Image offimg;
        Graphics offG;

    public Screen() {
        super(Main.instance);

        offimg = Image.createImage(176,208);
        offG = offimg.getGraphics();
        g = getGraphics(offG);

        g.setColor(0);
        g.fillRect(0,0,176,208);

        font= Font.getFont(Font.FACE_SYSTEM,Font.STYLE_BOLD,Font.SIZE_SMALL);
        g.setFont(font);




        // 揋偺柤慜
                teki_name[0] = "骷髅1";
                teki_name[1] = "骷髅2";
                teki_name[2] = "图格罗";
                teki_name[3] = "黑多";
                teki_name[4] = "钢左";
                teki_name[5] = "魔王";
                teki_name[6] = "迟迟君";

                // item_pow傪弶婜壔
                for( int i = item_pow.length - 1; i >= 0; i-- ){
                        item_pow[i] = 0;
                }

                item_name[1] = "草药";
                item_name[2] = "药水";
                item_name[3] = "补品";
                item_name[4] = "棒子";
                item_name[5] = "到达的声音";
                item_name[6] = "钥匙";
                item_name[7] = "仙丹";
                item_name[8] = "千里眼";
                item_name[9] = "龙的眼泪";
                item_name[10] = "星的祝福";
                item_name[11] = "月的祝福";
                item_name[12] = "半月斩";
                item_name[13] = "满月斩";
                item_name[14] = "十手";
                item_name[15] = "圣水";
                item_name[16] = "金针";
                item_name[17] = "妖精粉";
                item_name[18] = "盾工的力量";
                item_name[19] = "剑工的力量";

                // 晲婍
                item_name[20] = "棍棒";
                item_name[21] = "青铜剑";
                item_name[22] = "钢铁剑";
                item_name[23] = "圣剑";
                item_name[24] = "大蛇之剑";
                item_name[25] = "魔法之剑";
                item_name[26] = "贤者之杖";
                item_name[27] = "王者之剑";
                item_name[28] = "暗黑之剑";
                item_name[29] = "双头剑";

                item_pow[20] = 3;
                item_pow[21] = 5;
                item_pow[22] = 7;
                item_pow[23] = 15;
                item_pow[24] = 8;
                item_pow[25] = 8;
                item_pow[26] = 5;
                item_pow[27] = 20;
                item_pow[28] = 30;
                item_pow[29] = 8;

                // 杊嬶
                item_name[30] = "皮革服";
                item_name[31] = "锁子甲";
                item_name[32] = "黑色铠甲";
                item_name[33] = "龙鳞铠甲";
                item_name[34] = "魔法服";
                item_name[35] = "天使的服饰";
                item_name[36] = "天空铠甲";
                item_name[37] = "镜铠甲";
                item_name[38] = "勇者的铠甲";
                item_name[39] = "暗黑铠甲";

                item_pow[30] = 3;
                item_pow[31] = 5;
                item_pow[32] = 7;
                item_pow[33] = 8;
                item_pow[34] = 8;
                item_pow[35] = 8;
                item_pow[36] = 20;
                item_pow[37] = 5;
                item_pow[38] = 12;
                item_pow[39] = 30;

                // start_sound 傪寁嶼
                for( int i = image_sizes.length - 1; i >= 0; i-- ){
                        start_sound += image_sizes[i];
                }

                // end_sound 傪寁嶼
                for( int i = sound_sizes.length - 1; i >= 0; i-- ){
                        end_sound += sound_sizes[i];

⌨️ 快捷键说明

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