@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="study-tank" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
<bytecodeTargetLevel>
|
||||
<module name="study-tank" target="1.8" />
|
||||
</bytecodeTargetLevel>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="https://maven.aliyun.com/repository/public" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: junit:junit:4.12">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/junit/junit/4.12/junit-4.12.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/junit/junit/4.12/junit-4.12-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/junit/junit/4.12/junit-4.12-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.hamcrest:hamcrest-core:1.3">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.springframework:spring-aop:5.3.23">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/springframework/spring-aop/5.3.23/spring-aop-5.3.23.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/springframework/spring-aop/5.3.23/spring-aop-5.3.23-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/springframework/spring-aop/5.3.23/spring-aop-5.3.23-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.springframework:spring-beans:5.3.23">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/springframework/spring-beans/5.3.23/spring-beans-5.3.23.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/springframework/spring-beans/5.3.23/spring-beans-5.3.23-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/springframework/spring-beans/5.3.23/spring-beans-5.3.23-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.springframework:spring-context:5.3.23">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/springframework/spring-context/5.3.23/spring-context-5.3.23.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/springframework/spring-context/5.3.23/spring-context-5.3.23-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/springframework/spring-context/5.3.23/spring-context-5.3.23-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.springframework:spring-core:5.3.23">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/springframework/spring-core/5.3.23/spring-core-5.3.23.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/springframework/spring-core/5.3.23/spring-core-5.3.23-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/springframework/spring-core/5.3.23/spring-core-5.3.23-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.springframework:spring-expression:5.3.23">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/springframework/spring-expression/5.3.23/spring-expression-5.3.23.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/springframework/spring-expression/5.3.23/spring-expression-5.3.23-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/springframework/spring-expression/5.3.23/spring-expression-5.3.23-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
@ -0,0 +1,13 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: org.springframework:spring-jcl:5.3.23">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/springframework/spring-jcl/5.3.23/spring-jcl-5.3.23.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/springframework/spring-jcl/5.3.23/spring-jcl-5.3.23-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/../../ProgramFile/maven-repository/org/springframework/spring-jcl/5.3.23/spring-jcl-5.3.23-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
|
||||
</project>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/study-tank.iml" filepath="$PROJECT_DIR$/study-tank.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Palette2">
|
||||
<group name="Swing">
|
||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||
</item>
|
||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||
<initial-values>
|
||||
<property name="text" value="Button" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="RadioButton" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="CheckBox" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="Label" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||
<preferred-size width="-1" height="20" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||
</item>
|
||||
</group>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.study.tank</groupId>
|
||||
<artifactId>study-tank</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>5.3.23</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<!-- 指定语言版本1.8-->
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,99 @@
|
||||
|
||||
package com.study.tank;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
|
||||
import javax.sound.sampled.AudioFormat;
|
||||
import javax.sound.sampled.AudioInputStream;
|
||||
import javax.sound.sampled.AudioSystem;
|
||||
import javax.sound.sampled.DataLine;
|
||||
import javax.sound.sampled.FloatControl;
|
||||
import javax.sound.sampled.SourceDataLine;
|
||||
|
||||
public class Audio {
|
||||
byte[] b = new byte[1024 * 1024 * 15];
|
||||
public void loop() {
|
||||
try {
|
||||
|
||||
while (true) {
|
||||
int len = 0;
|
||||
sourceDataLine.open(audioFormat, 1024 * 1024 * 15);
|
||||
sourceDataLine.start();
|
||||
//System.out.println(audioInputStream.markSupported());
|
||||
audioInputStream.mark(12358946);
|
||||
while ((len = audioInputStream.read(b)) > 0) {
|
||||
sourceDataLine.write(b, 0, len);
|
||||
}
|
||||
audioInputStream.reset();
|
||||
|
||||
sourceDataLine.drain();
|
||||
sourceDataLine.close();
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private AudioFormat audioFormat = null;
|
||||
private SourceDataLine sourceDataLine = null;
|
||||
private DataLine.Info dataLine_info = null;
|
||||
|
||||
private AudioInputStream audioInputStream = null;
|
||||
|
||||
public Audio(String fileName) {
|
||||
try {
|
||||
URL url = Audio.class.getClassLoader().getResource(fileName);
|
||||
audioInputStream = AudioSystem.getAudioInputStream(url);
|
||||
audioFormat = audioInputStream.getFormat();
|
||||
dataLine_info = new DataLine.Info(SourceDataLine.class, audioFormat);
|
||||
sourceDataLine = (SourceDataLine) AudioSystem.getLine(dataLine_info);
|
||||
//FloatControl volctrl=(FloatControl)sourceDataLine.getControl(FloatControl.Type.MASTER_GAIN);
|
||||
//volctrl.setValue(-40);//
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void play() {
|
||||
try {
|
||||
byte[] b = new byte[1024*5];
|
||||
int len = 0;
|
||||
sourceDataLine.open(audioFormat, 1024*5);
|
||||
sourceDataLine.start();
|
||||
//System.out.println(audioInputStream.markSupported());
|
||||
audioInputStream.mark(12358946);
|
||||
while ((len = audioInputStream.read(b)) > 0) {
|
||||
sourceDataLine.write(b, 0, len);
|
||||
}
|
||||
// audioInputStream.reset();
|
||||
|
||||
sourceDataLine.drain();
|
||||
sourceDataLine.close();
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void close() {
|
||||
try {
|
||||
audioInputStream.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// //URL url = Audio.class.getClassLoader().getResource("audio/explode.wav");
|
||||
// System.out.println("测试");
|
||||
// Audio a = new Audio("audio/explode.wav");
|
||||
//// //Audio a = new Audio("audio/explode.wav");
|
||||
// a.loop();
|
||||
// }
|
||||
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.study.tank;
|
||||
|
||||
import com.study.tank.factory.BaseBullet;
|
||||
import com.study.tank.factory.BaseTank;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Auther: xiaoshengjie
|
||||
* @Date: 2022/10/22/上午11:16
|
||||
*/
|
||||
public class Bullet extends BaseBullet {
|
||||
public static final int bWidth = ImageManger.bulletL.getWidth();
|
||||
public static final int bHeight = ImageManger.bulletL.getHeight();
|
||||
private int x, y;
|
||||
private Dir dir = Dir.DOWN;
|
||||
private final int speed = 10;
|
||||
private boolean living = true;
|
||||
TankFrame tf = null;
|
||||
private Group group = Group.BAD;
|
||||
|
||||
public Group getGroup() {
|
||||
return group;
|
||||
}
|
||||
|
||||
public void setGroup(Group group) {
|
||||
this.group = group;
|
||||
}
|
||||
|
||||
public Bullet(int x, int y, Dir dir, Group group, TankFrame tankFrame) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.dir = dir;
|
||||
this.tf = tankFrame;
|
||||
this.group = group;
|
||||
tankFrame.bullets.add(this);
|
||||
new Thread(() -> {
|
||||
new Audio("audio/tank_fire.wav");
|
||||
}).start();
|
||||
}
|
||||
|
||||
|
||||
public void paint(Graphics g) {
|
||||
if (!living) tf.bullets.remove(this);
|
||||
switch (dir) {
|
||||
case DOWN:
|
||||
g.drawImage(ImageManger.bulletD, x, y, null);
|
||||
break;
|
||||
case UP:
|
||||
g.drawImage(ImageManger.bulletU, x, y, null);
|
||||
break;
|
||||
case RIGHT:
|
||||
g.drawImage(ImageManger.bulletR, x, y, null);
|
||||
break;
|
||||
case LEFT:
|
||||
g.drawImage(ImageManger.bulletL, x, y, null);
|
||||
break;
|
||||
}
|
||||
move();
|
||||
}
|
||||
|
||||
/**
|
||||
* 移动
|
||||
*/
|
||||
public void move() {
|
||||
switch (dir) {
|
||||
case LEFT:
|
||||
x -= speed;
|
||||
break;
|
||||
case RIGHT:
|
||||
x += speed;
|
||||
break;
|
||||
case UP:
|
||||
y -= speed;
|
||||
break;
|
||||
case DOWN:
|
||||
y += speed;
|
||||
break;
|
||||
}
|
||||
if (x < 0 || y < 0 || x > TankFrame.GAME_WIDTH || y > TankFrame.GAME_HEIGHT) {
|
||||
living = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 碰撞
|
||||
*/
|
||||
public void collideWithTank(BaseTank tank) {
|
||||
if (this.group == tank.getGroup()) return;
|
||||
Rectangle rect1 = new Rectangle(this.x, this.y, bWidth, bHeight);
|
||||
Rectangle rect2 = new Rectangle(tank.getX(), tank.getY(), Tank.tankWidth, Tank.tankHeight);
|
||||
//碰撞矩形
|
||||
if (rect1.intersects(rect2)) {
|
||||
tank.die();
|
||||
this.die();
|
||||
tf.explodes.add(tf.gf.createExplode(this.x + bWidth / 2 - Explode.bWidth / 2, this.y + bWidth - Explode.bHeight / 2, tf));
|
||||
}
|
||||
}
|
||||
|
||||
public void die() {
|
||||
this.living = false;
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.study.tank;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Auther: xiaoshengjie
|
||||
* @Date: 2022/10/22/上午10:09
|
||||
*/
|
||||
public enum Dir {
|
||||
LEFT,RIGHT,UP,DOWN
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package com.study.tank;
|
||||
|
||||
import com.study.tank.factory.BaseExplode;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* @Description: 爆炸
|
||||
* @Auther: xiaoshengjie
|
||||
* @Date: 2022/10/22/上午11:16
|
||||
*/
|
||||
public class Explode extends BaseExplode {
|
||||
public static final int bWidth = ImageManger.explodes[0].getWidth();
|
||||
public static final int bHeight = ImageManger.explodes[0].getHeight();
|
||||
private int x, y;
|
||||
TankFrame tf = null;
|
||||
private int step = 0;
|
||||
|
||||
|
||||
public Explode(int x, int y, TankFrame tankFrame) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.tf = tankFrame;
|
||||
|
||||
new Thread(new Runnable() {
|
||||
public void run() {
|
||||
new Audio("audio/explode.wav").play();
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
// public void paint(Graphics g) {
|
||||
// g.drawImage(ImageManger.explodes[step++], x, y, null);
|
||||
// if (step >= ImageManger.explodes.length) {
|
||||
// tf.explodes.remove(this);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
g.drawImage(ImageManger.explodes[step++], x, y, null);
|
||||
if (step >= ImageManger.explodes.length) {
|
||||
tf.explodes.remove(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.study.tank;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Auther: xiaoshengjie
|
||||
* @Date: 2022/10/22/下午1:49
|
||||
*/
|
||||
public enum Group {
|
||||
GOOD,BAD
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.study.tank;
|
||||
|
||||
import com.study.tank.util.ImageUtil;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Auther: xiaoshengjie
|
||||
* @Date: 2022/10/22/下午12:37
|
||||
*/
|
||||
public class ImageManger {
|
||||
public static BufferedImage goodTankL, goodTankR, goodTankU, goodTankD;
|
||||
public static BufferedImage badTankL, badTankR, badTankU, badTankD;
|
||||
public static BufferedImage bulletL, bulletR, bulletU, bulletD;
|
||||
public static BufferedImage[] explodes = new BufferedImage[16];
|
||||
|
||||
static {
|
||||
try {
|
||||
goodTankU = ImageIO.read(ImageManger.class.getClassLoader().getResourceAsStream("images/GoodTank1.png"));
|
||||
goodTankD = ImageUtil.rotateImage(goodTankU, 180);
|
||||
goodTankL = ImageUtil.rotateImage(goodTankU, -90);
|
||||
goodTankR = ImageUtil.rotateImage(goodTankU, 90);
|
||||
|
||||
badTankU = ImageIO.read(ImageManger.class.getClassLoader().getResourceAsStream("images/BadTank1.png"));
|
||||
badTankD = ImageUtil.rotateImage(badTankU, 180);
|
||||
badTankL = ImageUtil.rotateImage(badTankU, -90);
|
||||
badTankR = ImageUtil.rotateImage(badTankU, 90);
|
||||
|
||||
bulletL = ImageIO.read(ImageManger.class.getClassLoader().getResourceAsStream("images/bulletL.gif"));
|
||||
bulletR = ImageIO.read(ImageManger.class.getClassLoader().getResourceAsStream("images/bulletR.gif"));
|
||||
bulletU = ImageIO.read(ImageManger.class.getClassLoader().getResourceAsStream("images/bulletU.gif"));
|
||||
bulletD = ImageIO.read(ImageManger.class.getClassLoader().getResourceAsStream("images/bulletD.gif"));
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
explodes[i] = ImageIO.read(ImageManger.class.getClassLoader().getResourceAsStream("images/e" + (i + 1) + ".gif"));
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.study.tank;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Auther: xiaoshengjie
|
||||
* @Date: 2022/10/23/下午8:50
|
||||
*/
|
||||
public class PropertyMgr {
|
||||
static Properties properties = new Properties();
|
||||
|
||||
private PropertyMgr(){
|
||||
|
||||
}
|
||||
|
||||
static {
|
||||
try {
|
||||
properties.load(PropertyMgr.class.getClassLoader().getResourceAsStream("config"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static Object get(String key) {
|
||||
if (properties == null) return null;
|
||||
return properties.get(key);
|
||||
}
|
||||
|
||||
// public static void main(String[] args) {
|
||||
// System.out.println(PropertyMgr.get("initTankCount"));
|
||||
// }
|
||||
}
|
@ -0,0 +1,229 @@
|
||||
package com.study.tank;
|
||||
|
||||
import com.study.tank.factory.BaseTank;
|
||||
import com.study.tank.strategy.FireStrategy;
|
||||
import com.study.tank.strategy.Imp.DefaultFireStrategy;
|
||||
import com.study.tank.strategy.Imp.GoodTankFireStrategy;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Auther: xiaoshengjie
|
||||
* @Date: 2022/10/22/上午10:08
|
||||
*/
|
||||
public class Tank extends BaseTank {
|
||||
public static final int tankWidth = ImageManger.goodTankU.getWidth();
|
||||
public static final int tankHeight = ImageManger.goodTankU.getHeight();
|
||||
private boolean moving = true;
|
||||
// private int x, y;
|
||||
private boolean living = true;
|
||||
public Dir dir = Dir.DOWN;
|
||||
private final int speed = 4;
|
||||
public TankFrame tankFrame = null;
|
||||
private Random random = new Random();
|
||||
//Group group = Group.BAD;
|
||||
|
||||
// FireStrategy fs;
|
||||
|
||||
// public Group getGroup() {
|
||||
// return group;
|
||||
// }
|
||||
//
|
||||
// public void setGroup(Group group) {
|
||||
// this.group = group;
|
||||
// }
|
||||
|
||||
public Tank(int x, int y, Dir dir, Group group, TankFrame tankFrame) {
|
||||
// this.x = x;
|
||||
// this.y = y;
|
||||
super(x, y, group);
|
||||
this.dir = dir;
|
||||
//this.group = group;
|
||||
this.tankFrame = tankFrame;
|
||||
// try {
|
||||
// if (this.group == Group.GOOD) {
|
||||
// String goodName = (String) PropertyMgr.get("goodFs");
|
||||
// //fs = (GoodTankFireStrategy) Class.forName(goodName).newInstance();
|
||||
// fs = (FireStrategy) Class.forName(goodName).getDeclaredConstructor().newInstance();
|
||||
// } else {
|
||||
// fs = new DefaultFireStrategy();
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
||||
// public Tank(int x, int y, Dir dir, Group group, boolean moving, TankFrame tankFrame) {
|
||||
// this.x = x;
|
||||
// this.y = y;
|
||||
// this.dir = dir;
|
||||
// this.group = group;
|
||||
// this.tankFrame = tankFrame;
|
||||
// this.moving = false;
|
||||
// }
|
||||
|
||||
// public int getX() {
|
||||
// return x;
|
||||
// }
|
||||
//
|
||||
// public int getY() {
|
||||
// return y;
|
||||
// }
|
||||
|
||||
public Dir getDir() {
|
||||
return dir;
|
||||
}
|
||||
|
||||
public int getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
// public void setX(int x) {
|
||||
// this.x = x;
|
||||
// }
|
||||
//
|
||||
// public void setY(int y) {
|
||||
// this.y = y;
|
||||
// }
|
||||
|
||||
public boolean isMoving() {
|
||||
return moving;
|
||||
}
|
||||
|
||||
public void setMoving(boolean moving) {
|
||||
this.moving = moving;
|
||||
}
|
||||
|
||||
public void setDir(Dir dir) {
|
||||
this.dir = dir;
|
||||
}
|
||||
|
||||
// public void paint(Graphics g) {
|
||||
// System.out.println("tank paint");
|
||||
// if (!living) {
|
||||
// tankFrame.tanks.remove(this);
|
||||
// moving = false;
|
||||
// return;
|
||||
// }
|
||||
// switch (this.dir) {
|
||||
// case DOWN:
|
||||
// g.drawImage(this.group == Group.GOOD ? ImageManger.goodTankD : ImageManger.badTankD, this.x, this.y, null);
|
||||
// break;
|
||||
// case UP:
|
||||
// g.drawImage(this.group == Group.GOOD ? ImageManger.goodTankU : ImageManger.badTankU, this.x, this.y, null);
|
||||
// break;
|
||||
// case RIGHT:
|
||||
// g.drawImage(this.group == Group.GOOD ? ImageManger.goodTankR : ImageManger.badTankR, this.x, this.y, null);
|
||||
// break;
|
||||
// case LEFT:
|
||||
// g.drawImage(this.group == Group.GOOD ? ImageManger.goodTankL : ImageManger.badTankL, this.x, this.y, null);
|
||||
// break;
|
||||
// }
|
||||
// move();
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
System.out.println("tank paint");
|
||||
if (!living) {
|
||||
tankFrame.tanks.remove(this);
|
||||
moving = false;
|
||||
return;
|
||||
}
|
||||
switch (this.dir) {
|
||||
case DOWN:
|
||||
g.drawImage(this.group == Group.GOOD ? ImageManger.goodTankD : ImageManger.badTankD, this.x, this.y, null);
|
||||
break;
|
||||
case UP:
|
||||
g.drawImage(this.group == Group.GOOD ? ImageManger.goodTankU : ImageManger.badTankU, this.x, this.y, null);
|
||||
break;
|
||||
case RIGHT:
|
||||
g.drawImage(this.group == Group.GOOD ? ImageManger.goodTankR : ImageManger.badTankR, this.x, this.y, null);
|
||||
break;
|
||||
case LEFT:
|
||||
g.drawImage(this.group == Group.GOOD ? ImageManger.goodTankL : ImageManger.badTankL, this.x, this.y, null);
|
||||
break;
|
||||
}
|
||||
move();
|
||||
}
|
||||
|
||||
public void move() {
|
||||
if (!living) return;
|
||||
if (!this.moving) return;
|
||||
switch (dir) {
|
||||
case LEFT:
|
||||
x -= speed;
|
||||
break;
|
||||
case RIGHT:
|
||||
x += speed;
|
||||
break;
|
||||
case UP:
|
||||
y -= speed;
|
||||
break;
|
||||
case DOWN:
|
||||
y += speed;
|
||||
break;
|
||||
}
|
||||
if (group == Group.BAD && random.nextInt(100) > 95)
|
||||
this.fire();
|
||||
|
||||
if (this.group == Group.BAD && random.nextInt(100) > 95)
|
||||
this.randomDir();
|
||||
|
||||
boundsCheck();
|
||||
if (group == Group.GOOD) {
|
||||
new Thread(() -> {
|
||||
new Audio("audio/tank_move.wav").play();
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
|
||||
private void boundsCheck() {
|
||||
if (this.x < 0) x = TankFrame.GAME_WIDTH - Tank.tankWidth;
|
||||
if (this.y < 28) y = TankFrame.GAME_HEIGHT - Tank.tankHeight;
|
||||
if (this.x > TankFrame.GAME_WIDTH - tankWidth) x = 0;
|
||||
if (this.y > TankFrame.GAME_HEIGHT - tankHeight) y = 28;
|
||||
}
|
||||
|
||||
//0.4几率的随机方向
|
||||
private void randomDir() {
|
||||
if (random.nextInt(100) > 60)
|
||||
this.dir = Dir.values()[random.nextInt(4)];
|
||||
}
|
||||
|
||||
/**
|
||||
* 开火
|
||||
*/
|
||||
public void fire() {
|
||||
//fs.fire(this);
|
||||
int bx = this.getX() + Tank.tankWidth / 2 - ImageManger.bulletD.getWidth() / 2;
|
||||
int by = this.getY() + Tank.tankHeight / 2 - ImageManger.bulletD.getHeight() / 2;
|
||||
switch (this.dir) {
|
||||
case DOWN:
|
||||
new Bullet(bx, by + 6, this.dir, this.getGroup(), this.tankFrame);
|
||||
new Bullet(bx, by - 6, this.dir, this.getGroup(), this.tankFrame);
|
||||
break;
|
||||
case UP:
|
||||
new Bullet(bx + 1, by + 6, this.dir, this.getGroup(), this.tankFrame);
|
||||
new Bullet(bx + 1, by - 6, this.dir, this.getGroup(), this.tankFrame);
|
||||
break;
|
||||
case LEFT:
|
||||
new Bullet(bx + 6, by, this.dir, this.getGroup(), this.tankFrame);
|
||||
new Bullet(bx - 6, by, this.dir, this.getGroup(), this.tankFrame);
|
||||
break;
|
||||
case RIGHT:
|
||||
new Bullet(bx + 6, by + 1, this.dir, this.getGroup(), this.tankFrame);
|
||||
new Bullet(bx - 6, by + 1, this.dir, this.getGroup(), this.tankFrame);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die() {
|
||||
this.living = false;
|
||||
}
|
||||
}
|
@ -0,0 +1,151 @@
|
||||
package com.study.tank;
|
||||
|
||||
import com.study.tank.factory.*;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.KeyAdapter;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Auther: xiaoshengjie
|
||||
* @Date: 2022/10/22/上午9:14
|
||||
*/
|
||||
public class TankFrame extends Frame {
|
||||
public static final int GAME_WIDTH = Integer.parseInt((String) PropertyMgr.get("gameWidth"));
|
||||
public static final int GAME_HEIGHT = Integer.parseInt((String) PropertyMgr.get("gameHeight"));
|
||||
public ArrayList<BaseTank> tanks = new ArrayList<BaseTank>();
|
||||
public Tank myTank = new Tank(150, 150, Dir.DOWN, Group.GOOD, this);
|
||||
public ArrayList<BaseBullet> bullets = new ArrayList<BaseBullet>();
|
||||
public ArrayList<BaseExplode> explodes = new ArrayList<BaseExplode>();
|
||||
public GameFactory gf = new DefaultFactory();
|
||||
|
||||
public TankFrame() {
|
||||
//设置窗口大小
|
||||
this.setSize(GAME_WIDTH, GAME_HEIGHT);
|
||||
this.setResizable(false);//不可改变窗口大小
|
||||
this.setTitle("Tank War");//设置标题
|
||||
this.setVisible(true);//设置窗口可见
|
||||
this.addKeyListener(new MyKeyListener());
|
||||
//窗口关闭系统停止运行
|
||||
this.addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosing(WindowEvent e) {
|
||||
System.exit(0);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Image offScreenImage = null;
|
||||
|
||||
@Override
|
||||
public void update(Graphics g) {
|
||||
if (offScreenImage == null) {
|
||||
offScreenImage = this.createImage(GAME_WIDTH, GAME_HEIGHT);
|
||||
}
|
||||
Graphics gOffScreen = offScreenImage.getGraphics();
|
||||
Color c = gOffScreen.getColor();
|
||||
gOffScreen.setColor(Color.BLACK);
|
||||
gOffScreen.fillRect(0, 0, GAME_WIDTH, GAME_HEIGHT);
|
||||
gOffScreen.setColor(c);
|
||||
paint(gOffScreen);
|
||||
g.drawImage(offScreenImage, 0, 0, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
Color c = g.getColor();
|
||||
g.setColor(Color.BLUE);
|
||||
g.drawString("子弹的数量:" + bullets.size(), 5, 40);
|
||||
g.drawString("敌人的数量:" + tanks.size(), 5, 60);
|
||||
g.setColor(c);
|
||||
myTank.paint(g);
|
||||
for (int i = 0; i < tanks.size(); i++) {
|
||||
tanks.get(i).paint(g);
|
||||
}
|
||||
for (int i = 0; i < bullets.size(); i++) {
|
||||
bullets.get(i).paint(g);
|
||||
}
|
||||
for (int i = 0; i < bullets.size(); i++) {
|
||||
for (int j = 0; j < tanks.size(); j++) {
|
||||
bullets.get(i).collideWithTank(tanks.get(j));
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < explodes.size(); i++) {
|
||||
explodes.get(i).paint(g);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 按键监听类
|
||||
*/
|
||||
class MyKeyListener extends KeyAdapter {
|
||||
boolean bL = false;
|
||||
boolean bR = false;
|
||||
boolean bU = false;
|
||||
boolean bD = false;
|
||||
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
int key = e.getKeyCode();
|
||||
switch (key) {
|
||||
case KeyEvent.VK_A:
|
||||
bL = true;
|
||||
break;
|
||||
case KeyEvent.VK_D:
|
||||
bR = true;
|
||||
break;
|
||||
case KeyEvent.VK_W:
|
||||
bU = true;
|
||||
break;
|
||||
case KeyEvent.VK_S:
|
||||
bD = true;
|
||||
break;
|
||||
}
|
||||
setDirMethod();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyReleased(KeyEvent e) {
|
||||
super.keyReleased(e);
|
||||
int key = e.getKeyCode();
|
||||
System.out.println("弹起:" + key);
|
||||
switch (key) {
|
||||
case KeyEvent.VK_A:
|
||||
bL = false;
|
||||
break;
|
||||
case KeyEvent.VK_D:
|
||||
bR = false;
|
||||
break;
|
||||
case KeyEvent.VK_W:
|
||||
bU = false;
|
||||
break;
|
||||
case KeyEvent.VK_S:
|
||||
bD = false;
|
||||
break;
|
||||
case KeyEvent.VK_SPACE:
|
||||
myTank.fire();
|
||||
break;
|
||||
}
|
||||
setDirMethod();
|
||||
}
|
||||
|
||||
public void setDirMethod() {
|
||||
if (!bD && !bU && !bR && !bL) {
|
||||
myTank.setMoving(false);
|
||||
} else {
|
||||
myTank.setMoving(true);
|
||||
}
|
||||
if (bL) myTank.setDir(Dir.LEFT);
|
||||
if (bR) myTank.setDir(Dir.RIGHT);
|
||||
if (bU) myTank.setDir(Dir.UP);
|
||||
if (bD) myTank.setDir(Dir.DOWN);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.study.tank;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Auther: xiaoshengjie
|
||||
* @Date: 2022/10/21/下午8:05
|
||||
*/
|
||||
public class TestMain {
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
|
||||
TankFrame tf = new TankFrame();
|
||||
//初始化敌人坦克
|
||||
int initCountTank = Integer.parseInt((String) PropertyMgr.get("initTankCount"));
|
||||
for (int i = 0; i < initCountTank; i++) {
|
||||
tf.tanks.add(tf.gf.createTank(80 + i * 100, 50, Dir.DOWN, Group.BAD, tf));
|
||||
}
|
||||
|
||||
new Thread(() -> {
|
||||
new Audio("audio/war1.wav").loop();
|
||||
}).start();
|
||||
|
||||
while (true) {
|
||||
Thread.sleep(100);
|
||||
tf.repaint();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.study.tank.factory;
|
||||
|
||||
import com.study.tank.Tank;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* @author xsj
|
||||
* @date 2022/10/26 13:14
|
||||
*/
|
||||
public abstract class BaseBullet {
|
||||
|
||||
public abstract void paint(Graphics g);
|
||||
|
||||
public abstract void collideWithTank(BaseTank tank);
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.study.tank.factory;
|
||||
|
||||
import com.study.tank.TankFrame;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* @author xsj
|
||||
* @date 2022/10/26 13:16
|
||||
*/
|
||||
public abstract class BaseExplode {
|
||||
public abstract void paint(Graphics g);
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.study.tank.factory;
|
||||
|
||||
import com.study.tank.Dir;
|
||||
import com.study.tank.Group;
|
||||
import com.study.tank.TankFrame;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* @author xsj
|
||||
* @date 2022/10/26 13:13
|
||||
*/
|
||||
public abstract class BaseTank {
|
||||
public Group group = Group.BAD;
|
||||
public int x, y;
|
||||
|
||||
public abstract void paint(Graphics g);
|
||||
|
||||
public abstract void die();
|
||||
|
||||
public Group getGroup() {
|
||||
return group;
|
||||
}
|
||||
|
||||
public void setGroup(Group group) {
|
||||
this.group = group;
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(int x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(int y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public BaseTank(int x, int y, Group group) {
|
||||
this.group = group;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.study.tank.factory;
|
||||
|
||||
import com.study.tank.*;
|
||||
|
||||
/**
|
||||
* @author xsj
|
||||
* @date 2022/10/26 13:13
|
||||
*/
|
||||
public class DefaultFactory extends GameFactory {
|
||||
|
||||
@Override
|
||||
public BaseTank createTank(int x, int y, Dir dir, Group group, TankFrame tankFrame) {
|
||||
return new Tank(x, y, dir, group, tankFrame);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBullet createBullet(int x, int y, Dir dir, Group group, TankFrame tankFrame) {
|
||||
return new Bullet(x,y,dir,group,tankFrame);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseExplode createExplode(int x, int y, TankFrame tankFrame) {
|
||||
return new Explode(x, y, tankFrame);
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.study.tank.factory;
|
||||
|
||||
import com.study.tank.Dir;
|
||||
import com.study.tank.Group;
|
||||
import com.study.tank.TankFrame;
|
||||
|
||||
/**
|
||||
* @author xsj
|
||||
* @date 2022/10/26 13:13
|
||||
*/
|
||||
public abstract class GameFactory {
|
||||
|
||||
public abstract BaseTank createTank(int x, int y, Dir dir, Group group, TankFrame tankFrame);
|
||||
|
||||
public abstract BaseBullet createBullet(int x, int y, Dir dir, Group group, TankFrame tankFrame);
|
||||
|
||||
public abstract BaseExplode createExplode(int x, int y, TankFrame tankFrame);
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.study.tank.factory;
|
||||
|
||||
import com.study.tank.Audio;
|
||||
import com.study.tank.ImageManger;
|
||||
import com.study.tank.TankFrame;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* @author xsj
|
||||
* @date 2022/10/26 13:37
|
||||
*/
|
||||
public class RectExplode extends BaseExplode {
|
||||
public static final int bWidth = ImageManger.explodes[0].getWidth();
|
||||
public static final int bHeight = ImageManger.explodes[0].getHeight();
|
||||
private int x, y;
|
||||
TankFrame tf = null;
|
||||
private int step = 0;
|
||||
|
||||
|
||||
public RectExplode(int x, int y, TankFrame tankFrame) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.tf = tankFrame;
|
||||
|
||||
new Thread(new Runnable() {
|
||||
public void run() {
|
||||
new Audio("audio/explode.wav").play();
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
// g.drawImage(ImageManger.explodes[step++], x, y, null);
|
||||
Color c = g.getColor();
|
||||
g.setColor(Color.red);
|
||||
g.fillRect(x, y, 10 * step, 10 * step);
|
||||
// if (step >= ImageManger.explodes.length) {
|
||||
// tf.explodes.remove(this);
|
||||
// }
|
||||
step++;
|
||||
if (step > 5) tf.explodes.remove(this);
|
||||
g.setColor(c);
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.study.tank.factory;
|
||||
|
||||
import com.study.tank.*;
|
||||
|
||||
/**
|
||||
* @author xsj
|
||||
* @date 2022/10/26 13:36
|
||||
*/
|
||||
public class RectFactory extends GameFactory {
|
||||
|
||||
@Override
|
||||
public BaseTank createTank(int x, int y, Dir dir, Group group, TankFrame tankFrame) {
|
||||
return new WarTank(x, y, dir, group, tankFrame);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBullet createBullet(int x, int y, Dir dir, Group group, TankFrame tankFrame) {
|
||||
return new RoundBullet(x, y, dir, group, tankFrame);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseExplode createExplode(int x, int y, TankFrame tankFrame) {
|
||||
return new RectExplode(x, y, tankFrame);
|
||||
}
|
||||
}
|
@ -0,0 +1,125 @@
|
||||
package com.study.tank.factory;
|
||||
|
||||
import com.study.tank.*;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Auther: xiaoshengjie
|
||||
* @Date: 2022/10/22/上午11:16
|
||||
*/
|
||||
public class RoundBullet extends BaseBullet {
|
||||
public static final int bWidth = ImageManger.bulletL.getWidth();
|
||||
public static final int bHeight = ImageManger.bulletL.getHeight();
|
||||
private int x, y;
|
||||
private Dir dir = Dir.DOWN;
|
||||
private final int speed = 10;
|
||||
private boolean living = true;
|
||||
TankFrame tf = null;
|
||||
private Group group = Group.BAD;
|
||||
|
||||
public Group getGroup() {
|
||||
return group;
|
||||
}
|
||||
|
||||
public void setGroup(Group group) {
|
||||
this.group = group;
|
||||
}
|
||||
|
||||
public RoundBullet(int x, int y, Dir dir, Group group, TankFrame tankFrame) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.dir = dir;
|
||||
this.tf = tankFrame;
|
||||
this.group = group;
|
||||
tankFrame.bullets.add(this);
|
||||
new Thread(() -> {
|
||||
new Audio("audio/tank_fire.wav");
|
||||
}).start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
if (!living) tf.bullets.remove(this);
|
||||
Color c = g.getColor();
|
||||
g.setColor(Color.RED);
|
||||
g.fillOval(x, y, 20, 20);
|
||||
g.setColor(c);
|
||||
move();
|
||||
}
|
||||
|
||||
// public void paint(Graphics g) {
|
||||
// if (!living) tf.bullets.remove(this);
|
||||
// switch (dir) {
|
||||
// case DOWN:
|
||||
// g.drawImage(ImageManger.bulletD, x, y, null);
|
||||
// break;
|
||||
// case UP:
|
||||
// g.drawImage(ImageManger.bulletU, x, y, null);
|
||||
// break;
|
||||
// case RIGHT:
|
||||
// g.drawImage(ImageManger.bulletR, x, y, null);
|
||||
// break;
|
||||
// case LEFT:
|
||||
// g.drawImage(ImageManger.bulletL, x, y, null);
|
||||
// break;
|
||||
// }
|
||||
// move();
|
||||
// }
|
||||
|
||||
/**
|
||||
* 移动
|
||||
*/
|
||||
public void move() {
|
||||
switch (dir) {
|
||||
case LEFT:
|
||||
x -= speed;
|
||||
break;
|
||||
case RIGHT:
|
||||
x += speed;
|
||||
break;
|
||||
case UP:
|
||||
y -= speed;
|
||||
break;
|
||||
case DOWN:
|
||||
y += speed;
|
||||
break;
|
||||
}
|
||||
if (x < 0 || y < 0 || x > TankFrame.GAME_WIDTH || y > TankFrame.GAME_HEIGHT) {
|
||||
living = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 碰撞
|
||||
*/
|
||||
// public void collideWithTank(Tank tank) {
|
||||
// if (this.group == tank.getGroup()) return;
|
||||
// Rectangle rect1 = new Rectangle(this.x, this.y, bWidth, bHeight);
|
||||
// Rectangle rect2 = new Rectangle(tank.getX(), tank.getY(), Tank.tankWidth, Tank.tankHeight);
|
||||
// //碰撞矩形
|
||||
// if (rect1.intersects(rect2)) {
|
||||
// tank.die();
|
||||
// this.die();
|
||||
// tf.explodes.add(tf.gf.createExplode(this.x + bWidth / 2 - Explode.bWidth / 2, this.y + bWidth - Explode.bHeight / 2, tf));
|
||||
// }
|
||||
// }
|
||||
@Override
|
||||
public void collideWithTank(BaseTank tank) {
|
||||
if (this.group == tank.getGroup()) return;
|
||||
Rectangle rect1 = new Rectangle(this.x, this.y, bWidth, bHeight);
|
||||
Rectangle rect2 = new Rectangle(tank.getX(), tank.getY(), Tank.tankWidth, Tank.tankHeight);
|
||||
//碰撞矩形
|
||||
if (rect1.intersects(rect2)) {
|
||||
tank.die();
|
||||
this.die();
|
||||
tf.explodes.add(tf.gf.createExplode(this.x + bWidth / 2 - Explode.bWidth / 2, this.y + bWidth - Explode.bHeight / 2, tf));
|
||||
}
|
||||
}
|
||||
|
||||
public void die() {
|
||||
this.living = false;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,170 @@
|
||||
package com.study.tank.factory;
|
||||
|
||||
import com.study.tank.*;
|
||||
import com.study.tank.strategy.FireStrategy;
|
||||
import com.study.tank.strategy.Imp.DefaultFireStrategy;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Auther: xiaoshengjie
|
||||
* @Date: 2022/10/22/上午10:08
|
||||
*/
|
||||
public class WarTank extends BaseTank {
|
||||
public static final int tankWidth = ImageManger.goodTankU.getWidth();
|
||||
public static final int tankHeight = ImageManger.goodTankU.getHeight();
|
||||
private boolean moving = true;
|
||||
private int x, y;
|
||||
private boolean living = true;
|
||||
public Dir dir = Dir.DOWN;
|
||||
private final int speed = 4;
|
||||
public TankFrame tankFrame = null;
|
||||
private Random random = new Random();
|
||||
Group group = Group.BAD;
|
||||
|
||||
FireStrategy fs;
|
||||
|
||||
public Group getGroup() {
|
||||
return group;
|
||||
}
|
||||
|
||||
public void setGroup(Group group) {
|
||||
this.group = group;
|
||||
}
|
||||
|
||||
public WarTank(int x, int y, Dir dir, Group group, TankFrame tankFrame) {
|
||||
// this.x = x;
|
||||
// this.y = y;
|
||||
super(x, y, group);
|
||||
this.dir = dir;
|
||||
// this.group = group;
|
||||
this.tankFrame = tankFrame;
|
||||
try {
|
||||
if (this.group == Group.GOOD) {
|
||||
String goodName = (String) PropertyMgr.get("goodFs");
|
||||
//fs = (GoodTankFireStrategy) Class.forName(goodName).newInstance();
|
||||
fs = (FireStrategy) Class.forName(goodName).getDeclaredConstructor().newInstance();
|
||||
} else {
|
||||
fs = new DefaultFireStrategy();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// public Tank(int x, int y, Dir dir, Group group, boolean moving, TankFrame tankFrame) {
|
||||
// this.x = x;
|
||||
// this.y = y;
|
||||
// this.dir = dir;
|
||||
// this.group = group;
|
||||
// this.tankFrame = tankFrame;
|
||||
// this.moving = false;
|
||||
// }
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public Dir getDir() {
|
||||
return dir;
|
||||
}
|
||||
|
||||
public int getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public void setX(int x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public void setY(int y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public boolean isMoving() {
|
||||
return moving;
|
||||
}
|
||||
|
||||
public void setMoving(boolean moving) {
|
||||
this.moving = moving;
|
||||
}
|
||||
|
||||
public void setDir(Dir dir) {
|
||||
this.dir = dir;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint(Graphics g) {
|
||||
System.out.println("war paint");
|
||||
if (!living) {
|
||||
tankFrame.tanks.remove(this);
|
||||
moving = false;
|
||||
return;
|
||||
}
|
||||
Color c = g.getColor();
|
||||
g.setColor(group == Group.GOOD ? Color.BLUE : Color.YELLOW);
|
||||
g.fillRect(x, y, 40, 40);
|
||||
g.setColor(c);
|
||||
move();
|
||||
}
|
||||
|
||||
public void move() {
|
||||
if (!living) return;
|
||||
if (!this.moving) return;
|
||||
switch (dir) {
|
||||
case LEFT:
|
||||
x -= speed;
|
||||
break;
|
||||
case RIGHT:
|
||||
x += speed;
|
||||
break;
|
||||
case UP:
|
||||
y -= speed;
|
||||
break;
|
||||
case DOWN:
|
||||
y += speed;
|
||||
break;
|
||||
}
|
||||
if (group == Group.BAD && random.nextInt(100) > 95)
|
||||
this.fire();
|
||||
|
||||
if (this.group == Group.BAD && random.nextInt(100) > 95)
|
||||
this.randomDir();
|
||||
|
||||
boundsCheck();
|
||||
}
|
||||
|
||||
private void boundsCheck() {
|
||||
if (this.x < 0) x = TankFrame.GAME_WIDTH - WarTank.tankWidth;
|
||||
if (this.y < 28) y = TankFrame.GAME_HEIGHT - WarTank.tankHeight;
|
||||
if (this.x > TankFrame.GAME_WIDTH - tankWidth) x = 0;
|
||||
if (this.y > TankFrame.GAME_HEIGHT - tankHeight) y = 28;
|
||||
}
|
||||
|
||||
//0.4几率的随机方向
|
||||
private void randomDir() {
|
||||
if (random.nextInt(100) > 60)
|
||||
this.dir = Dir.values()[random.nextInt(4)];
|
||||
}
|
||||
|
||||
/**
|
||||
* 开火
|
||||
*/
|
||||
public void fire() {
|
||||
//fs.fire(this);
|
||||
int bx = this.getX() + this.tankWidth / 2 - ImageManger.bulletD.getWidth() / 2 + 2;
|
||||
int by = this.getY() + this.tankHeight / 2 - ImageManger.bulletD.getHeight() / 2 + 2;
|
||||
new Bullet(bx, by, this.dir, this.getGroup(), this.tankFrame);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die() {
|
||||
this.living = false;
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.study.tank.strategy;
|
||||
|
||||
import com.study.tank.Tank;
|
||||
|
||||
/**
|
||||
* @author xsj
|
||||
* @date 2022/10/25 10:30
|
||||
*/
|
||||
public interface FireStrategy {
|
||||
|
||||
void fire(Tank tank);
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.study.tank.strategy.Imp;
|
||||
|
||||
import com.study.tank.Bullet;
|
||||
import com.study.tank.ImageManger;
|
||||
import com.study.tank.Tank;
|
||||
import com.study.tank.strategy.FireStrategy;
|
||||
|
||||
/**
|
||||
* @author xsj
|
||||
* @date 2022/10/25 10:30
|
||||
*/
|
||||
public class DefaultFireStrategy implements FireStrategy {
|
||||
|
||||
@Override
|
||||
public void fire(Tank tank) {
|
||||
int bx = tank.getX() + tank.tankWidth / 2 - ImageManger.bulletD.getWidth() / 2 + 2;
|
||||
int by = tank.getY() + tank.tankHeight / 2 - ImageManger.bulletD.getHeight() / 2 + 2;
|
||||
new Bullet(bx, by, tank.dir, tank.getGroup(), tank.tankFrame);
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.study.tank.strategy.Imp;
|
||||
|
||||
import com.study.tank.Bullet;
|
||||
import com.study.tank.ImageManger;
|
||||
import com.study.tank.Tank;
|
||||
import com.study.tank.strategy.FireStrategy;
|
||||
|
||||
/**
|
||||
* @author xsj
|
||||
* @date 2022/10/25 13:28
|
||||
*/
|
||||
public class GoodTankFireStrategy implements FireStrategy {
|
||||
|
||||
@Override
|
||||
public void fire(Tank tank) {
|
||||
int bx = tank.getX() + Tank.tankWidth / 2 - ImageManger.bulletD.getWidth() / 2;
|
||||
int by = tank.getY() + Tank.tankHeight / 2 - ImageManger.bulletD.getHeight() / 2;
|
||||
switch (tank.dir) {
|
||||
case DOWN:
|
||||
new Bullet(bx, by + 6, tank.dir, tank.getGroup(), tank.tankFrame);
|
||||
new Bullet(bx, by - 6, tank.dir, tank.getGroup(), tank.tankFrame);
|
||||
break;
|
||||
case UP:
|
||||
new Bullet(bx + 1, by + 6, tank.dir, tank.getGroup(), tank.tankFrame);
|
||||
new Bullet(bx + 1, by - 6, tank.dir, tank.getGroup(), tank.tankFrame);
|
||||
break;
|
||||
case LEFT:
|
||||
new Bullet(bx + 6, by, tank.dir, tank.getGroup(), tank.tankFrame);
|
||||
new Bullet(bx - 6, by, tank.dir, tank.getGroup(), tank.tankFrame);
|
||||
break;
|
||||
case RIGHT:
|
||||
new Bullet(bx + 6, by + 1, tank.dir, tank.getGroup(), tank.tankFrame);
|
||||
new Bullet(bx - 6, by + 1, tank.dir, tank.getGroup(), tank.tankFrame);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.study.tank.util;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Auther: xiaoshengjie
|
||||
* @Date: 2022/10/23/下午7:08
|
||||
*/
|
||||
public class ImageUtil {
|
||||
public static BufferedImage rotateImage(final BufferedImage bufferedImage,
|
||||
final int degree) {
|
||||
int w = bufferedImage.getWidth();
|
||||
int h = bufferedImage.getHeight();
|
||||
int type = bufferedImage.getColorModel().getTransparency();
|
||||
BufferedImage img;
|
||||
Graphics2D graphics2D;
|
||||
(graphics2D = (img = new BufferedImage(w, h, type))
|
||||
.createGraphics()).setRenderingHint(
|
||||
RenderingHints.KEY_INTERPOLATION,
|
||||
RenderingHints.VALUE_INTERPOLATION_BILINEAR);
|
||||
graphics2D.rotate(Math.toRadians(degree), w / 2, h / 2);
|
||||
graphics2D.drawImage(bufferedImage, 0, 0, null);
|
||||
graphics2D.dispose();
|
||||
return img;
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
#tanks count at initialization
|
||||
initTankCount=10
|
||||
tankSpeed=5
|
||||
bulletSpeed=10
|
||||
gameWidth=1080
|
||||
gameHeight=720
|
||||
#strategy
|
||||
goodFs=com.study.tank.strategy.Imp.GoodTankFireStrategy
|
||||
badFs=com.study.tank.strategy.Imp.DefaultFireStrategy
|
After Width: | Height: | Size: 824 B |
After Width: | Height: | Size: 868 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 936 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 8.0 KiB |
After Width: | Height: | Size: 8.0 KiB |
After Width: | Height: | Size: 8.2 KiB |
After Width: | Height: | Size: 8.2 KiB |
After Width: | Height: | Size: 855 B |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 852 B |
After Width: | Height: | Size: 847 B |
After Width: | Height: | Size: 312 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1022 B |
After Width: | Height: | Size: 814 B |
After Width: | Height: | Size: 460 B |
After Width: | Height: | Size: 280 B |
After Width: | Height: | Size: 565 B |
After Width: | Height: | Size: 846 B |
After Width: | Height: | Size: 1.0 KiB |