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

📄 matriximage.java

📁 请多指教 这是一个常见的街霸游戏的源码 虽然简单 但是适合初学者 请主明 转载 我也是的
💻 JAVA
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. *//** * * @author Administrator */// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html// Decompiler options: packimports(3) fieldsfirst ansi // Source File Name:   MatrixImageimport javax.microedition.lcdui.Graphics;class MatrixImage{    public int width;    public int height;    public int matrix[][];    MatrixImage(int i, int j)    {        width = i;        height = j;        matrix = new int[i][j];    }    public MatrixImage crop(int i, int j, int k, int l)    {        MatrixImage matriximage = new MatrixImage(k, l);        for(int i1 = 0; i1 < k; i1++)        {            for(int j1 = 0; j1 < l; j1++)                matriximage.matrix[i1][j1] = matrix[i + i1][j + j1];        }        return matriximage;    }    public void setColor(int i, int j, int k)    {        matrix[i][j] = k;    }    public void paint(Graphics g, int i, int j)    {        for(int k = 0; k < width; k++)        {            for(int l = 0; l < height; l++)                if(matrix[k][l] != -1)                {                    g.setColor(matrix[k][l]);                    g.drawRect(i + k, j + l, 1, 1);                }        }    }}

⌨️ 快捷键说明

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