Upload original JAVA语言程序设计 course files
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- JAVA——wh/company/.idea/.gitignore +3 -3
- JAVA——wh/company/.idea/misc.xml +5 -3
- JAVA——wh/company/.idea/modules.xml +8 -3
- JAVA——wh/company/.idea/workspace.xml +55 -3
- JAVA——wh/company/Bg.java +116 -3
- JAVA——wh/company/GameWin.java +166 -3
- JAVA——wh/company/Gold.java +39 -3
- JAVA——wh/company/Line.java +131 -3
- JAVA——wh/company/Object.java +35 -3
- JAVA——wh/company/Rock.java +17 -3
- JAVA——wh/company/company.iml +11 -3
- JAVA——wh/company/imgs/bg1.jpg +0 -0
- JAVA——wh/company/imgs/gold0.gif +0 -0
- JAVA——wh/company/imgs/gold1.gif +0 -0
- JAVA——wh/company/imgs/gold2.gif +0 -0
- JAVA——wh/company/imgs/hook.png +0 -0
- JAVA——wh/company/imgs/peo.png +0 -0
- JAVA——wh/company/imgs/rock1.png +0 -0
- JAVA——wh/company/imgs/water.png +0 -0
- JAVA——wh/company/out/production/company/com/company/.idea/.gitignore +3 -3
- JAVA——wh/company/out/production/company/com/company/.idea/misc.xml +5 -3
- JAVA——wh/company/out/production/company/com/company/.idea/modules.xml +8 -3
- JAVA——wh/company/out/production/company/com/company/.idea/workspace.xml +55 -3
- JAVA——wh/company/out/production/company/com/company/Bg.class +0 -0
- JAVA——wh/company/out/production/company/com/company/GameWin$1.class +0 -0
- JAVA——wh/company/out/production/company/com/company/GameWin.class +0 -0
- JAVA——wh/company/out/production/company/com/company/Gold.class +0 -0
- JAVA——wh/company/out/production/company/com/company/GoldMini.class +0 -0
- JAVA——wh/company/out/production/company/com/company/GoldPlus.class +0 -0
- JAVA——wh/company/out/production/company/com/company/Line.class +0 -0
- JAVA——wh/company/out/production/company/com/company/Object.class +0 -0
- JAVA——wh/company/out/production/company/com/company/Rock.class +0 -0
- JAVA——wh/company/out/production/company/com/company/company.iml +11 -3
- JAVA——wh/company/out/production/company/com/company/imgs/bg1.jpg +0 -0
- JAVA——wh/company/out/production/company/com/company/imgs/gold0.gif +0 -0
- JAVA——wh/company/out/production/company/com/company/imgs/gold1.gif +0 -0
- JAVA——wh/company/out/production/company/com/company/imgs/gold2.gif +0 -0
- JAVA——wh/company/out/production/company/com/company/imgs/hook.png +0 -0
- JAVA——wh/company/out/production/company/com/company/imgs/peo.png +0 -0
- JAVA——wh/company/out/production/company/com/company/imgs/rock1.png +0 -0
- JAVA——wh/company/out/production/company/com/company/imgs/water.png +0 -0
- Java——eclipse/.metadata/.bak_0.log +0 -0
- Java——eclipse/.metadata/.log +0 -0
- Java——eclipse/.metadata/.mylyn/.taskListIndex/segments_1 +0 -0
- Java——eclipse/.metadata/.mylyn/.tasks.xml.zip +0 -0
- Java——eclipse/.metadata/.mylyn/repositories.xml.zip +0 -0
- Java——eclipse/.metadata/.mylyn/tasks.xml.zip +0 -0
- Java——eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/b01717cc4a2d001f1346b6d1d1b63337 +20 -3
- Java——eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/d0c582df392d001f153ecf6b566d160a +7 -3
- Java——eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/70bf25fd392d001f153ecf6b566d160a +7 -3
JAVA——wh/company/.idea/.gitignore
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
| 1 |
+
# Default ignored files
|
| 2 |
+
/shelf/
|
| 3 |
+
/workspace.xml
|
JAVA——wh/company/.idea/misc.xml
CHANGED
|
@@ -1,3 +1,5 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
<project version="4">
|
| 2 |
+
<component name="ProjectRootManager" version="2" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
| 3 |
+
<output url="file://$PROJECT_DIR$/out" />
|
| 4 |
+
</component>
|
| 5 |
+
</project>
|
JAVA——wh/company/.idea/modules.xml
CHANGED
|
@@ -1,3 +1,8 @@
|
|
| 1 |
-
version
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<project version="4">
|
| 3 |
+
<component name="ProjectModuleManager">
|
| 4 |
+
<modules>
|
| 5 |
+
<module fileurl="file://$PROJECT_DIR$/company.iml" filepath="$PROJECT_DIR$/company.iml" />
|
| 6 |
+
</modules>
|
| 7 |
+
</component>
|
| 8 |
+
</project>
|
JAVA——wh/company/.idea/workspace.xml
CHANGED
|
@@ -1,3 +1,55 @@
|
|
| 1 |
-
version
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<project version="4">
|
| 3 |
+
<component name="ChangeListManager">
|
| 4 |
+
<list default="true" id="bb8c7901-dd07-4a38-9c2e-0587ae86bb58" name="Changes" comment="" />
|
| 5 |
+
<option name="SHOW_DIALOG" value="false" />
|
| 6 |
+
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
| 7 |
+
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
| 8 |
+
<option name="LAST_RESOLUTION" value="IGNORE" />
|
| 9 |
+
</component>
|
| 10 |
+
<component name="ProjectColorInfo"><![CDATA[{
|
| 11 |
+
"associatedIndex": 8
|
| 12 |
+
}]]></component>
|
| 13 |
+
<component name="ProjectId" id="2qn3M1q1fClvkulikwgMCV0yuRV" />
|
| 14 |
+
<component name="ProjectViewState">
|
| 15 |
+
<option name="hideEmptyMiddlePackages" value="true" />
|
| 16 |
+
<option name="showLibraryContents" value="true" />
|
| 17 |
+
</component>
|
| 18 |
+
<component name="PropertiesComponent"><![CDATA[{
|
| 19 |
+
"keyToString": {
|
| 20 |
+
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
| 21 |
+
"RunOnceActivity.ShowReadmeOnStart": "true"
|
| 22 |
+
}
|
| 23 |
+
}]]></component>
|
| 24 |
+
<component name="RunManager">
|
| 25 |
+
<configuration name="GameWin" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
| 26 |
+
<option name="MAIN_CLASS_NAME" value="com.company.GameWin" />
|
| 27 |
+
<module name="company" />
|
| 28 |
+
<extension name="coverage">
|
| 29 |
+
<pattern>
|
| 30 |
+
<option name="PATTERN" value="com.company.*" />
|
| 31 |
+
<option name="ENABLED" value="true" />
|
| 32 |
+
</pattern>
|
| 33 |
+
</extension>
|
| 34 |
+
<method v="2">
|
| 35 |
+
<option name="Make" enabled="true" />
|
| 36 |
+
</method>
|
| 37 |
+
</configuration>
|
| 38 |
+
<recent_temporary>
|
| 39 |
+
<list>
|
| 40 |
+
<item itemvalue="Application.GameWin" />
|
| 41 |
+
</list>
|
| 42 |
+
</recent_temporary>
|
| 43 |
+
</component>
|
| 44 |
+
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
| 45 |
+
<component name="TaskManager">
|
| 46 |
+
<task active="true" id="Default" summary="Default task">
|
| 47 |
+
<changelist id="bb8c7901-dd07-4a38-9c2e-0587ae86bb58" name="Changes" comment="" />
|
| 48 |
+
<created>1735284461381</created>
|
| 49 |
+
<option name="number" value="Default" />
|
| 50 |
+
<option name="presentableId" value="Default" />
|
| 51 |
+
<updated>1735284461381</updated>
|
| 52 |
+
</task>
|
| 53 |
+
<servers />
|
| 54 |
+
</component>
|
| 55 |
+
</project>
|
JAVA——wh/company/Bg.java
CHANGED
|
@@ -1,3 +1,116 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
package com.company;
|
| 2 |
+
|
| 3 |
+
import java.awt.*;
|
| 4 |
+
|
| 5 |
+
public class Bg {
|
| 6 |
+
// 关卡数
|
| 7 |
+
static int level = 1;
|
| 8 |
+
// 目标得分
|
| 9 |
+
int goal = (level * 500) + 550;
|
| 10 |
+
// 总分
|
| 11 |
+
static int count = 0;
|
| 12 |
+
// 药水数量
|
| 13 |
+
static int waterNum = 3;
|
| 14 |
+
// 药水状态
|
| 15 |
+
static boolean waterFlag = false;
|
| 16 |
+
// 开始时间
|
| 17 |
+
long startTime;
|
| 18 |
+
// 结束时间
|
| 19 |
+
long endTime;
|
| 20 |
+
// 药水价格
|
| 21 |
+
int price = (int) (Math.random() * 10);
|
| 22 |
+
// 是否进入商店 f不购买
|
| 23 |
+
boolean shop = false;
|
| 24 |
+
|
| 25 |
+
// 载入图片
|
| 26 |
+
Image bg = Toolkit.getDefaultToolkit().getImage("imgs/bg.jpg");
|
| 27 |
+
Image bg1 = Toolkit.getDefaultToolkit().getImage("imgs/bg1.jpg");
|
| 28 |
+
Image peo = Toolkit.getDefaultToolkit().getImage("imgs/peo.png");
|
| 29 |
+
Image water = Toolkit.getDefaultToolkit().getImage("imgs/water.png");
|
| 30 |
+
|
| 31 |
+
// 绘制
|
| 32 |
+
void paintSelf(Graphics g) {
|
| 33 |
+
g.drawImage(bg, 0, 200, null);
|
| 34 |
+
g.drawImage(bg1, 0, 0, null);
|
| 35 |
+
switch (GameWin.state) {
|
| 36 |
+
case 0:
|
| 37 |
+
drawWord(g, 80, Color.black, "按鼠标右键开始", 100, 400);
|
| 38 |
+
drawWord(g, 60, Color.red, "游戏规则:", 100, 500);
|
| 39 |
+
drawWord(g, 30, Color.black, "点击鼠标左键放出抓钩", 100, 560);
|
| 40 |
+
drawWord(g, 30, Color.black, "抓住金块或石头可以点击鼠标右键", 100, 620);
|
| 41 |
+
drawWord(g, 30, Color.black, "使用“大力神药”快速收回金块或者爆破石头", 100, 680);
|
| 42 |
+
break;
|
| 43 |
+
case 1:
|
| 44 |
+
g.drawImage(peo, 310, 50, null);
|
| 45 |
+
drawWord(g, 30, Color.black, "分数:" + count, 30, 150);
|
| 46 |
+
g.drawImage(water, 550, 40, null);
|
| 47 |
+
drawWord(g, 30, Color.black, "×" + waterNum, 610, 90);
|
| 48 |
+
// 关卡数&目标得分
|
| 49 |
+
drawWord(g, 20, Color.black, "关卡:" + level, 30, 60);
|
| 50 |
+
drawWord(g, 30, Color.black, "目标:" + goal, 30, 115);
|
| 51 |
+
// 实时赋值
|
| 52 |
+
endTime = System.currentTimeMillis();
|
| 53 |
+
long time = 20 - (endTime - startTime) / 1000;
|
| 54 |
+
drawWord(g, 30, Color.black, "时间:" + (time > 0 ? time : 0), 520, 150);
|
| 55 |
+
break;
|
| 56 |
+
case 2:
|
| 57 |
+
g.drawImage(water, 330, 380, null);
|
| 58 |
+
drawWord(g, 30, Color.black, "价格:" + price, 300, 500);
|
| 59 |
+
drawWord(g, 30, Color.black, "是否购买“大力神药”?", 280, 550);
|
| 60 |
+
drawWord(g, 30, Color.black, "点击鼠标左键确认购买,右键退出商店", 100, 700);
|
| 61 |
+
|
| 62 |
+
if (shop) {
|
| 63 |
+
count = count - price;
|
| 64 |
+
waterNum++;
|
| 65 |
+
shop = false;
|
| 66 |
+
GameWin.state = 1;
|
| 67 |
+
startTime = System.currentTimeMillis();
|
| 68 |
+
}
|
| 69 |
+
break;
|
| 70 |
+
case 3:
|
| 71 |
+
drawWord(g, 80, Color.cyan, "失败", 300, 350);
|
| 72 |
+
drawWord(g, 80, Color.black, "分数:" + count, 200, 450);
|
| 73 |
+
drawWord(g, 60, Color.black, "点击鼠标左键重新开始", 90, 550);
|
| 74 |
+
break;
|
| 75 |
+
case 4:
|
| 76 |
+
drawWord(g, 80, Color.red, "恭喜过关", 250, 350);
|
| 77 |
+
drawWord(g, 80, Color.black, "分数:" + count, 200, 450);
|
| 78 |
+
drawWord(g, 60, Color.black, "点击鼠标左键重新开始", 90, 550);
|
| 79 |
+
break;
|
| 80 |
+
default:
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
// t倒计时完成,f未完成倒计时
|
| 86 |
+
boolean gameTime() {
|
| 87 |
+
long time = (endTime - startTime) / 1000;
|
| 88 |
+
if (time >= 20) {
|
| 89 |
+
return true;
|
| 90 |
+
}
|
| 91 |
+
return false;
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
// 重置元素
|
| 95 |
+
void reGame() {
|
| 96 |
+
// 关卡数
|
| 97 |
+
level = 1;
|
| 98 |
+
// 目标得分
|
| 99 |
+
goal = (level * 500) + 550;
|
| 100 |
+
// 总分
|
| 101 |
+
count = 0;
|
| 102 |
+
// 药水数量
|
| 103 |
+
waterNum = 3;
|
| 104 |
+
// 药水状态
|
| 105 |
+
waterFlag = false;
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
// 绘制字符串
|
| 109 |
+
public static void drawWord(Graphics g, int size, Color color, String str, int x, int y) {
|
| 110 |
+
g.setColor(color);
|
| 111 |
+
g.setFont(new Font("宋体", Font.BOLD, size));
|
| 112 |
+
g.drawString(str, x, y);
|
| 113 |
+
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
}
|
JAVA——wh/company/GameWin.java
CHANGED
|
@@ -1,3 +1,166 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
package com.company;
|
| 2 |
+
|
| 3 |
+
import javax.swing.*;
|
| 4 |
+
import java.awt.*;
|
| 5 |
+
import java.awt.event.MouseAdapter;
|
| 6 |
+
import java.awt.event.MouseEvent;
|
| 7 |
+
import java.util.ArrayList;
|
| 8 |
+
import java.util.List;
|
| 9 |
+
|
| 10 |
+
public class GameWin extends JFrame {
|
| 11 |
+
// 0未开始,1运行中,2商店,3失败,4胜利
|
| 12 |
+
static int state = 0;
|
| 13 |
+
// 存储金块、石块
|
| 14 |
+
List<Object> objectList = new ArrayList<>();
|
| 15 |
+
|
| 16 |
+
Bg bg = new Bg();
|
| 17 |
+
|
| 18 |
+
Line line = new Line(this);
|
| 19 |
+
|
| 20 |
+
{
|
| 21 |
+
// 是否可以放置
|
| 22 |
+
boolean isPlace = true;
|
| 23 |
+
for (int i = 0; i < 11; i++) {
|
| 24 |
+
double random = Math.random();
|
| 25 |
+
Gold gold; // 存放当前生成的金块
|
| 26 |
+
if (random < 0.3) {
|
| 27 |
+
gold = new GoldMini();
|
| 28 |
+
} else if (random < 0.7) {
|
| 29 |
+
gold = new Gold();
|
| 30 |
+
} else {
|
| 31 |
+
gold = new GoldPlus();
|
| 32 |
+
}
|
| 33 |
+
for (Object obj : objectList) {
|
| 34 |
+
if (gold.getRec().intersects(obj.getRec())) {
|
| 35 |
+
// 不可放置
|
| 36 |
+
isPlace = false;
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
if (isPlace) {
|
| 40 |
+
objectList.add(gold);
|
| 41 |
+
} else {
|
| 42 |
+
isPlace = true;
|
| 43 |
+
i--;
|
| 44 |
+
}
|
| 45 |
+
}
|
| 46 |
+
for (int i = 0; i < 5; i++) {
|
| 47 |
+
Rock rock = new Rock();
|
| 48 |
+
for (Object obj : objectList) {
|
| 49 |
+
if (rock.getRec().intersects(obj.getRec())) {
|
| 50 |
+
isPlace = false;
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
if (isPlace) {
|
| 54 |
+
objectList.add(rock);
|
| 55 |
+
} else {
|
| 56 |
+
isPlace = true;
|
| 57 |
+
i--;
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
Image offScreenImage;
|
| 63 |
+
void launch() {
|
| 64 |
+
this.setVisible(true);
|
| 65 |
+
this.setSize(768, 1000);
|
| 66 |
+
this.setLocationRelativeTo(null);
|
| 67 |
+
this.setTitle("黄金矿工");
|
| 68 |
+
setDefaultCloseOperation(EXIT_ON_CLOSE);
|
| 69 |
+
addMouseListener(new MouseAdapter() {
|
| 70 |
+
@Override
|
| 71 |
+
public void mouseClicked(MouseEvent e) {
|
| 72 |
+
super.mouseClicked(e);
|
| 73 |
+
switch (state) {
|
| 74 |
+
case 0:
|
| 75 |
+
if (e.getButton() == 3) {
|
| 76 |
+
state = 1;
|
| 77 |
+
bg.startTime = System.currentTimeMillis();
|
| 78 |
+
}
|
| 79 |
+
break;
|
| 80 |
+
case 1:
|
| 81 |
+
if (e.getButton() == 1 && line.state == 0) {
|
| 82 |
+
line.state = 1;
|
| 83 |
+
}
|
| 84 |
+
if (e.getButton() == 3 && line.state == 3 && Bg.waterNum > 0) {
|
| 85 |
+
Bg.waterFlag = true;
|
| 86 |
+
Bg.waterNum--;
|
| 87 |
+
}
|
| 88 |
+
break;
|
| 89 |
+
case 2:
|
| 90 |
+
if (e.getButton() == 1) {
|
| 91 |
+
bg.shop = true;
|
| 92 |
+
|
| 93 |
+
}
|
| 94 |
+
if (e.getButton() == 3) {
|
| 95 |
+
state = 1;
|
| 96 |
+
bg.startTime = System.currentTimeMillis();
|
| 97 |
+
}
|
| 98 |
+
break;
|
| 99 |
+
case 3:
|
| 100 |
+
case 4:
|
| 101 |
+
if (e.getButton() == 1) {
|
| 102 |
+
state = 0;
|
| 103 |
+
bg.reGame();
|
| 104 |
+
line.reGame();
|
| 105 |
+
}
|
| 106 |
+
break;
|
| 107 |
+
default:
|
| 108 |
+
}
|
| 109 |
+
}
|
| 110 |
+
});
|
| 111 |
+
|
| 112 |
+
// 红线摇摆
|
| 113 |
+
while (true) {
|
| 114 |
+
repaint();
|
| 115 |
+
nextLevel();
|
| 116 |
+
try {
|
| 117 |
+
Thread.sleep(50);
|
| 118 |
+
} catch (InterruptedException e) {
|
| 119 |
+
e.printStackTrace();
|
| 120 |
+
}
|
| 121 |
+
}
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
// 下一关
|
| 126 |
+
public void nextLevel() {
|
| 127 |
+
if (bg.gameTime() && state == 1) {
|
| 128 |
+
if (Bg.count >= bg.goal) {
|
| 129 |
+
if (Bg.level == 10) {
|
| 130 |
+
state = 4;
|
| 131 |
+
} else {
|
| 132 |
+
state = 2;
|
| 133 |
+
Bg.level++;
|
| 134 |
+
}
|
| 135 |
+
} else {
|
| 136 |
+
state = 3;
|
| 137 |
+
}
|
| 138 |
+
dispose();
|
| 139 |
+
GameWin gameWin1 = new GameWin();
|
| 140 |
+
gameWin1.launch();
|
| 141 |
+
}
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
@Override
|
| 145 |
+
public void paint(Graphics g) {
|
| 146 |
+
offScreenImage = this.createImage(768, 1000);
|
| 147 |
+
Graphics gImage = offScreenImage.getGraphics();
|
| 148 |
+
|
| 149 |
+
bg.paintSelf(gImage);
|
| 150 |
+
if (state == 1) {
|
| 151 |
+
// 绘制金块、石块
|
| 152 |
+
for (Object obj : objectList) {
|
| 153 |
+
obj.paintSelf(gImage);
|
| 154 |
+
}
|
| 155 |
+
// 绘制红线
|
| 156 |
+
line.paintSelf(gImage);
|
| 157 |
+
}
|
| 158 |
+
g.drawImage(offScreenImage, 0, 0, null);
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
public static void main(String[] args) {
|
| 162 |
+
GameWin game = new GameWin();
|
| 163 |
+
game.launch();
|
| 164 |
+
}
|
| 165 |
+
}
|
| 166 |
+
|
JAVA——wh/company/Gold.java
CHANGED
|
@@ -1,3 +1,39 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
package com.company;
|
| 2 |
+
|
| 3 |
+
import java.awt.*;
|
| 4 |
+
|
| 5 |
+
public class Gold extends Object {
|
| 6 |
+
|
| 7 |
+
Gold() {
|
| 8 |
+
this.x = (int) (Math.random() * 700);
|
| 9 |
+
this.y = (int) (Math.random() * 550 + 300);
|
| 10 |
+
this.width = 52;
|
| 11 |
+
this.height = 52;
|
| 12 |
+
this.flag = false;
|
| 13 |
+
this.m = 30;
|
| 14 |
+
this.count = 250;
|
| 15 |
+
this.type = 1;
|
| 16 |
+
this.img = Toolkit.getDefaultToolkit().getImage("imgs/gold1.gif");
|
| 17 |
+
}
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
class GoldMini extends Gold {
|
| 21 |
+
GoldMini() {
|
| 22 |
+
this.width = 36;
|
| 23 |
+
this.height = 36;
|
| 24 |
+
this.m = 30;
|
| 25 |
+
this.count = 150;
|
| 26 |
+
this.img = Toolkit.getDefaultToolkit().getImage("imgs/gold0.gif");
|
| 27 |
+
}
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
class GoldPlus extends Gold {
|
| 31 |
+
GoldPlus() {
|
| 32 |
+
this.x = (int) (Math.random() * 650);
|
| 33 |
+
this.width = 105;
|
| 34 |
+
this.height = 105;
|
| 35 |
+
this.m = 100;
|
| 36 |
+
this.count = 500;
|
| 37 |
+
this.img = Toolkit.getDefaultToolkit().getImage("imgs/gold2.gif");
|
| 38 |
+
}
|
| 39 |
+
}
|
JAVA——wh/company/Line.java
CHANGED
|
@@ -1,3 +1,131 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
package com.company;
|
| 2 |
+
|
| 3 |
+
import java.awt.*;
|
| 4 |
+
|
| 5 |
+
public class Line {
|
| 6 |
+
// 起点坐标
|
| 7 |
+
int x = 380;
|
| 8 |
+
int y = 180;
|
| 9 |
+
// 终点坐标
|
| 10 |
+
int endx = 500;
|
| 11 |
+
int endy = 500;
|
| 12 |
+
// 线段长度
|
| 13 |
+
double length = 100;
|
| 14 |
+
double MIN_length = 100;
|
| 15 |
+
double MAX_length = 750;
|
| 16 |
+
double n = 0;
|
| 17 |
+
// 方向
|
| 18 |
+
int dir = 1;
|
| 19 |
+
// 状态: 0摇摆,1抓取,2回收,3抓取返回
|
| 20 |
+
int state=0;
|
| 21 |
+
// 钩爪
|
| 22 |
+
Image hook = Toolkit.getDefaultToolkit().getImage("imgs/hook.png");
|
| 23 |
+
|
| 24 |
+
GameWin frame;
|
| 25 |
+
|
| 26 |
+
Line(GameWin frame) {
|
| 27 |
+
this.frame = frame;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
// 判断是否抓取成功
|
| 31 |
+
void logic() {
|
| 32 |
+
for (Object obj : this.frame.objectList) {
|
| 33 |
+
if (endx > obj.x && endx < obj.x + obj.width && endy > obj.y && endy < obj.y + obj.height) {
|
| 34 |
+
state = 3;
|
| 35 |
+
obj.flag = true;
|
| 36 |
+
}
|
| 37 |
+
}
|
| 38 |
+
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
// 绘制方法
|
| 42 |
+
void lines(Graphics g) {
|
| 43 |
+
endx = (int) (x + length * Math.cos(n * Math.PI));
|
| 44 |
+
endy = (int) (y + length * Math.sin(n * Math.PI));
|
| 45 |
+
g.setColor(Color.red);
|
| 46 |
+
g.drawLine(x - 1, y - 1, endx - 1, endy);
|
| 47 |
+
g.drawLine(x, y, endx, endy);
|
| 48 |
+
g.drawLine(x + 1, y + 1, endx + 1, endy);
|
| 49 |
+
g.drawImage(hook, endx - 36, endy - 2, null);
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
void paintSelf(Graphics g) {
|
| 53 |
+
|
| 54 |
+
logic();
|
| 55 |
+
|
| 56 |
+
switch (state) {
|
| 57 |
+
case 0:
|
| 58 |
+
if (n < 0.1) {
|
| 59 |
+
dir = 1;
|
| 60 |
+
} else if (n > 0.9) {
|
| 61 |
+
dir = -1;
|
| 62 |
+
}
|
| 63 |
+
n = n + 0.02 * dir;
|
| 64 |
+
lines(g);
|
| 65 |
+
break;
|
| 66 |
+
case 1:
|
| 67 |
+
if (length < MAX_length) {
|
| 68 |
+
length = length + 50;
|
| 69 |
+
lines(g);
|
| 70 |
+
} else {
|
| 71 |
+
state = 2;
|
| 72 |
+
}
|
| 73 |
+
break;
|
| 74 |
+
case 2:
|
| 75 |
+
if (length > MIN_length) {
|
| 76 |
+
length = length - 50;
|
| 77 |
+
lines(g);
|
| 78 |
+
} else {
|
| 79 |
+
state = 0;
|
| 80 |
+
}
|
| 81 |
+
break;
|
| 82 |
+
case 3:
|
| 83 |
+
int m = 1;
|
| 84 |
+
if (length > MIN_length) {
|
| 85 |
+
length = length - 20;
|
| 86 |
+
lines(g);
|
| 87 |
+
for (Object obj : this.frame.objectList) {
|
| 88 |
+
if (obj.flag) {
|
| 89 |
+
m = obj.m;
|
| 90 |
+
obj.x = endx - obj.getWidth() / 2;
|
| 91 |
+
obj.y = endy;
|
| 92 |
+
if (length <= MIN_length) {
|
| 93 |
+
obj.x = -150;
|
| 94 |
+
obj.y = -150;
|
| 95 |
+
obj.flag = false;
|
| 96 |
+
Bg.waterFlag = false;
|
| 97 |
+
// 加分
|
| 98 |
+
Bg.count += obj.count;
|
| 99 |
+
state = 0;
|
| 100 |
+
}
|
| 101 |
+
if (Bg.waterFlag) {
|
| 102 |
+
if (obj.type == 1) {
|
| 103 |
+
m = 1;
|
| 104 |
+
}
|
| 105 |
+
if (obj.type == 2) {
|
| 106 |
+
obj.x = -150;
|
| 107 |
+
obj.y = -150;
|
| 108 |
+
obj.flag = false;
|
| 109 |
+
Bg.waterFlag = false;
|
| 110 |
+
state = 2;
|
| 111 |
+
}
|
| 112 |
+
}
|
| 113 |
+
}
|
| 114 |
+
}
|
| 115 |
+
}
|
| 116 |
+
try {
|
| 117 |
+
Thread.sleep(m);
|
| 118 |
+
} catch (InterruptedException e) {
|
| 119 |
+
e.printStackTrace();
|
| 120 |
+
}
|
| 121 |
+
break;
|
| 122 |
+
default:
|
| 123 |
+
}
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
// 重置线
|
| 127 |
+
void reGame() {
|
| 128 |
+
n = 0;
|
| 129 |
+
length = 100;
|
| 130 |
+
}
|
| 131 |
+
}
|
JAVA——wh/company/Object.java
CHANGED
|
@@ -1,3 +1,35 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
package com.company;
|
| 2 |
+
|
| 3 |
+
import java.awt.*;
|
| 4 |
+
|
| 5 |
+
public class Object {
|
| 6 |
+
// 坐标
|
| 7 |
+
int x;
|
| 8 |
+
int y;
|
| 9 |
+
// 宽高
|
| 10 |
+
int width;
|
| 11 |
+
int height;
|
| 12 |
+
// 图片
|
| 13 |
+
Image img;
|
| 14 |
+
// 标记 是否能移动
|
| 15 |
+
boolean flag = false;
|
| 16 |
+
// 质量
|
| 17 |
+
int m;
|
| 18 |
+
// 积分
|
| 19 |
+
int count;
|
| 20 |
+
// 类型 1 金块 2 石块 3
|
| 21 |
+
int type;
|
| 22 |
+
|
| 23 |
+
void paintSelf(Graphics g) {
|
| 24 |
+
g.drawImage(img, x, y, null);
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
public int getWidth() {
|
| 28 |
+
return width;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
// 获取矩形
|
| 32 |
+
public Rectangle getRec() {
|
| 33 |
+
return new Rectangle(x, y, width, height);
|
| 34 |
+
}
|
| 35 |
+
}
|
JAVA——wh/company/Rock.java
CHANGED
|
@@ -1,3 +1,17 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
package com.company;
|
| 2 |
+
|
| 3 |
+
import java.awt.*;
|
| 4 |
+
|
| 5 |
+
public class Rock extends Object {
|
| 6 |
+
Rock() {
|
| 7 |
+
this.x = (int) (Math.random() * 700);
|
| 8 |
+
this.y = (int) (Math.random() * 550 + 300);
|
| 9 |
+
this.width = 71;
|
| 10 |
+
this.height = 71;
|
| 11 |
+
this.flag = false;
|
| 12 |
+
this.m = 100;
|
| 13 |
+
this.count = 15;
|
| 14 |
+
this.type = 2;
|
| 15 |
+
this.img = Toolkit.getDefaultToolkit().getImage("imgs/rock1.png");
|
| 16 |
+
}
|
| 17 |
+
}
|
JAVA——wh/company/company.iml
CHANGED
|
@@ -1,3 +1,11 @@
|
|
| 1 |
-
version
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<module type="JAVA_MODULE" version="4">
|
| 3 |
+
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
| 4 |
+
<exclude-output />
|
| 5 |
+
<content url="file://$MODULE_DIR$">
|
| 6 |
+
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" packagePrefix="com.company" />
|
| 7 |
+
</content>
|
| 8 |
+
<orderEntry type="inheritedJdk" />
|
| 9 |
+
<orderEntry type="sourceFolder" forTests="false" />
|
| 10 |
+
</component>
|
| 11 |
+
</module>
|
JAVA——wh/company/imgs/bg1.jpg
CHANGED
|
Git LFS Details
|
|
JAVA——wh/company/imgs/gold0.gif
CHANGED
|
Git LFS Details
|
|
JAVA——wh/company/imgs/gold1.gif
CHANGED
|
Git LFS Details
|
|
JAVA——wh/company/imgs/gold2.gif
CHANGED
|
Git LFS Details
|
|
JAVA——wh/company/imgs/hook.png
CHANGED
|
Git LFS Details
|
|
JAVA——wh/company/imgs/peo.png
CHANGED
|
Git LFS Details
|
|
JAVA——wh/company/imgs/rock1.png
CHANGED
|
Git LFS Details
|
|
JAVA——wh/company/imgs/water.png
CHANGED
|
Git LFS Details
|
|
JAVA——wh/company/out/production/company/com/company/.idea/.gitignore
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
| 1 |
+
# Default ignored files
|
| 2 |
+
/shelf/
|
| 3 |
+
/workspace.xml
|
JAVA——wh/company/out/production/company/com/company/.idea/misc.xml
CHANGED
|
@@ -1,3 +1,5 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
<project version="4">
|
| 2 |
+
<component name="ProjectRootManager" version="2" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
| 3 |
+
<output url="file://$PROJECT_DIR$/out" />
|
| 4 |
+
</component>
|
| 5 |
+
</project>
|
JAVA——wh/company/out/production/company/com/company/.idea/modules.xml
CHANGED
|
@@ -1,3 +1,8 @@
|
|
| 1 |
-
version
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<project version="4">
|
| 3 |
+
<component name="ProjectModuleManager">
|
| 4 |
+
<modules>
|
| 5 |
+
<module fileurl="file://$PROJECT_DIR$/company.iml" filepath="$PROJECT_DIR$/company.iml" />
|
| 6 |
+
</modules>
|
| 7 |
+
</component>
|
| 8 |
+
</project>
|
JAVA——wh/company/out/production/company/com/company/.idea/workspace.xml
CHANGED
|
@@ -1,3 +1,55 @@
|
|
| 1 |
-
version
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<project version="4">
|
| 3 |
+
<component name="ChangeListManager">
|
| 4 |
+
<list default="true" id="bb8c7901-dd07-4a38-9c2e-0587ae86bb58" name="Changes" comment="" />
|
| 5 |
+
<option name="SHOW_DIALOG" value="false" />
|
| 6 |
+
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
| 7 |
+
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
| 8 |
+
<option name="LAST_RESOLUTION" value="IGNORE" />
|
| 9 |
+
</component>
|
| 10 |
+
<component name="ProjectColorInfo"><![CDATA[{
|
| 11 |
+
"associatedIndex": 8
|
| 12 |
+
}]]></component>
|
| 13 |
+
<component name="ProjectId" id="2qn3M1q1fClvkulikwgMCV0yuRV" />
|
| 14 |
+
<component name="ProjectViewState">
|
| 15 |
+
<option name="hideEmptyMiddlePackages" value="true" />
|
| 16 |
+
<option name="showLibraryContents" value="true" />
|
| 17 |
+
</component>
|
| 18 |
+
<component name="PropertiesComponent"><![CDATA[{
|
| 19 |
+
"keyToString": {
|
| 20 |
+
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
| 21 |
+
"RunOnceActivity.ShowReadmeOnStart": "true"
|
| 22 |
+
}
|
| 23 |
+
}]]></component>
|
| 24 |
+
<component name="RunManager">
|
| 25 |
+
<configuration name="GameWin" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
| 26 |
+
<option name="MAIN_CLASS_NAME" value="com.company.GameWin" />
|
| 27 |
+
<module name="company" />
|
| 28 |
+
<extension name="coverage">
|
| 29 |
+
<pattern>
|
| 30 |
+
<option name="PATTERN" value="com.company.*" />
|
| 31 |
+
<option name="ENABLED" value="true" />
|
| 32 |
+
</pattern>
|
| 33 |
+
</extension>
|
| 34 |
+
<method v="2">
|
| 35 |
+
<option name="Make" enabled="true" />
|
| 36 |
+
</method>
|
| 37 |
+
</configuration>
|
| 38 |
+
<recent_temporary>
|
| 39 |
+
<list>
|
| 40 |
+
<item itemvalue="Application.GameWin" />
|
| 41 |
+
</list>
|
| 42 |
+
</recent_temporary>
|
| 43 |
+
</component>
|
| 44 |
+
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
| 45 |
+
<component name="TaskManager">
|
| 46 |
+
<task active="true" id="Default" summary="Default task">
|
| 47 |
+
<changelist id="bb8c7901-dd07-4a38-9c2e-0587ae86bb58" name="Changes" comment="" />
|
| 48 |
+
<created>1735284461381</created>
|
| 49 |
+
<option name="number" value="Default" />
|
| 50 |
+
<option name="presentableId" value="Default" />
|
| 51 |
+
<updated>1735284461381</updated>
|
| 52 |
+
</task>
|
| 53 |
+
<servers />
|
| 54 |
+
</component>
|
| 55 |
+
</project>
|
JAVA——wh/company/out/production/company/com/company/Bg.class
CHANGED
|
Binary files "a/JAVA\342\200\224\342\200\224wh/company/out/production/company/com/company/Bg.class" and "b/JAVA\342\200\224\342\200\224wh/company/out/production/company/com/company/Bg.class" differ
|
|
|
JAVA——wh/company/out/production/company/com/company/GameWin$1.class
CHANGED
|
Binary files "a/JAVA\342\200\224\342\200\224wh/company/out/production/company/com/company/GameWin$1.class" and "b/JAVA\342\200\224\342\200\224wh/company/out/production/company/com/company/GameWin$1.class" differ
|
|
|
JAVA——wh/company/out/production/company/com/company/GameWin.class
CHANGED
|
Binary files "a/JAVA\342\200\224\342\200\224wh/company/out/production/company/com/company/GameWin.class" and "b/JAVA\342\200\224\342\200\224wh/company/out/production/company/com/company/GameWin.class" differ
|
|
|
JAVA——wh/company/out/production/company/com/company/Gold.class
CHANGED
|
Binary files "a/JAVA\342\200\224\342\200\224wh/company/out/production/company/com/company/Gold.class" and "b/JAVA\342\200\224\342\200\224wh/company/out/production/company/com/company/Gold.class" differ
|
|
|
JAVA——wh/company/out/production/company/com/company/GoldMini.class
CHANGED
|
Binary files "a/JAVA\342\200\224\342\200\224wh/company/out/production/company/com/company/GoldMini.class" and "b/JAVA\342\200\224\342\200\224wh/company/out/production/company/com/company/GoldMini.class" differ
|
|
|
JAVA——wh/company/out/production/company/com/company/GoldPlus.class
CHANGED
|
Binary files "a/JAVA\342\200\224\342\200\224wh/company/out/production/company/com/company/GoldPlus.class" and "b/JAVA\342\200\224\342\200\224wh/company/out/production/company/com/company/GoldPlus.class" differ
|
|
|
JAVA——wh/company/out/production/company/com/company/Line.class
CHANGED
|
Binary files "a/JAVA\342\200\224\342\200\224wh/company/out/production/company/com/company/Line.class" and "b/JAVA\342\200\224\342\200\224wh/company/out/production/company/com/company/Line.class" differ
|
|
|
JAVA——wh/company/out/production/company/com/company/Object.class
CHANGED
|
Binary files "a/JAVA\342\200\224\342\200\224wh/company/out/production/company/com/company/Object.class" and "b/JAVA\342\200\224\342\200\224wh/company/out/production/company/com/company/Object.class" differ
|
|
|
JAVA——wh/company/out/production/company/com/company/Rock.class
CHANGED
|
Binary files "a/JAVA\342\200\224\342\200\224wh/company/out/production/company/com/company/Rock.class" and "b/JAVA\342\200\224\342\200\224wh/company/out/production/company/com/company/Rock.class" differ
|
|
|
JAVA——wh/company/out/production/company/com/company/company.iml
CHANGED
|
@@ -1,3 +1,11 @@
|
|
| 1 |
-
version
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<module type="JAVA_MODULE" version="4">
|
| 3 |
+
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
| 4 |
+
<exclude-output />
|
| 5 |
+
<content url="file://$MODULE_DIR$">
|
| 6 |
+
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" packagePrefix="com.company" />
|
| 7 |
+
</content>
|
| 8 |
+
<orderEntry type="inheritedJdk" />
|
| 9 |
+
<orderEntry type="sourceFolder" forTests="false" />
|
| 10 |
+
</component>
|
| 11 |
+
</module>
|
JAVA——wh/company/out/production/company/com/company/imgs/bg1.jpg
CHANGED
|
Git LFS Details
|
|
JAVA——wh/company/out/production/company/com/company/imgs/gold0.gif
CHANGED
|
Git LFS Details
|
|
JAVA——wh/company/out/production/company/com/company/imgs/gold1.gif
CHANGED
|
Git LFS Details
|
|
JAVA——wh/company/out/production/company/com/company/imgs/gold2.gif
CHANGED
|
Git LFS Details
|
|
JAVA——wh/company/out/production/company/com/company/imgs/hook.png
CHANGED
|
Git LFS Details
|
|
JAVA——wh/company/out/production/company/com/company/imgs/peo.png
CHANGED
|
Git LFS Details
|
|
JAVA——wh/company/out/production/company/com/company/imgs/rock1.png
CHANGED
|
Git LFS Details
|
|
JAVA——wh/company/out/production/company/com/company/imgs/water.png
CHANGED
|
Git LFS Details
|
|
Java——eclipse/.metadata/.bak_0.log
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
Java——eclipse/.metadata/.log
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
Java——eclipse/.metadata/.mylyn/.taskListIndex/segments_1
CHANGED
|
Binary files "a/Java\342\200\224\342\200\224eclipse/.metadata/.mylyn/.taskListIndex/segments_1" and "b/Java\342\200\224\342\200\224eclipse/.metadata/.mylyn/.taskListIndex/segments_1" differ
|
|
|
Java——eclipse/.metadata/.mylyn/.tasks.xml.zip
CHANGED
|
Binary files "a/Java\342\200\224\342\200\224eclipse/.metadata/.mylyn/.tasks.xml.zip" and "b/Java\342\200\224\342\200\224eclipse/.metadata/.mylyn/.tasks.xml.zip" differ
|
|
|
Java——eclipse/.metadata/.mylyn/repositories.xml.zip
CHANGED
|
Binary files "a/Java\342\200\224\342\200\224eclipse/.metadata/.mylyn/repositories.xml.zip" and "b/Java\342\200\224\342\200\224eclipse/.metadata/.mylyn/repositories.xml.zip" differ
|
|
|
Java——eclipse/.metadata/.mylyn/tasks.xml.zip
CHANGED
|
Binary files "a/Java\342\200\224\342\200\224eclipse/.metadata/.mylyn/tasks.xml.zip" and "b/Java\342\200\224\342\200\224eclipse/.metadata/.mylyn/tasks.xml.zip" differ
|
|
|
Java——eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/b01717cc4a2d001f1346b6d1d1b63337
CHANGED
|
@@ -1,3 +1,20 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
package com.sxt;
|
| 2 |
+
|
| 3 |
+
public class Decimal {
|
| 4 |
+
public static void main(String[] args) {
|
| 5 |
+
int n = 20;
|
| 6 |
+
double sum = 1.0;
|
| 7 |
+
double term;
|
| 8 |
+
double factorial = 1;
|
| 9 |
+
|
| 10 |
+
for (int i = 1; i <= n; i++) {
|
| 11 |
+
factorial *= i;
|
| 12 |
+
term = 1.0 / factorial;
|
| 13 |
+
sum += term;
|
| 14 |
+
if (term < 0.0001) {
|
| 15 |
+
break;
|
| 16 |
+
}
|
| 17 |
+
}
|
| 18 |
+
System.out.printf("%.4f", sum, args);
|
| 19 |
+
}
|
| 20 |
+
}
|
Java——eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/d0c582df392d001f153ecf6b566d160a
CHANGED
|
@@ -1,3 +1,7 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
package com.sxt;
|
| 2 |
+
|
| 3 |
+
public class text {
|
| 4 |
+
public static void main(String args[]) {
|
| 5 |
+
println("Hello Java");
|
| 6 |
+
}
|
| 7 |
+
}
|
Java——eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/70bf25fd392d001f153ecf6b566d160a
CHANGED
|
@@ -1,3 +1,7 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
package com.sxt;
|
| 2 |
+
|
| 3 |
+
public class text {
|
| 4 |
+
public static void main(String[] args) {
|
| 5 |
+
println("Hello Java");
|
| 6 |
+
}
|
| 7 |
+
}
|