• 俄罗斯方块小游戏


    框架

    1. package 框架;
    2. import java.awt.image.BufferedImage;
    3. import java.util.Objects;
    4. /**
    5. * @author xiaoZhao
    6. * @date 2022/5/7
    7. * @describe
    8. * 小方块类
    9. * 方法: 左移、右移、下落
    10. */
    11. public class Cell {
    12. // 行
    13. private int row;
    14. // 列
    15. private int col;
    16. private BufferedImage image;
    17. public Cell() {
    18. }
    19. public Cell(int row, int col, BufferedImage image) {
    20. this.row = row;
    21. this.col = col;
    22. this.image = image;
    23. }
    24. public int getRow() {
    25. return row;
    26. }
    27. public void setRow(int row) {
    28. this.row = row;
    29. }
    30. public int getCol() {
    31. return col;
    32. }
    33. public void setCol(int col) {
    34. this.col = col;
    35. }
    36. public BufferedImage getImage() {
    37. return image;
    38. }
    39. public void setImage(BufferedImage image) {
    40. this.image = image;
    41. }
    42. @Override
    43. public String toString() {
    44. return "Cell{" +
    45. "row=" + row +
    46. ", col=" + col +
    47. ", image=" + image +
    48. '}';
    49. }
    50. @Override
    51. public boolean equals(Object o) {
    52. if (this == o) {
    53. return true;
    54. }
    55. if (!(o instanceof Cell)) {
    56. return false;
    57. }
    58. Cell cell = (Cell) o;
    59. return getRow() == cell.getRow() &&
    60. getCol() == cell.getCol() &&
    61. Objects.equals(getImage(), cell.getImage());
    62. }
    63. @Override
    64. public int hashCode() {
    65. return Objects.hash(getRow(), getCol(), getImage());
    66. }
    67. //左移动一格
    68. public void left(){
    69. col--;
    70. }
    71. //右移动一格
    72. public void right(){
    73. col++;
    74. }
    75. //下移动一格
    76. public void down(){
    77. row++;
    78. }
    79. }
    1. package 框架;
    2. import 形状.*;
    3. /**
    4. * @author xiaoZhao
    5. * @date 2022/5/11
    6. * @describe 编写四方格父类
    7. */
    8. public class Tetromino {
    9. public Cell[] cells = new Cell[4];
    10. //旋转的状态
    11. protected State[] states;
    12. //声明旋转次数
    13. protected int count = 10000;
    14. //左移方法
    15. public void moveLeft() {
    16. for (Cell cell : cells) {
    17. cell.left();
    18. }
    19. }
    20. //右移方法
    21. public void moveRight() {
    22. for (Cell cell : cells) {
    23. cell.right();
    24. }
    25. }
    26. //单元格下落
    27. public void moveDrop() {
    28. for (Cell cell : cells) {
    29. cell.down();
    30. }
    31. }
    32. //编写随机生成四方格
    33. public static Tetromino randomOne() {
    34. int num = (int) (Math.random() * 7);
    35. Tetromino tetromino = null;
    36. switch (num) {
    37. case 0:
    38. tetromino = new I();
    39. break;
    40. case 1:
    41. tetromino = new J();
    42. break;
    43. case 2:
    44. tetromino = new L();
    45. break;
    46. case 3:
    47. tetromino = new O();
    48. break;
    49. case 4:
    50. tetromino = new S();
    51. break;
    52. case 5:
    53. tetromino = new T();
    54. break;
    55. case 6:
    56. tetromino = new Z();
    57. break;
    58. }
    59. return tetromino;
    60. }
    61. //顺时针旋转的方法
    62. public void rotateRight() {
    63. if (states.length == 0) {
    64. return;
    65. }
    66. //旋转次数+1
    67. count++;
    68. State s = states[count % states.length];
    69. Cell cell = cells[0];
    70. int row = cell.getRow();
    71. int col = cell.getCol();
    72. cells[1].setRow(row + s.row1);
    73. cells[1].setCol(col + s.col1);
    74. cells[2].setRow(row + s.row2);
    75. cells[2].setCol(col + s.col2);
    76. cells[3].setRow(row + s.row3);
    77. cells[3].setCol(col + s.col3);
    78. }
    79. //逆时针旋转的方法
    80. public void rotateLeft() {
    81. if (states.length == 0) {
    82. return;
    83. }
    84. //旋转次数+1
    85. count--;
    86. State s = states[count % states.length];
    87. Cell cell = cells[0];
    88. int row = cell.getRow();
    89. int col = cell.getCol();
    90. cells[1].setRow(row + s.row1);
    91. cells[1].setCol(col + s.col1);
    92. cells[2].setRow(row + s.row2);
    93. cells[2].setCol(col + s.col2);
    94. cells[3].setRow(row + s.row3);
    95. cells[3].setCol(col + s.col3);
    96. }
    97. //四方格旋转状态的内部类
    98. protected class State {
    99. //存储四方格各元素的位置
    100. int row0, col0, row1, col1, row2, col2, row3, col3;
    101. public State() {
    102. }
    103. public State(int row0, int col0, int row1, int col1, int row2, int col2, int row3, int col3) {
    104. this.row0 = row0;
    105. this.col0 = col0;
    106. this.row1 = row1;
    107. this.col1 = col1;
    108. this.row2 = row2;
    109. this.col2 = col2;
    110. this.row3 = row3;
    111. this.col3 = col3;
    112. }
    113. public int getRow0() {
    114. return row0;
    115. }
    116. public void setRow0(int row0) {
    117. this.row0 = row0;
    118. }
    119. public int getCol0() {
    120. return col0;
    121. }
    122. public void setCol0(int col0) {
    123. this.col0 = col0;
    124. }
    125. public int getRow1() {
    126. return row1;
    127. }
    128. public void setRow1(int row1) {
    129. this.row1 = row1;
    130. }
    131. public int getCol1() {
    132. return col1;
    133. }
    134. public void setCol1(int col1) {
    135. this.col1 = col1;
    136. }
    137. public int getRow2() {
    138. return row2;
    139. }
    140. public void setRow2(int row2) {
    141. this.row2 = row2;
    142. }
    143. public int getCol2() {
    144. return col2;
    145. }
    146. public void setCol2(int col2) {
    147. this.col2 = col2;
    148. }
    149. public int getRow3() {
    150. return row3;
    151. }
    152. public void setRow3(int row3) {
    153. this.row3 = row3;
    154. }
    155. public int getCol3() {
    156. return col3;
    157. }
    158. public void setCol3(int col3) {
    159. this.col3 = col3;
    160. }
    161. @Override
    162. public String toString() {
    163. return "State{" +
    164. "row0=" + row0 +
    165. ", col0=" + col0 +
    166. ", row1=" + row1 +
    167. ", col1=" + col1 +
    168. ", row2=" + row2 +
    169. ", col2=" + col2 +
    170. ", row3=" + row3 +
    171. ", col3=" + col3 +
    172. '}';
    173. }
    174. }
    175. }

    形状颜色

    1. package 形状;
    2. import 主.TetrisDome;
    3. import 框架.Cell;
    4. import 框架.Tetromino;
    5. /**
    6. * @author xiaoZhao
    7. * @date 2022/5/11
    8. * @describe
    9. */
    10. public class I extends Tetromino {
    11. public I() {
    12. cells[0] = new Cell(0,4, TetrisDome.I);
    13. cells[1] = new Cell(0,3, TetrisDome.I);
    14. cells[2] = new Cell(0,5, TetrisDome.I);
    15. cells[3] = new Cell(0,6, TetrisDome.I);
    16. //共有两种旋转状态
    17. states =new State[2];
    18. //初始化两种状态的相对坐标
    19. states[0]=new State(0,0,0,-1,0,1,0,2);
    20. states[1]=new State(0,0,-1,0,1,0,2,0);
    21. }
    22. }
    1. package 形状;
    2. import 主.TetrisDome;
    3. import 框架.Cell;
    4. import 框架.Tetromino;
    5. /**
    6. * @author xiaoZhao
    7. * @date 2022/5/11
    8. * @describe
    9. */
    10. public class J extends Tetromino {
    11. public J() {
    12. cells[0] = new Cell(0,4, TetrisDome.J);
    13. cells[1] = new Cell(0,3, TetrisDome.J);
    14. cells[2] = new Cell(0,5, TetrisDome.J);
    15. cells[3] = new Cell(1,5, TetrisDome.J);
    16. states=new State[4];
    17. states[0]=new State(0,0,0,-1,0,1,1,1);
    18. states[1]=new State(0,0,-1,0,1,0,1,-1);
    19. states[2]=new State(0,0,0,1,0,-1,-1,-1);
    20. states[3]=new State(0,0,1,0,-1,0,-1,1);
    21. }
    22. }
    1. package 形状;
    2. import 主.TetrisDome;
    3. import 框架.Cell;
    4. import 框架.Tetromino;
    5. /**
    6. * @author xiaoZhao
    7. * @date 2022/5/11
    8. * @describe
    9. */
    10. public class L extends Tetromino {
    11. public L() {
    12. cells[0] = new Cell(0,4, TetrisDome.L);
    13. cells[1] = new Cell(0,3, TetrisDome.L);
    14. cells[2] = new Cell(0,5, TetrisDome.L);
    15. cells[3] = new Cell(1,3, TetrisDome.L);
    16. states=new State[4];
    17. states[0]=new State(0,0,0,-1,0,1,1,-1);
    18. states[1]=new State(0,0,-1,0,1,0,-1,-1);
    19. states[2]=new State(0,0,0,1,0,-1,-1,1);
    20. states[3]=new State(0,0,1,0,-1,0,1,1);
    21. }
    22. }
    1. package 形状;
    2. import 主.TetrisDome;
    3. import 框架.Cell;
    4. import 框架.Tetromino;
    5. /**
    6. * @author xiaoZhao
    7. * @date 2022/5/11
    8. * @describe
    9. */
    10. public class O extends Tetromino {
    11. public O() {
    12. cells[0] = new Cell(0, 4, TetrisDome.O);
    13. cells[1] = new Cell(0, 5, TetrisDome.O);
    14. cells[2] = new Cell(1, 4, TetrisDome.O);
    15. cells[3] = new Cell(1, 5, TetrisDome.O);
    16. //无旋转状态
    17. states = new State[0];
    18. }
    19. }
    1. package 形状;
    2. import 主.TetrisDome;
    3. import 框架.Cell;
    4. import 框架.Tetromino;
    5. /**
    6. * @author xiaoZhao
    7. * @date 2022/5/11
    8. * @describe
    9. */
    10. public class S extends Tetromino {
    11. public S() {
    12. cells[0] = new Cell(0,4, TetrisDome.S);
    13. cells[1] = new Cell(0,5, TetrisDome.S);
    14. cells[2] = new Cell(1,3, TetrisDome.S);
    15. cells[3] = new Cell(1,4, TetrisDome.S);
    16. //共有两种旋转状态
    17. states =new State[2];
    18. //初始化两种状态的相对坐标
    19. states[0]=new State(0,0,0,1,1,-1,1,0);
    20. states[1]=new State(0,0,1,0,-1,-1,0,-1);
    21. }
    22. }
    1. package 形状;
    2. import 主.TetrisDome;
    3. import 框架.Cell;
    4. import 框架.Tetromino;
    5. /**
    6. * @author xiaoZhao
    7. * @date 2022/5/11
    8. * @describe
    9. */
    10. public class T extends Tetromino {
    11. public T() {
    12. cells[0] = new Cell(0,4, TetrisDome.T);
    13. cells[1] = new Cell(0,3, TetrisDome.T);
    14. cells[2] = new Cell(0,5, TetrisDome.T);
    15. cells[3] = new Cell(1,4, TetrisDome.T);
    16. states=new State[4];
    17. states[0]=new State(0,0,0,-1,0,1,1,0);
    18. states[1]=new State(0,0,-1,0,1,0,0,-1);
    19. states[2]=new State(0,0,0,1,0,-1,-1,0);
    20. states[3]=new State(0,0,1,0,-1,0,0,1);
    21. }
    22. }
    1. package 形状;
    2. import 主.TetrisDome;
    3. import 框架.Cell;
    4. import 框架.Tetromino;
    5. /**
    6. * @author xiaoZhao
    7. * @date 2022/5/11
    8. * @describe
    9. */
    10. public class Z extends Tetromino {
    11. public Z() {
    12. cells[0] = new Cell(1,4, TetrisDome.Z);
    13. cells[1] = new Cell(0,3, TetrisDome.Z);
    14. cells[2] = new Cell(0,4, TetrisDome.Z);
    15. cells[3] = new Cell(1,5, TetrisDome.Z);
    16. //共有两种旋转状态
    17. states =new State[2];
    18. //初始化两种状态的相对坐标
    19. states[0]=new State(0,0,-1,-1,-1,0,0,1);
    20. states[1]=new State(0,0,-1,1,0,1,1,0);
    21. }
    22. }

    图片

     

     

     

     

     

     

     

     

    试测类

    1. package 主;
    2. import 框架.Cell;
    3. import 框架.Tetromino;
    4. import javax.imageio.ImageIO;
    5. import javax.swing.*;
    6. import java.awt.*;
    7. import java.awt.event.KeyAdapter;
    8. import java.awt.event.KeyEvent;
    9. import java.awt.event.KeyListener;
    10. import java.awt.image.BufferedImage;
    11. import java.io.File;
    12. import java.io.IOException;
    13. import java.security.cert.Certificate;
    14. /**
    15. * @author xiaoZhao
    16. * @date 2022/5/11
    17. * @describe 俄罗斯方块游戏主类
    18. */
    19. public class TetrisDome extends JPanel {
    20. //正在下落的方块
    21. private Tetromino currentOne = Tetromino.randomOne();
    22. //将要下落的方块
    23. private Tetromino nextOne = Tetromino.randomOne();
    24. //游戏主区域
    25. private Cell[][] wall = new Cell[18][9];
    26. //声明单元格的值
    27. private static final int CELL_SIZE = 48;
    28. //游戏分数池
    29. int[] scores_pool = {0, 1, 2, 5, 10};
    30. //当前游戏的分数
    31. private int totalScore = 0;
    32. //当前消除的行数
    33. private int totalLine = 0;
    34. //游戏三种状态 游戏中、暂停、结束
    35. public static final int PLING = 0;
    36. public static final int STOP = 1;
    37. public static final int OVER = 2;
    38. //当前游戏状态值
    39. private int game_state;
    40. //显示游戏状态
    41. String[] show_state = {"P[pause]", "C[continue]", "S[replay]"};
    42. //载入方块图片
    43. public static BufferedImage I;
    44. public static BufferedImage J;
    45. public static BufferedImage L;
    46. public static BufferedImage O;
    47. public static BufferedImage S;
    48. public static BufferedImage T;
    49. public static BufferedImage Z;
    50. public static BufferedImage background;
    51. static {
    52. try {
    53. I = ImageIO.read(new File("src/图片/I.png"));
    54. J = ImageIO.read(new File("src/图片/J.png"));
    55. L = ImageIO.read(new File("src/图片/L.png"));
    56. O = ImageIO.read(new File("src/图片/O.png"));
    57. S = ImageIO.read(new File("src/图片/S.png"));
    58. T = ImageIO.read(new File("src/图片/T.png"));
    59. Z = ImageIO.read(new File("src/图片/Z.png"));
    60. background = ImageIO.read(new File("src/图片/background.png"));
    61. } catch (IOException e) {
    62. e.printStackTrace();
    63. }
    64. }
    65. @Override
    66. public void paint(Graphics g) {
    67. g.drawImage(background, 0, 0, null);
    68. //平移坐标轴
    69. g.translate(22, 15);
    70. //绘制游戏主区域
    71. paintWall(g);
    72. //绘制正在下落的四方格
    73. paintCurrentOne(g);
    74. //绘制下一个将要下落的四方格
    75. paintNextOne(g);
    76. //绘制游戏得分
    77. paintSource(g);
    78. //绘制当前游戏状态
    79. paintState(g);
    80. }
    81. public void start() {
    82. game_state = PLING;
    83. KeyListener l = new KeyAdapter() {
    84. @Override
    85. public void keyPressed(KeyEvent e) {
    86. int code = e.getKeyCode();
    87. switch (code) {
    88. case KeyEvent.VK_DOWN:
    89. sortDropActive();
    90. break;
    91. case KeyEvent.VK_LEFT:
    92. moveleftActive();
    93. break;
    94. case KeyEvent.VK_RIGHT:
    95. moveRightActive();
    96. break;
    97. case KeyEvent.VK_UP:
    98. rotateRightActive();
    99. break;
    100. case KeyEvent.VK_SPACE:
    101. hadnDropActive();
    102. break;
    103. case KeyEvent.VK_P:
    104. //判断当前游戏状态
    105. if (game_state == PLING) {
    106. game_state = STOP;
    107. }
    108. break;
    109. case KeyEvent.VK_C:
    110. if (game_state == STOP) {
    111. game_state = PLING;
    112. }
    113. break;
    114. case KeyEvent.VK_S:
    115. //重新开始
    116. game_state = PLING;
    117. wall = new Cell[18][9];
    118. currentOne = Tetromino.randomOne();
    119. nextOne = Tetromino.randomOne();
    120. totalScore = 0;
    121. totalLine = 0;
    122. break;
    123. }
    124. }
    125. };
    126. //将窗口设置为焦点
    127. this.addKeyListener(l);
    128. this.requestFocus();
    129. while (true) {
    130. if (game_state == PLING) {
    131. try {
    132. Thread.sleep(500);
    133. } catch (InterruptedException e) {
    134. e.printStackTrace();
    135. }
    136. if (camDrop()) {
    137. currentOne.moveDrop();
    138. } else {
    139. landToWall();
    140. destroyLine();
    141. if (isGameOver()) {
    142. game_state = OVER;
    143. } else {
    144. //游戏没有结束
    145. currentOne = nextOne;
    146. nextOne = Tetromino.randomOne();
    147. }
    148. }
    149. }
    150. repaint();
    151. }
    152. }
    153. //创建顺时针旋转
    154. public void rotateRightActive() {
    155. currentOne.rotateRight();
    156. if (outOFBounds() || coincide()) {
    157. currentOne.rotateLeft();
    158. }
    159. }
    160. //瞬间下落
    161. public void hadnDropActive() {
    162. while (true) {
    163. //判断能否下落
    164. if (camDrop()) {
    165. currentOne.moveDrop();
    166. } else {
    167. break;
    168. }
    169. }
    170. //嵌入到墙中
    171. landToWall();
    172. destroyLine();
    173. if (isGameOver()) {
    174. game_state = OVER;
    175. } else {
    176. //游戏没有结束
    177. currentOne = nextOne;
    178. nextOne = Tetromino.randomOne();
    179. }
    180. }
    181. //按键一次,下落一格
    182. public void sortDropActive() {
    183. if (camDrop()) {
    184. //当前四方格下落一格
    185. currentOne.moveDrop();
    186. } else {
    187. landToWall();
    188. destroyLine();
    189. if (isGameOver()) {
    190. game_state = OVER;
    191. } else {
    192. //游戏没有结束
    193. currentOne = nextOne;
    194. nextOne = Tetromino.randomOne();
    195. }
    196. }
    197. }
    198. //单元格嵌入墙中
    199. private void landToWall() {
    200. Cell[] cells = currentOne.cells;
    201. for (Cell cell : cells) {
    202. int row = cell.getRow();
    203. int col = cell.getCol();
    204. wall[row][col] = cell;
    205. }
    206. }
    207. //判断四方格能否下落
    208. public boolean camDrop() {
    209. Cell[] cells = currentOne.cells;
    210. for (Cell cell : cells) {
    211. int row = cell.getRow();
    212. int col = cell.getCol();
    213. //判断是否到达底部
    214. if (row == wall.length - 1) {
    215. return false;
    216. } else if (wall[row + 1][col] != null) {
    217. return false;
    218. }
    219. }
    220. return true;
    221. }
    222. //消除行
    223. public void destroyLine() {
    224. int line = 0;
    225. Cell[] cells = currentOne.cells;
    226. for (Cell cell : cells) {
    227. int row = cell.getRow();
    228. if (isFullLine(row)) {
    229. line++;
    230. for (int i = row; i > 0; i--) {
    231. System.arraycopy(wall[i - 1], 0, wall[i], 0, wall[0].length);
    232. }
    233. wall[0] = new Cell[9];
    234. }
    235. }
    236. //分数池获取分数,累加到总分
    237. totalScore += scores_pool[line];
    238. //总行数
    239. totalLine += line;
    240. }
    241. //判断当前行是否已经满了
    242. public boolean isFullLine(int row) {
    243. Cell[] cells = wall[row];
    244. for (Cell cell : cells) {
    245. if (cell == null) {
    246. return false;
    247. }
    248. }
    249. return true;
    250. }
    251. //判断游戏是否结束
    252. public boolean isGameOver() {
    253. Cell[] cells = nextOne.cells;
    254. for (Cell cell : cells) {
    255. int row = cell.getRow();
    256. int col = cell.getCol();
    257. if (wall[row][col] != null) {
    258. return true;
    259. }
    260. }
    261. return false;
    262. }
    263. private void paintState(Graphics g) {
    264. if (game_state == PLING) {
    265. g.drawString(show_state[PLING], 500, 660);
    266. } else if (game_state == STOP) {
    267. g.drawString(show_state[STOP], 500, 660);
    268. } else {
    269. g.drawString(show_state[OVER], 500, 660);
    270. g.setColor(Color.RED);
    271. g.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 60));
    272. g.drawString("GAME OVER!", 30, 400);
    273. }
    274. }
    275. private void paintSource(Graphics g) {
    276. g.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 30));
    277. g.drawString("分数: " + totalScore, 500, 250);
    278. g.drawString("行数: " + totalLine, 500, 430);
    279. }
    280. private void paintNextOne(Graphics g) {
    281. Cell[] cells = nextOne.cells;
    282. for (Cell cell : cells) {
    283. int x = cell.getCol() * CELL_SIZE + 370;
    284. int y = cell.getRow() * CELL_SIZE + 25;
    285. g.drawImage(cell.getImage(), x, y, null);
    286. }
    287. }
    288. private void paintCurrentOne(Graphics g) {
    289. Cell[] cells = currentOne.cells;
    290. for (Cell cell : cells) {
    291. int x = cell.getCol() * CELL_SIZE;
    292. int y = cell.getRow() * CELL_SIZE;
    293. g.drawImage(cell.getImage(), x, y, null);
    294. }
    295. }
    296. private void paintWall(Graphics g) {
    297. for (int i = 0; i < wall.length; i++) {
    298. for (int j = 0; j < wall[i].length; j++) {
    299. int x = j * CELL_SIZE;
    300. int y = i * CELL_SIZE;
    301. Cell cell = wall[i][j];
    302. //判断是否有小方块
    303. if (cell == null) {
    304. g.drawRect(x, y, CELL_SIZE, CELL_SIZE);
    305. } else {
    306. g.drawImage(cell.getImage(), x, y, null);
    307. }
    308. }
    309. }
    310. }
    311. //判断是否出界
    312. public boolean outOFBounds() {
    313. Cell[] cells = currentOne.cells;
    314. for (Cell cell : cells) {
    315. int col = cell.getCol();
    316. int row = cell.getRow();
    317. if (row < 0 || row > wall.length - 1 || col < 0 || col > wall[0].length-1) {
    318. return true;
    319. }
    320. }
    321. return false;
    322. }
    323. //按键一次,左移一次
    324. public void moveleftActive() {
    325. currentOne.moveLeft();
    326. //判断是否越界或重合
    327. if (outOFBounds() || coincide()) {
    328. currentOne.moveRight();
    329. }
    330. }
    331. //按键一次,右移一次
    332. public void moveRightActive() {
    333. currentOne.moveRight();
    334. //判断是否越界或重合
    335. if (outOFBounds() || coincide()) {
    336. currentOne.moveLeft();
    337. }
    338. }
    339. //判断是否重合
    340. public boolean coincide() {
    341. Cell[] cells = currentOne.cells;
    342. for (Cell cell : cells) {
    343. int row = cell.getRow();
    344. int col = cell.getCol();
    345. if (wall[row][col] != null) {
    346. return true;
    347. }
    348. }
    349. return false;
    350. }
    351. public static void main(String[] args) {
    352. JFrame jFrame = new JFrame("俄罗斯方块");
    353. //创建游戏界面
    354. TetrisDome panel = new TetrisDome();
    355. jFrame.add(panel);
    356. //设置可见
    357. jFrame.setVisible(true);
    358. //设置窗口大小
    359. jFrame.setSize(810, 940);
    360. //设置剧中
    361. jFrame.setLocationRelativeTo(null);
    362. //设置窗口关闭时停止
    363. jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    364. //游戏主要开始逻辑
    365. panel.start();
    366. }
    367. }

    结果

  • 相关阅读:
    类和对象续
    Unity3D 使用LineRenderer自由画线
    JS选择排序
    【C语言深度解剖】float变量在内存中存储原理&&指针变量与“零值”比较
    【前端寻宝之路】学习和总结CSS的字体属性设置
    一文介绍使用 JIT 认证后实时同步用户更加优雅
    【数据结构(邓俊辉)学习笔记】向量04——有序向量
    浅析 Redisson 的分布式延时队列 RedissonDelayedQueue 运行流程
    openAI发布基于ChatGPT的AI绘画模型DALL·E3,话说stable-diffusion还香吗?
    texelFetch
  • 原文地址:https://blog.csdn.net/2301_76551149/article/details/134430285