您现在的位置:首页 >> 环保科技

想尝试Ja版《植物大战僵尸》的编译和列车运行吗

时间:2024-01-16 12:19:48

rridepublic void mousePressed(MouseEvent e) {}@Overridepublic void mouseReleased(MouseEvent e) {gp.setSunScore(gp.getSunScore() + 25);gp.remove(this);gp.getActiveSuns().remove(this);}@Overridepublic void mouseEntered(MouseEvent e) {}@Overridepublic void mouseExited(MouseEvent e) {}}

整个计算机系统的入口类是GameWindow,从JFrame派生,运用于推断主窗口,这是预定义:

import jax.swing.*;import ja.awt.event.ActionEvent;/*** Created by Armin on 6/25/2016.*/public class GameWindow extends JFrame {enum PlantType {None,Sunflower,Peashooter,FreezePeashooter}//PlantType activePlantingBrush = PlantType.None;public GameWindow() {setSize(1012, 785);setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);setLayout(null);JLabel sun = new JLabel("SUN");sun.setLocation(37, 80);sun.setSize(60, 20);GamePanel gp = new GamePanel(sun);gp.setLocation(0, 0);getLayeredPane().add(gp, new Integer(0));PlantCard sunflower = new PlantCard(new ImageIcon(this.getClass().getResource("images/cards/card_sunflower.png")).getImage());sunflower.setLocation(110, 8);sunflower.setAction((ActionEvent e) -> {gp.setActivePlantingBrush(PlantType.Sunflower);});getLayeredPane().add(sunflower, new Integer(3));PlantCard peashooter = new PlantCard(new ImageIcon(this.getClass().getResource("images/cards/card_peashooter.png")).getImage());peashooter.setLocation(175, 8);peashooter.setAction((ActionEvent e) -> {gp.setActivePlantingBrush(PlantType.Peashooter);});getLayeredPane().add(peashooter, new Integer(3));PlantCard freezepeashooter = new PlantCard(new ImageIcon(this.getClass().getResource("images/cards/card_freezepeashooter.png")).getImage());freezepeashooter.setLocation(240, 8);freezepeashooter.setAction((ActionEvent e) -> {gp.setActivePlantingBrush(PlantType.FreezePeashooter);});getLayeredPane().add(freezepeashooter, new Integer(3));getLayeredPane().add(sun, new Integer(2));setResizable(false);setVisible(true);}public GameWindow(boolean b) {Menu menu = new Menu();menu.setLocation(0, 0);setSize(1012, 785);setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);getLayeredPane().add(menu, new Integer(0));menu.repaint();setResizable(false);setVisible(true);}static GameWindow gw;public static void begin() {gw.dispose();gw = new GameWindow();}public static void main(String[] args) {gw = new GameWindow(true);}}6、总编辑pom.xml档案

由于这款《植物学血战黑衣人》一些游戏仅仅应用于新标准JDK提供的新功能,所以我们这个工程施工的Men,不运用于管理机构依赖,仅仅运用于拆开。

我们在pom.xml档案里面插入路由器,pom.xml档案附加的部分如下:

plantsorg.apache.men.pluginsmen-jar-plugin*.properties*.txt*.xmlClasspath>truelib/jar包不包含唯一版本标签;还有>falseGameWindow./resources/${project.build.directory}copy-dependencies;还有>org.apache.men.pluginsmen-dependency-plugincopy-dependenciespackagecopy-dependencies${project.build.directory}/lib/men-resources-plugincopy-resourcespackagecopy-resourcessrc/main/resources${project.build.directory}/resources7、解释器预定义

我们应用于Men号令,对工程施工进行解释器,解释器后获得plants.jar档案:

8、开始玩意一些游戏

软件解释器完成后,我们在号令行下分派ja -jar plants.jar,才可叫停一些游戏:

计算机系统叫停后,推断这个熟悉的主介面:

点击“ADVENTURE”(冒险),叫停一些游戏,介面如下:

当然,我们还可以继续玩意:

9、总结

一个不到2000行的计算机系统,不可能完整地意味着新功能强悍的《植物学血战黑衣人》一些游戏,但是这个版本,对于一些游戏开发计划入门者和感兴趣者,极为依赖于。

食道癌中期吞咽困难用什么药
经常颈椎痛该怎么治疗
视疲劳怎么缓解
什么药物利于抗衰老
红草止鼾胶囊功效与作用
相关阅读