├── 8086Snake ├── Q.ASM └── Q.EXE ├── AreaTool ├── .DS_Store ├── .idea │ ├── artifacts │ │ └── AreaTool_jar.xml │ ├── compiler.xml │ ├── copyright │ │ └── profiles_settings.xml │ ├── libraries │ │ └── mysql_connector_java_5_1_38_bin.xml │ ├── misc.xml │ ├── modules.xml │ ├── sqldialects.xml │ └── workspace.xml ├── AreaTool.iml ├── database │ ├── a.sh │ ├── mysql.exe │ └── mysqldump.exe ├── export.bat ├── export.sh ├── import.bat ├── import.sh ├── lib │ └── mysql-connector-java-5.1.38-bin.jar ├── out │ ├── .DS_Store │ ├── artifacts │ │ ├── .DS_Store │ │ ├── AreaTool_jar.zip │ │ └── AreaTool_jar │ │ │ ├── .DS_Store │ │ │ ├── AreaTool.jar │ │ │ ├── lib │ │ │ ├── mysql-connector-java-5.1.38-bin.jar │ │ │ └── mysqldump.exe │ │ │ └── tool │ │ │ ├── mysql.exe │ │ │ └── mysqldump.exe │ └── production │ │ ├── .DS_Store │ │ └── AreaTool │ │ ├── Command.class │ │ ├── DBUtil.class │ │ ├── META-INF │ │ └── MANIFEST.MF │ │ ├── MainFrame$1.class │ │ ├── MainFrame.class │ │ ├── a.sh │ │ ├── mysql.exe │ │ └── mysqldump.exe └── src │ ├── Command.java │ ├── DBUtil.java │ ├── META-INF │ └── MANIFEST.MF │ └── MainFrame.java ├── README.md ├── eluosi ├── block.cpp ├── block.h ├── board.cpp ├── board.h ├── eluosi.pro ├── eluosi.pro.user ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h └── test.pro.user ├── planeGame ├── .DS_Store ├── .cocos-project.json ├── Classes │ ├── .DS_Store │ ├── AppDelegate.cpp │ ├── AppDelegate.h │ ├── HelloWorldScene.cpp │ └── HelloWorldScene.h ├── Resources │ ├── .DS_Store │ ├── Marker Felt.ttf │ ├── background.png │ └── res │ │ ├── .DS_Store │ │ ├── BigEnemy.csb │ │ ├── BigEnemyNode.csb │ │ ├── Default │ │ └── Button_Disable.png │ │ ├── HUD.csb │ │ ├── HelloWorld.png │ │ ├── Hero.csb │ │ ├── HeroNode.csb │ │ ├── Layer.csb │ │ ├── MainScene.csb │ │ ├── Scene.csb │ │ ├── Scene.json │ │ ├── SmallEnemy.csb │ │ ├── SmallEnemyNode.csb │ │ ├── Texture │ │ ├── .DS_Store │ │ ├── BigEnemy1.png │ │ ├── BigEnemy2.png │ │ ├── Exit.png │ │ ├── Exit_down.png │ │ ├── Hero1.png │ │ ├── Hero2.png │ │ ├── Restart.png │ │ ├── Restart_down.png │ │ ├── SmallEnemy1.png │ │ ├── SmallEnemy2.png │ │ ├── backDlg.png │ │ ├── lifeBar.png │ │ ├── life_words.png │ │ ├── number.png │ │ └── score_words.png │ │ ├── background.png │ │ ├── bullet1.png │ │ └── bullet2.png ├── bin │ ├── .DS_Store │ └── debug │ │ ├── .DS_Store │ │ └── mac │ │ └── .DS_Store ├── cocosstudio │ ├── .DS_Store │ ├── BigEnemyNode.csd │ ├── BigEnemyNode.udf │ ├── HUD.csd │ ├── HUD.udf │ ├── HeroNode.csd │ ├── Layer.csd │ ├── Layer.udf │ ├── Node.udf │ ├── SmallEnemyNode.csd │ ├── SmallEnemyNode.udf │ └── Texture │ │ ├── .DS_Store │ │ ├── BigEnemy1.png │ │ ├── BigEnemy2.png │ │ ├── Exit.png │ │ ├── Exit_down.png │ │ ├── Hero1.png │ │ ├── Hero2.png │ │ ├── Restart.png │ │ ├── Restart_down.png │ │ ├── SmallEnemy1.png │ │ ├── SmallEnemy2.png │ │ ├── backDlg.png │ │ ├── bullet1.png │ │ ├── bullet2.png │ │ ├── lifeBar.png │ │ ├── life_words.png │ │ ├── number.png │ │ └── score_words.png ├── config.json ├── planeGame.ccs ├── planeGame.cfg ├── planeGame.udf ├── proj.android │ ├── .DS_Store │ ├── .classpath │ ├── .cproject │ ├── .externalToolBuilders │ │ └── org.eclipse.cdt.managedbuilder.core.genmakebuilder.launch │ ├── .project │ ├── .settings │ │ ├── org.eclipse.cdt.codan.core.prefs │ │ ├── org.eclipse.cdt.core.prefs │ │ └── org.eclipse.ltk.core.refactoring.prefs │ ├── AndroidManifest.xml │ ├── ant.properties │ ├── build-cfg.json │ ├── build.xml │ ├── build_native.py │ ├── jni │ │ ├── Android.mk │ │ ├── Application.mk │ │ └── hellocpp │ │ │ └── main.cpp │ ├── libs │ │ └── android-async-http-1.4.8.jar │ ├── proguard-project.txt │ ├── project.properties │ ├── res │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ ├── drawable-ldpi │ │ │ └── icon.png │ │ ├── drawable-mdpi │ │ │ └── icon.png │ │ └── values │ │ │ └── strings.xml │ └── src 16.52.10 16.52.10 │ │ ├── com │ │ ├── chukong │ │ │ └── cocosplay │ │ │ │ └── client │ │ │ │ └── CocosPlayClient.java │ │ └── enhance │ │ │ └── gameservice │ │ │ └── IGameTuningService.aidl │ │ └── org │ │ └── cocos2dx │ │ ├── cpp │ │ └── AppActivity.java │ │ └── lib │ │ ├── Cocos2dxAccelerometer.java │ │ ├── Cocos2dxActivity.java │ │ ├── Cocos2dxBitmap.java │ │ ├── Cocos2dxDownloader.java │ │ ├── Cocos2dxEditBox.java │ │ ├── Cocos2dxEditBoxHelper.java │ │ ├── Cocos2dxGLSurfaceView.java │ │ ├── Cocos2dxHandler.java │ │ ├── Cocos2dxHelper.java │ │ ├── Cocos2dxHttpURLConnection.java │ │ ├── Cocos2dxJavascriptJavaBridge.java │ │ ├── Cocos2dxLocalStorage.java │ │ ├── Cocos2dxLuaJavaBridge.java │ │ ├── Cocos2dxMusic.java │ │ ├── Cocos2dxRenderer.java │ │ ├── Cocos2dxSound.java │ │ ├── Cocos2dxTextInputWraper.java │ │ ├── Cocos2dxTypefaces.java │ │ ├── Cocos2dxVideoHelper.java │ │ ├── Cocos2dxVideoView.java │ │ ├── Cocos2dxWebView.java │ │ ├── Cocos2dxWebViewHelper.java │ │ ├── GameControllerAdapter.java │ │ ├── GameControllerDelegate.java │ │ ├── GameControllerUtils.java │ │ └── ResizeLayout.java ├── proj.ios_mac │ ├── .DS_Store │ ├── build │ │ ├── SharedPrecompiledHeaders │ │ │ └── Prefix-dlurvezdordfczcdwkbywekkqqxk │ │ │ │ ├── Prefix.pch.d │ │ │ │ ├── Prefix.pch.data │ │ │ │ ├── Prefix.pch.dia │ │ │ │ ├── Prefix.pch.pch │ │ │ │ └── Prefix.pch.pch.hash-criteria │ │ └── planeGame.build │ │ │ └── Debug │ │ │ └── planeGame-desktop.build │ │ │ ├── Objects-normal │ │ │ └── x86_64 │ │ │ │ ├── AppDelegate.d │ │ │ │ ├── AppDelegate.dia │ │ │ │ ├── AppDelegate.o │ │ │ │ ├── HelloWorldScene.d │ │ │ │ ├── HelloWorldScene.dia │ │ │ │ ├── HelloWorldScene.o │ │ │ │ ├── main.d │ │ │ │ ├── main.dia │ │ │ │ ├── main.o │ │ │ │ ├── planeGame-desktop.LinkFileList │ │ │ │ └── planeGame-desktop_dependency_info.dat │ │ │ ├── dgph │ │ │ ├── dgph~ │ │ │ ├── planeGame-desktop-all-non-framework-target-headers.hmap │ │ │ ├── planeGame-desktop-all-target-headers.hmap │ │ │ ├── planeGame-desktop-generated-files.hmap │ │ │ ├── planeGame-desktop-own-target-headers.hmap │ │ │ ├── planeGame-desktop-project-headers.hmap │ │ │ └── planeGame-desktop.hmap │ ├── ios │ │ ├── AppController.h │ │ ├── AppController.mm │ │ ├── Default-568h@2x.png │ │ ├── Default-667h@2x.png │ │ ├── Default-736h@3x.png │ │ ├── Default-Landscape~ipad.png │ │ ├── Default.png │ │ ├── Default@2x.png │ │ ├── Icon-100.png │ │ ├── Icon-114.png │ │ ├── Icon-120.png │ │ ├── Icon-144.png │ │ ├── Icon-152.png │ │ ├── Icon-180.png │ │ ├── Icon-29.png │ │ ├── Icon-40.png │ │ ├── Icon-50.png │ │ ├── Icon-57.png │ │ ├── Icon-58.png │ │ ├── Icon-72.png │ │ ├── Icon-76.png │ │ ├── Icon-80.png │ │ ├── Icon-87.png │ │ ├── Info.plist │ │ ├── Prefix.pch │ │ ├── RootViewController.h │ │ ├── RootViewController.mm │ │ └── main.m │ ├── mac │ │ ├── Icon.icns │ │ ├── Info.plist │ │ ├── Prefix.pch │ │ └── main.cpp │ └── planeGame.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── shiyi.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ └── xcuserdata │ │ └── shiyi.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── planeGame-desktop.xcscheme │ │ ├── planeGame-mobile.xcscheme │ │ └── xcschememanagement.plist └── proj.win32 │ ├── .DS_Store │ ├── build-cfg.json │ ├── cocos2dx.props │ ├── game.rc │ ├── main.cpp │ ├── main.h │ ├── planeGame.sln │ ├── planeGame.vcxproj │ ├── planeGame.vcxproj.filters │ ├── planeGame.vcxproj.user │ ├── res │ └── game.ico │ └── resource.h ├── readme-images ├── 20160317135042608.png ├── 20160404104940464.png ├── 20160404183256409.png ├── 20160801191336969.png └── 20161208122620511.gif ├── snake ├── board.cpp ├── board.h ├── board.h.autosave ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h ├── snake.cpp ├── snake.h ├── snake.h.autosave ├── snake.pro └── snake.pro.user ├── 五子棋AI ├── .DS_Store ├── .idea │ ├── compiler.xml │ ├── copyright │ │ └── profiles_settings.xml │ ├── description.html │ ├── encodings.xml │ ├── misc.xml │ ├── modules.xml │ ├── project-template.xml │ ├── uiDesigner.xml │ └── workspace.xml ├── gobangAI.iml ├── out │ └── production │ │ └── gobangAI │ │ ├── ChessBoard.class │ │ ├── Main.class │ │ ├── MyChess.class │ │ ├── Robot.class │ │ ├── UI$1.class │ │ └── UI.class └── src │ ├── .DS_Store │ ├── ChessBoard.java │ ├── Game.java │ ├── Main.java │ ├── Robot.java │ └── UI.java └── 走方格小游戏 ├── h.php ├── i.php ├── level_one.html ├── level_one.js ├── level_two.html ├── level_two.js └── s.php /8086Snake/Q.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/8086Snake/Q.EXE -------------------------------------------------------------------------------- /AreaTool/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/AreaTool/.DS_Store -------------------------------------------------------------------------------- /AreaTool/.idea/artifacts/AreaTool_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/out/artifacts/AreaTool_jar 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /AreaTool/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /AreaTool/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /AreaTool/.idea/libraries/mysql_connector_java_5_1_38_bin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AreaTool/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /AreaTool/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AreaTool/.idea/sqldialects.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /AreaTool/AreaTool.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /AreaTool/database/a.sh: -------------------------------------------------------------------------------- 1 | /usr/local/mysql-5.7.12-osx10.11-x86_64/bin/mysqldump -uroot -pshiyi -h 127.0.0.1 d1 > /Users/shiyi/temp.sql -------------------------------------------------------------------------------- /AreaTool/database/mysql.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/AreaTool/database/mysql.exe -------------------------------------------------------------------------------- /AreaTool/database/mysqldump.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/AreaTool/database/mysqldump.exe -------------------------------------------------------------------------------- /AreaTool/export.bat: -------------------------------------------------------------------------------- 1 | /Users/shiyi/IdeaProjects/AreaTool\tool\mysqldump.exe -uroot -pjinse -P 3366 -h 115.231.222.19 --no-create-info 2 > temp.sql/Users/shiyi/IdeaProjects/AreaTool\tool\mysqldump.exe -uroot -pjinse -P 3366 -h 115.231.222.19 --no-create-info 2 > temp.sql -------------------------------------------------------------------------------- /AreaTool/export.sh: -------------------------------------------------------------------------------- 1 | /usr/local/mysql-5.7.12-osx10.11-x86_64/bin/mysqldump -uroot -pshiyi -h 127.0.0.1 --skip-extended-insert --no-create-info d2 > /Users/shiyi/temp.sql -------------------------------------------------------------------------------- /AreaTool/import.bat: -------------------------------------------------------------------------------- 1 | /Users/shiyi/IdeaProjects/AreaTool\tool\mysql.exe -f -uroot -pjinse -P 3366 -h 115.231.222.19 1 < temp.sql/Users/shiyi/IdeaProjects/AreaTool\tool\mysql.exe -f -uroot -pjinse -P 3366 -h 115.231.222.19 1 < temp.sql -------------------------------------------------------------------------------- /AreaTool/import.sh: -------------------------------------------------------------------------------- 1 | /usr/local/mysql-5.7.12-osx10.11-x86_64/bin/mysql -uroot -pshiyi -h 127.0.0.1 -f d1 < /Users/shiyi/temp.sql -------------------------------------------------------------------------------- /AreaTool/lib/mysql-connector-java-5.1.38-bin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/AreaTool/lib/mysql-connector-java-5.1.38-bin.jar -------------------------------------------------------------------------------- /AreaTool/out/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/AreaTool/out/.DS_Store -------------------------------------------------------------------------------- /AreaTool/out/artifacts/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/AreaTool/out/artifacts/.DS_Store -------------------------------------------------------------------------------- /AreaTool/out/artifacts/AreaTool_jar.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/AreaTool/out/artifacts/AreaTool_jar.zip -------------------------------------------------------------------------------- /AreaTool/out/artifacts/AreaTool_jar/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/AreaTool/out/artifacts/AreaTool_jar/.DS_Store -------------------------------------------------------------------------------- /AreaTool/out/artifacts/AreaTool_jar/AreaTool.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/AreaTool/out/artifacts/AreaTool_jar/AreaTool.jar -------------------------------------------------------------------------------- /AreaTool/out/artifacts/AreaTool_jar/lib/mysql-connector-java-5.1.38-bin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/AreaTool/out/artifacts/AreaTool_jar/lib/mysql-connector-java-5.1.38-bin.jar -------------------------------------------------------------------------------- /AreaTool/out/artifacts/AreaTool_jar/lib/mysqldump.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/AreaTool/out/artifacts/AreaTool_jar/lib/mysqldump.exe -------------------------------------------------------------------------------- /AreaTool/out/artifacts/AreaTool_jar/tool/mysql.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/AreaTool/out/artifacts/AreaTool_jar/tool/mysql.exe -------------------------------------------------------------------------------- /AreaTool/out/artifacts/AreaTool_jar/tool/mysqldump.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/AreaTool/out/artifacts/AreaTool_jar/tool/mysqldump.exe -------------------------------------------------------------------------------- /AreaTool/out/production/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/AreaTool/out/production/.DS_Store -------------------------------------------------------------------------------- /AreaTool/out/production/AreaTool/Command.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/AreaTool/out/production/AreaTool/Command.class -------------------------------------------------------------------------------- /AreaTool/out/production/AreaTool/DBUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/AreaTool/out/production/AreaTool/DBUtil.class -------------------------------------------------------------------------------- /AreaTool/out/production/AreaTool/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: lib/mysql-connector-java-5.1.38-bin.jar 3 | Main-Class: MainFrame 4 | 5 | -------------------------------------------------------------------------------- /AreaTool/out/production/AreaTool/MainFrame$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/AreaTool/out/production/AreaTool/MainFrame$1.class -------------------------------------------------------------------------------- /AreaTool/out/production/AreaTool/MainFrame.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/AreaTool/out/production/AreaTool/MainFrame.class -------------------------------------------------------------------------------- /AreaTool/out/production/AreaTool/a.sh: -------------------------------------------------------------------------------- 1 | /usr/local/mysql-5.7.12-osx10.11-x86_64/bin/mysqldump -uroot -pshiyi -h 127.0.0.1 d1 > /Users/shiyi/temp.sql -------------------------------------------------------------------------------- /AreaTool/out/production/AreaTool/mysql.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/AreaTool/out/production/AreaTool/mysql.exe -------------------------------------------------------------------------------- /AreaTool/out/production/AreaTool/mysqldump.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/AreaTool/out/production/AreaTool/mysqldump.exe -------------------------------------------------------------------------------- /AreaTool/src/Command.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by shiyi on 16/8/30. 3 | */ 4 | import java.io.BufferedReader; 5 | import java.io.InputStreamReader; 6 | 7 | public class Command { 8 | public static void exeCmd(String commandStr) { 9 | BufferedReader br = null; 10 | try { 11 | Process p = Runtime.getRuntime().exec(commandStr); 12 | br = new BufferedReader(new InputStreamReader(p.getInputStream())); 13 | String line = null; 14 | StringBuilder sb = new StringBuilder(); 15 | while ((line = br.readLine()) != null) { 16 | sb.append(line + "\n"); 17 | } 18 | System.out.println(sb.toString()); 19 | } catch (Exception e) { 20 | e.printStackTrace(); 21 | } 22 | finally 23 | { 24 | if (br != null) 25 | { 26 | try { 27 | br.close(); 28 | } catch (Exception e) { 29 | e.printStackTrace(); 30 | } 31 | } 32 | } 33 | } 34 | 35 | public static void main(String[] args) { 36 | String commandStr = "ping www.taobao.com"; 37 | //String commandStr = "ipconfig"; 38 | Command.exeCmd(commandStr); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /AreaTool/src/DBUtil.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by shiyi on 16/8/30. 3 | */ 4 | 5 | import javax.swing.*; 6 | import java.sql.Connection; 7 | import java.sql.DriverManager; 8 | import java.sql.ResultSet; 9 | import java.sql.SQLException; 10 | import java.sql.Statement; 11 | 12 | public class DBUtil { 13 | private final String dbConnFile = "classes/jdbc.properties"; 14 | private Connection conn=null; 15 | private String dbDriver; //定义驱动 16 | private String dbURL; //定义URL 17 | private String userName; //定义用户名 18 | private String password; //定义密码 19 | private JTextArea jta; 20 | 21 | public DBUtil(String ip, String user, String port, String pass, JTextArea jta) { 22 | this.dbDriver = "com.mysql.jdbc.Driver";//从配置文件中取得相应的参数并设置类变量 23 | this.dbURL = String.format("jdbc:mysql://%s:%s?useUnicode=true&characterEncoding=utf-8&useSSL=true", 24 | ip, port); 25 | this.userName = user; 26 | this.password = pass; 27 | this.jta = jta; 28 | } 29 | 30 | // public static void main(String argc[]) 31 | // { 32 | // if(new DBUtil().openConnection()) 33 | // System.out.println("yes"); 34 | // else 35 | // System.out.println("no"); 36 | // } 37 | 38 | public boolean openConnection(){ 39 | try { 40 | Class.forName(dbDriver); 41 | this.conn = DriverManager.getConnection(dbURL,userName,password); 42 | return true; 43 | } catch(ClassNotFoundException classnotfoundexception) { 44 | classnotfoundexception.printStackTrace(); 45 | jta.append("db: " + classnotfoundexception.getMessage() + "\n"); 46 | System.err.println("db: " + classnotfoundexception.getMessage()); 47 | } catch(SQLException sqlexception) { 48 | jta.append("db.getconn(): " + sqlexception.getMessage() + "\n"); 49 | jta.paintImmediately(jta.getBounds()); 50 | System.err.println("db.getconn(): " + sqlexception.getMessage()); 51 | } 52 | return false; 53 | } 54 | 55 | protected void finalize() throws Exception{ 56 | try { 57 | if(null!=conn) 58 | conn.close(); 59 | }catch (SQLException e) { 60 | e.printStackTrace(); 61 | } 62 | 63 | } 64 | 65 | // 查询并得到结果集 66 | public ResultSet execQuery(String sql) throws Exception { 67 | ResultSet rstSet = null; 68 | try { 69 | if (null == conn) 70 | throw new Exception("Database not connected!"); 71 | Statement stmt = conn.createStatement(); 72 | rstSet = stmt.executeQuery(sql); 73 | } catch (SQLException e) { 74 | e.printStackTrace(); 75 | } 76 | return rstSet; 77 | } 78 | 79 | // 插入一条新纪录,并获取标识列的值 80 | public ResultSet getInsertObjectIDs(String insertSql) throws Exception{ 81 | ResultSet rst = null; 82 | try { 83 | if(null==conn) 84 | throw new Exception("Database not connected!"); 85 | 86 | Statement stmt = conn.createStatement(); 87 | 88 | stmt.executeUpdate(insertSql, Statement.RETURN_GENERATED_KEYS); 89 | rst = stmt.getGeneratedKeys(); 90 | 91 | } catch (SQLException e) { 92 | e.printStackTrace(); 93 | } 94 | return rst; 95 | } 96 | 97 | // 插入、更新、删除 98 | public int execCommand(String sql) throws Exception{ 99 | int flag = 0; 100 | try { 101 | if(null==conn) 102 | throw new Exception("Database not connected!"); 103 | 104 | Statement stmt = conn.createStatement(); 105 | flag = stmt.executeUpdate(sql); 106 | 107 | stmt.close(); 108 | } catch (SQLException e) { 109 | e.printStackTrace(); 110 | } 111 | return flag; 112 | } 113 | 114 | // 释放资源 115 | public void close(ResultSet rst) throws Exception { 116 | try { 117 | Statement stmt = rst.getStatement(); 118 | rst.close(); 119 | stmt.close(); 120 | } catch (SQLException e) { 121 | e.printStackTrace(); 122 | } 123 | } 124 | 125 | 126 | // 释放资源 127 | public void close(Statement stmt) throws Exception { 128 | try { 129 | stmt.close(); 130 | } catch (SQLException e) { 131 | e.printStackTrace(); 132 | } 133 | } 134 | 135 | // 释放资源 136 | public void close() throws SQLException, Exception{ 137 | if(null!=conn){ 138 | conn.close(); 139 | conn=null; 140 | } 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /AreaTool/src/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: lib/mysql-connector-java-5.1.38-bin.jar 3 | Main-Class: MainFrame 4 | 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # project 2 | 3 | ## 8086汇编贪吃蛇 4 | 5 | 时间:2016-12 6 | 7 | 介绍:https://blog.csdn.net/to_be_better/article/details/53512913 8 | 9 | ![](https://github.com/shiyicode/project/blob/master/readme-images/20161208122620511.gif) 10 | 11 | ## 步步为营-墙棋AI人机对战(Android) 12 | 13 | 时间:2016-08 14 | 15 | 介绍:https://shiyi.blog.csdn.net/article/details/52088396 16 | 17 | ![](https://github.com/shiyicode/project/blob/master/readme-images/20160801191336969.png) 18 | 19 | ## C++/QT俄罗斯方块 20 | 21 | 时间:2016-04 22 | 23 | 介绍:https://shiyi.blog.csdn.net/article/details/51055813 24 | 25 | ![](https://github.com/shiyicode/project/blob/master/readme-images/20160404104940464.png) 26 | 27 | ## C++/QT贪吃蛇 28 | 29 | 时间:2016-04 30 | 31 | 介绍:https://shiyi.blog.csdn.net/article/details/51058164 32 | 33 | ![](https://github.com/shiyicode/project/blob/master/readme-images/20160404183256409.png) 34 | 35 | 36 | ## 五子棋AI图形界面人机对战(JAVA实现) 37 | 38 | 时间:2016-03 39 | 40 | 介绍:https://shiyi.blog.csdn.net/article/details/50913168 41 | 42 | ![](https://github.com/shiyicode/project/blob/master/readme-images/20160317135042608.png) 43 | -------------------------------------------------------------------------------- /eluosi/block.cpp: -------------------------------------------------------------------------------- 1 | #include "block.h" 2 | #include "board.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | Block::Block(Board *board) 12 | { 13 | this->board = board; 14 | x = -3; 15 | y = 4; 16 | 17 | //随机数确定第一个块的类型 18 | srand((unsigned) time(NULL)); 19 | type = rand()%19; 20 | nextType = rand()%19; 21 | 22 | //读入方块类型 23 | freopen("block.bin", "rb", stdin); 24 | for(int i=0; i<19; i++) 25 | { 26 | for(int j=0; j<4; j++) 27 | cin>>BLOCKS[i][j]; 28 | } 29 | 30 | //next数组模拟指向,用于方块旋转功能 31 | for(int i=0; i<3; i++) 32 | { 33 | for(int j=0; j<3; j++) 34 | NEXT[i*4+j] = i*4+j+1; 35 | NEXT[i*4+3] = i*4; 36 | } 37 | for(int i=12; i<18; i+=2) 38 | { 39 | NEXT[i] = i+1; 40 | NEXT[i+1] = i; 41 | } 42 | NEXT[18] = 18; 43 | 44 | //设置每种方块对应的颜色 45 | COLOR[1] = Qt::blue; 46 | COLOR[2] = Qt::darkBlue; 47 | COLOR[3] = Qt::yellow; 48 | COLOR[4] = Qt::magenta; 49 | COLOR[5] = Qt::darkMagenta; 50 | COLOR[6] = Qt::cyan; 51 | COLOR[7] = Qt::red; 52 | } 53 | 54 | //改变块为下一个块,并随机更新下一个块类型 55 | void Block::toNext() 56 | { 57 | x = -3; 58 | y = 4; 59 | type = nextType; 60 | nextType = rand()%19; 61 | } 62 | 63 | //旋转 64 | void Block::moveUp() 65 | { 66 | type = NEXT[type]; 67 | } 68 | 69 | //加速向下 70 | void Block::moveDown() 71 | { 72 | x++; 73 | } 74 | 75 | //左移 76 | void Block::moveLeft() 77 | { 78 | y--; 79 | } 80 | 81 | //右移 82 | void Block::moveRight() 83 | { 84 | y++; 85 | } 86 | 87 | //碰撞检测 88 | bool Block::detect(int flag) 89 | { 90 | int nextX, nextY, nextType; 91 | switch(flag) 92 | { 93 | case 0: nextX = x; nextY = y; nextType = NEXT[type]; break; 94 | case 1: nextX = x+1; nextY = y; nextType = type; break; 95 | case 2: nextX = x; nextY = y-1; nextType = type; break; 96 | case 3: nextX = x; nextY = y+1; nextType = type; break; 97 | } 98 | 99 | for(int i=0; i<4; i++) 100 | for(int j=0; j<4; j++) 101 | { 102 | int tx = nextX+i; 103 | int ty = nextY+j; 104 | if(tx < 0 || tx > board->height+1 || ty < 0 || ty > board->width+1) 105 | continue; 106 | if(BLOCKS[nextType][i][j] != '#' && (ty == 0 || ty == board->width+1)) 107 | return false; 108 | if(BLOCKS[nextType][i][j] != '#' && board->map[tx][ty] != '#') 109 | return false; 110 | } 111 | return true; 112 | } 113 | -------------------------------------------------------------------------------- /eluosi/block.h: -------------------------------------------------------------------------------- 1 | #ifndef BLOCK_H 2 | #define BLOCK_H 3 | 4 | #include "board.h" 5 | #include 6 | class Board; 7 | 8 | class Block 9 | { 10 | public: 11 | char BLOCKS[20][5][5];//各个类型的方块 12 | int NEXT[20];//模拟指向用于方块旋转 13 | Qt::GlobalColor COLOR[20];//各个类型方块的颜色 14 | int x;//块重心起始坐标 15 | int y; 16 | int type;//块id 17 | int nextType;//下一个块id 18 | Board *board; 19 | Block(Board *);//构造函数 20 | void toNext();//更改块id 21 | void moveUp();//变形 22 | void moveRight();//加速 23 | void moveLeft();//左移 24 | void moveDown();//右移 25 | bool detect(int);//碰撞检测 26 | }; 27 | 28 | #endif // BLOCK_H -------------------------------------------------------------------------------- /eluosi/board.cpp: -------------------------------------------------------------------------------- 1 | #include "board.h" 2 | #include "block.h" 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | Board::Board(int _height, int _width) 9 | : height(_height), width(_width) 10 | { 11 | //初始化块,时间间隔,分数 12 | block = new Block(this); 13 | time = 200; 14 | score = 0; 15 | 16 | //从文件读入最高分 17 | FILE *fd =fopen("score.bin","rb+"); 18 | fscanf(fd, "%d", &maxScore); 19 | 20 | //防止玩家从文件更改最高分信息的一个小处理 21 | if(maxScore % 5 != 0) 22 | maxScore = 0; 23 | 24 | //初始化地图 25 | for(int i=0; i<=height+1; i++) 26 | for(int j=0; j<=width+1; j++) 27 | map[i][j] = '#'; 28 | for(int i=0; i<=height+1; i++) 29 | map[i][0] = map[i][width+1] = '@'; 30 | for(int i=1; i<=width; i++) 31 | map[height+1][i] = '@'; 32 | } 33 | 34 | void Board::confirm() 35 | { 36 | //将块更新到map 37 | for(int i=0; i<4; i++) 38 | for(int j=0; j<4; j++) 39 | { 40 | int tx = block->x + i; 41 | int ty = block->y + j; 42 | if(tx<1 || tx > height || ty < 1 || ty > width) 43 | continue; 44 | if(block->BLOCKS[block->type][i][j] != '#') 45 | map[tx][ty] = block->BLOCKS[block->type][i][j]; 46 | } 47 | 48 | //消去完整的行并计算行个数 49 | int cnt = 0; 50 | for(int i=height; i>=1; i--) 51 | { 52 | bool flag = false; 53 | for(int j=1; j<=width; j++) 54 | if(map[i][j] == '#') 55 | { 56 | flag = true; 57 | break; 58 | } 59 | if(flag) 60 | continue; 61 | cnt++; 62 | for(int j=i; j>=1; j--) 63 | for(int k=1; k<=width; k++) 64 | map[j][k] = map[j-1][k]; 65 | } 66 | 67 | //每下落一个块加5分 68 | score += 5; 69 | //根据同时消去的行的数量指数型记分 70 | //1-10 2-20 3-40 4-80 71 | if(cnt) 72 | score += 10*(1<toNext(); 84 | } 85 | 86 | bool Board::isEnd() 87 | { 88 | for(int i=1; i<=width; i++) 89 | if(map[1][i] != '#') 90 | { 91 | //如果游戏结束,保存最大值到文件 92 | FILE *fd =fopen("score.bin","wb+"); 93 | fprintf(fd, "%d\n", maxScore); 94 | fclose(fd); 95 | return true; 96 | } 97 | return false; 98 | } 99 | -------------------------------------------------------------------------------- /eluosi/board.h: -------------------------------------------------------------------------------- 1 | #ifndef BOARD_H 2 | #define BOARD_H 3 | 4 | #include "block.h" 5 | class Block; 6 | 7 | class Board 8 | { 9 | public: 10 | int score;//当前分数 11 | int maxScore;//最高分 12 | int time;//每次下落的间隔时间 13 | int width;//地图宽 14 | int height;//地图高 15 | Block *block;//下落的方块 16 | char map[100][100];//保存地图信息 17 | 18 | Board(int, int); 19 | void confirm();//将下落到底的块更新到map 20 | bool isEnd();//判断是否游戏结束 21 | }; 22 | 23 | #endif // BOARD_H -------------------------------------------------------------------------------- /eluosi/eluosi.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2016-04-03T15:42:32 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = eluosi 12 | TEMPLATE = app 13 | 14 | 15 | SOURCES += main.cpp\ 16 | mainwindow.cpp \ 17 | board.cpp \ 18 | block.cpp 19 | 20 | HEADERS += mainwindow.h \ 21 | board.h \ 22 | block.h 23 | 24 | FORMS += 25 | 26 | DISTFILES += \ 27 | block.txt 28 | -------------------------------------------------------------------------------- /eluosi/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | #include "board.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | Board *board = new Board(20, 10); 9 | MainWindow w(board); 10 | w.show(); 11 | 12 | return a.exec(); 13 | } 14 | -------------------------------------------------------------------------------- /eluosi/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class QPaintEvent; 9 | 10 | class MainWindow : public QMainWindow 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | bool flag;//判断是否暂停状态 16 | QTimer *timer;//定时器 17 | Board *board;//游戏所用地图类 18 | 19 | MainWindow(Board *, QWidget *parent = 0); 20 | void paintEvent(QPaintEvent *event);//绘制界面 21 | void keyPressEvent(QKeyEvent *);//键盘事件处理 22 | 23 | signals: 24 | 25 | public slots: 26 | void timerEvent();//定时事件 27 | 28 | private: 29 | }; 30 | 31 | #endif // MAINWINDOW_H -------------------------------------------------------------------------------- /planeGame/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/.DS_Store -------------------------------------------------------------------------------- /planeGame/.cocos-project.json: -------------------------------------------------------------------------------- 1 | { 2 | "engine_type": "prebuilt", 3 | "engine_version": "cocos2d-x-3.10", 4 | "project_type": "cpp" 5 | } -------------------------------------------------------------------------------- /planeGame/Classes/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Classes/.DS_Store -------------------------------------------------------------------------------- /planeGame/Classes/AppDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "HelloWorldScene.h" 3 | 4 | USING_NS_CC; 5 | 6 | AppDelegate::AppDelegate() { 7 | 8 | } 9 | 10 | AppDelegate::~AppDelegate() 11 | { 12 | } 13 | 14 | //if you want a different context,just modify the value of glContextAttrs 15 | //it will takes effect on all platforms 16 | void AppDelegate::initGLContextAttrs() 17 | { 18 | //set OpenGL context attributions,now can only set six attributions: 19 | //red,green,blue,alpha,depth,stencil 20 | GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8}; 21 | 22 | GLView::setGLContextAttrs(glContextAttrs); 23 | } 24 | 25 | bool AppDelegate::applicationDidFinishLaunching() { 26 | // initialize director 27 | auto director = Director::getInstance(); 28 | auto glview = director->getOpenGLView(); 29 | if(!glview) { 30 | glview = GLViewImpl::createWithRect("planeGame", Rect(0, 0, 640/5*3, 960/5*3)); 31 | director->setOpenGLView(glview); 32 | } 33 | 34 | director->getOpenGLView()->setDesignResolutionSize(640, 960, ResolutionPolicy::FIXED_WIDTH); 35 | 36 | // turn on display FPS 37 | director->setDisplayStats(true); 38 | 39 | // set FPS. the default value is 1.0/60 if you don't call this 40 | director->setAnimationInterval(1.0 / 60); 41 | 42 | FileUtils::getInstance()->addSearchPath("res"); 43 | 44 | // create a scene. it's an autorelease object 45 | auto scene = HelloWorld::createScene(); 46 | 47 | // run 48 | director->runWithScene(scene); 49 | 50 | return true; 51 | } 52 | 53 | // This function will be called when the app is inactive. When comes a phone call,it's be invoked too 54 | void AppDelegate::applicationDidEnterBackground() { 55 | Director::getInstance()->stopAnimation(); 56 | 57 | // if you use SimpleAudioEngine, it must be pause 58 | // SimpleAudioEngine::getInstance()->pauseBackgroundMusic(); 59 | } 60 | 61 | // this function will be called when the app is active again 62 | void AppDelegate::applicationWillEnterForeground() { 63 | Director::getInstance()->startAnimation(); 64 | 65 | // if you use SimpleAudioEngine, it must resume here 66 | // SimpleAudioEngine::getInstance()->resumeBackgroundMusic(); 67 | } 68 | -------------------------------------------------------------------------------- /planeGame/Classes/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #ifndef _APP_DELEGATE_H_ 2 | #define _APP_DELEGATE_H_ 3 | 4 | #include "cocos2d.h" 5 | 6 | /** 7 | @brief The cocos2d Application. 8 | 9 | The reason for implement as private inheritance is to hide some interface call by Director. 10 | */ 11 | class AppDelegate : private cocos2d::Application 12 | { 13 | public: 14 | AppDelegate(); 15 | virtual ~AppDelegate(); 16 | 17 | virtual void initGLContextAttrs(); 18 | 19 | /** 20 | @brief Implement Director and Scene init code here. 21 | @return true Initialize success, app continue. 22 | @return false Initialize failed, app terminate. 23 | */ 24 | virtual bool applicationDidFinishLaunching(); 25 | 26 | /** 27 | @brief The function be called when the application enter background 28 | @param the pointer of the application 29 | */ 30 | virtual void applicationDidEnterBackground(); 31 | 32 | /** 33 | @brief The function be called when the application enter foreground 34 | @param the pointer of the application 35 | */ 36 | virtual void applicationWillEnterForeground(); 37 | }; 38 | 39 | #endif // _APP_DELEGATE_H_ 40 | 41 | -------------------------------------------------------------------------------- /planeGame/Classes/HelloWorldScene.h: -------------------------------------------------------------------------------- 1 | #ifndef __HELLOWORLD_SCENE_H__ 2 | #define __HELLOWORLD_SCENE_H__ 3 | 4 | #include "cocos2d.h" 5 | #include "ui/CocosGUI.h" 6 | #include "cocostudio/CocoStudio.h" 7 | 8 | enum GameState 9 | { 10 | Welcome = 0, 11 | Start, 12 | HighScore, 13 | Result 14 | }; 15 | 16 | class HelloWorld : public cocos2d::Layer 17 | { 18 | public: 19 | // there's no 'id' in cpp, so we recommend returning the class instance pointer 20 | static cocos2d::Scene* createScene(); 21 | 22 | void createHero(); 23 | void createBigEnemy(float dt); 24 | void createSmallEnemy(float dt); 25 | 26 | void heroFire(float dt); 27 | void enemyFire(float dt); 28 | 29 | // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone 30 | virtual bool init(); 31 | 32 | // implement the "static create()" method manually 33 | CREATE_FUNC(HelloWorld); 34 | 35 | void touchRestart(Ref* object, cocos2d::ui::Widget::TouchEventType type); 36 | 37 | void touchExit(Ref* object, cocos2d::ui::Widget::TouchEventType type); 38 | 39 | void startGame(); 40 | 41 | void initBackground(); 42 | 43 | void moveBackground(float dt); 44 | 45 | void gameControl(GameState state); 46 | private: 47 | cocos2d::Size visibleSize; 48 | cocos2d::Vec2 origin; 49 | cocos2d::Node* hero; 50 | cocos2d::Sprite* bg1; 51 | cocos2d::Sprite* bg2; 52 | GameState gameState; 53 | }; 54 | 55 | #endif // __HELLOWORLD_SCENE_H__ 56 | -------------------------------------------------------------------------------- /planeGame/Resources/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/.DS_Store -------------------------------------------------------------------------------- /planeGame/Resources/Marker Felt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/Marker Felt.ttf -------------------------------------------------------------------------------- /planeGame/Resources/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/background.png -------------------------------------------------------------------------------- /planeGame/Resources/res/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/.DS_Store -------------------------------------------------------------------------------- /planeGame/Resources/res/BigEnemy.csb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/BigEnemy.csb -------------------------------------------------------------------------------- /planeGame/Resources/res/BigEnemyNode.csb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/BigEnemyNode.csb -------------------------------------------------------------------------------- /planeGame/Resources/res/Default/Button_Disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/Default/Button_Disable.png -------------------------------------------------------------------------------- /planeGame/Resources/res/HUD.csb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/HUD.csb -------------------------------------------------------------------------------- /planeGame/Resources/res/HelloWorld.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/HelloWorld.png -------------------------------------------------------------------------------- /planeGame/Resources/res/Hero.csb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/Hero.csb -------------------------------------------------------------------------------- /planeGame/Resources/res/HeroNode.csb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/HeroNode.csb -------------------------------------------------------------------------------- /planeGame/Resources/res/Layer.csb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/Layer.csb -------------------------------------------------------------------------------- /planeGame/Resources/res/MainScene.csb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/MainScene.csb -------------------------------------------------------------------------------- /planeGame/Resources/res/Scene.csb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/Scene.csb -------------------------------------------------------------------------------- /planeGame/Resources/res/Scene.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "36ecd967-32cb-4c7a-ae70-9818d60f2588", 3 | "Version": "3.10.0.0", 4 | "Name": "Scene", 5 | "Content": { 6 | "Content": { 7 | "Animation": { 8 | "Duration": 10, 9 | "Speed": 1.0, 10 | "ActivedAnimationName": "animation0", 11 | "Timelines": [ 12 | { 13 | "ActionTag": 327542125, 14 | "Property": "FileData", 15 | "Frames": [ 16 | { 17 | "TextureFile": { 18 | "Type": "Normal", 19 | "Path": "Texture/Hero1.png", 20 | "Plist": "" 21 | }, 22 | "FrameIndex": 0, 23 | "Tween": false, 24 | "ctype": "TextureFrameData" 25 | }, 26 | { 27 | "TextureFile": { 28 | "Type": "Normal", 29 | "Path": "Texture/Hero2.png", 30 | "Plist": "" 31 | }, 32 | "FrameIndex": 10, 33 | "Tween": false, 34 | "ctype": "TextureFrameData" 35 | } 36 | ], 37 | "ctype": "TimelineData" 38 | }, 39 | { 40 | "ActionTag": 327542125, 41 | "Property": "BlendFunc", 42 | "Frames": [ 43 | { 44 | "Src": 1, 45 | "Dst": 771, 46 | "FrameIndex": 0, 47 | "Tween": false, 48 | "ctype": "BlendFuncFrameData" 49 | }, 50 | { 51 | "Src": 1, 52 | "Dst": 771, 53 | "FrameIndex": 10, 54 | "Tween": false, 55 | "ctype": "BlendFuncFrameData" 56 | } 57 | ], 58 | "ctype": "TimelineData" 59 | } 60 | ], 61 | "ctype": "TimelineActionData" 62 | }, 63 | "AnimationList": [ 64 | { 65 | "StartIndex": 0, 66 | "EndIndex": 20, 67 | "Name": "animation0", 68 | "ctype": "AnimationInfoData" 69 | } 70 | ], 71 | "ObjectData": { 72 | "Tag": 21, 73 | "Children": [ 74 | { 75 | "FileData": { 76 | "Type": "Normal", 77 | "Path": "Texture/Hero2.png", 78 | "Plist": "" 79 | }, 80 | "BlendFunc": { 81 | "Src": 1, 82 | "Dst": 771 83 | }, 84 | "AnchorPoint": { 85 | "ScaleX": 0.5, 86 | "ScaleY": 0.5 87 | }, 88 | "Position": { 89 | "X": 395.0, 90 | "Y": 336.0 91 | }, 92 | "Scale": { 93 | "ScaleX": 1.0, 94 | "ScaleY": 1.0 95 | }, 96 | "CColor": {}, 97 | "IconVisible": false, 98 | "PrePosition": { 99 | "X": 0.4115, 100 | "Y": 0.525 101 | }, 102 | "PreSize": { 103 | "X": 0.1417, 104 | "Y": 0.2625 105 | }, 106 | "LeftMargin": 327.0, 107 | "RightMargin": 497.0, 108 | "TopMargin": 220.0, 109 | "BottomMargin": 252.0, 110 | "Tag": 22, 111 | "ActionTag": 327542125, 112 | "Size": { 113 | "X": 136.0, 114 | "Y": 168.0 115 | }, 116 | "Name": "Hero1_1", 117 | "ctype": "SpriteObjectData" 118 | } 119 | ], 120 | "Size": { 121 | "X": 960.0, 122 | "Y": 640.0 123 | }, 124 | "Name": "Scene", 125 | "ctype": "SingleNodeObjectData" 126 | }, 127 | "UsedResources": [ 128 | "Texture/Hero1.png", 129 | "Texture/Hero2.png" 130 | ], 131 | "ctype": "GameFileData" 132 | } 133 | }, 134 | "Type": "Scene" 135 | } -------------------------------------------------------------------------------- /planeGame/Resources/res/SmallEnemy.csb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/SmallEnemy.csb -------------------------------------------------------------------------------- /planeGame/Resources/res/SmallEnemyNode.csb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/SmallEnemyNode.csb -------------------------------------------------------------------------------- /planeGame/Resources/res/Texture/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/Texture/.DS_Store -------------------------------------------------------------------------------- /planeGame/Resources/res/Texture/BigEnemy1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/Texture/BigEnemy1.png -------------------------------------------------------------------------------- /planeGame/Resources/res/Texture/BigEnemy2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/Texture/BigEnemy2.png -------------------------------------------------------------------------------- /planeGame/Resources/res/Texture/Exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/Texture/Exit.png -------------------------------------------------------------------------------- /planeGame/Resources/res/Texture/Exit_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/Texture/Exit_down.png -------------------------------------------------------------------------------- /planeGame/Resources/res/Texture/Hero1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/Texture/Hero1.png -------------------------------------------------------------------------------- /planeGame/Resources/res/Texture/Hero2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/Texture/Hero2.png -------------------------------------------------------------------------------- /planeGame/Resources/res/Texture/Restart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/Texture/Restart.png -------------------------------------------------------------------------------- /planeGame/Resources/res/Texture/Restart_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/Texture/Restart_down.png -------------------------------------------------------------------------------- /planeGame/Resources/res/Texture/SmallEnemy1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/Texture/SmallEnemy1.png -------------------------------------------------------------------------------- /planeGame/Resources/res/Texture/SmallEnemy2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/Texture/SmallEnemy2.png -------------------------------------------------------------------------------- /planeGame/Resources/res/Texture/backDlg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/Texture/backDlg.png -------------------------------------------------------------------------------- /planeGame/Resources/res/Texture/lifeBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/Texture/lifeBar.png -------------------------------------------------------------------------------- /planeGame/Resources/res/Texture/life_words.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/Texture/life_words.png -------------------------------------------------------------------------------- /planeGame/Resources/res/Texture/number.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/Texture/number.png -------------------------------------------------------------------------------- /planeGame/Resources/res/Texture/score_words.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/Texture/score_words.png -------------------------------------------------------------------------------- /planeGame/Resources/res/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/background.png -------------------------------------------------------------------------------- /planeGame/Resources/res/bullet1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/bullet1.png -------------------------------------------------------------------------------- /planeGame/Resources/res/bullet2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/Resources/res/bullet2.png -------------------------------------------------------------------------------- /planeGame/bin/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/bin/.DS_Store -------------------------------------------------------------------------------- /planeGame/bin/debug/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/bin/debug/.DS_Store -------------------------------------------------------------------------------- /planeGame/bin/debug/mac/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/bin/debug/mac/.DS_Store -------------------------------------------------------------------------------- /planeGame/cocosstudio/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/cocosstudio/.DS_Store -------------------------------------------------------------------------------- /planeGame/cocosstudio/BigEnemyNode.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /planeGame/cocosstudio/BigEnemyNode.udf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /planeGame/cocosstudio/HUD.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /planeGame/cocosstudio/HUD.udf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /planeGame/cocosstudio/HeroNode.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /planeGame/cocosstudio/Layer.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /planeGame/cocosstudio/Layer.udf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /planeGame/cocosstudio/Node.udf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /planeGame/cocosstudio/SmallEnemyNode.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /planeGame/cocosstudio/SmallEnemyNode.udf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /planeGame/cocosstudio/Texture/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/cocosstudio/Texture/.DS_Store -------------------------------------------------------------------------------- /planeGame/cocosstudio/Texture/BigEnemy1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/cocosstudio/Texture/BigEnemy1.png -------------------------------------------------------------------------------- /planeGame/cocosstudio/Texture/BigEnemy2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/cocosstudio/Texture/BigEnemy2.png -------------------------------------------------------------------------------- /planeGame/cocosstudio/Texture/Exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/cocosstudio/Texture/Exit.png -------------------------------------------------------------------------------- /planeGame/cocosstudio/Texture/Exit_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/cocosstudio/Texture/Exit_down.png -------------------------------------------------------------------------------- /planeGame/cocosstudio/Texture/Hero1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/cocosstudio/Texture/Hero1.png -------------------------------------------------------------------------------- /planeGame/cocosstudio/Texture/Hero2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/cocosstudio/Texture/Hero2.png -------------------------------------------------------------------------------- /planeGame/cocosstudio/Texture/Restart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/cocosstudio/Texture/Restart.png -------------------------------------------------------------------------------- /planeGame/cocosstudio/Texture/Restart_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/cocosstudio/Texture/Restart_down.png -------------------------------------------------------------------------------- /planeGame/cocosstudio/Texture/SmallEnemy1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/cocosstudio/Texture/SmallEnemy1.png -------------------------------------------------------------------------------- /planeGame/cocosstudio/Texture/SmallEnemy2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/cocosstudio/Texture/SmallEnemy2.png -------------------------------------------------------------------------------- /planeGame/cocosstudio/Texture/backDlg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/cocosstudio/Texture/backDlg.png -------------------------------------------------------------------------------- /planeGame/cocosstudio/Texture/bullet1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/cocosstudio/Texture/bullet1.png -------------------------------------------------------------------------------- /planeGame/cocosstudio/Texture/bullet2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/cocosstudio/Texture/bullet2.png -------------------------------------------------------------------------------- /planeGame/cocosstudio/Texture/lifeBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/cocosstudio/Texture/lifeBar.png -------------------------------------------------------------------------------- /planeGame/cocosstudio/Texture/life_words.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/cocosstudio/Texture/life_words.png -------------------------------------------------------------------------------- /planeGame/cocosstudio/Texture/number.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/cocosstudio/Texture/number.png -------------------------------------------------------------------------------- /planeGame/cocosstudio/Texture/score_words.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/cocosstudio/Texture/score_words.png -------------------------------------------------------------------------------- /planeGame/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "init_cfg": { 3 | "isLandscape": true, 4 | "width": 960, 5 | "height": 640 6 | } 7 | } -------------------------------------------------------------------------------- /planeGame/planeGame.ccs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /planeGame/planeGame.cfg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /planeGame/planeGame.udf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /planeGame/proj.android/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.android/.DS_Store -------------------------------------------------------------------------------- /planeGame/proj.android/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /planeGame/proj.android/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /planeGame/proj.android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | planeGame 4 | 5 | 6 | libcocos2dx 7 | 8 | 9 | 10 | com.android.ide.eclipse.adt.ResourceManagerBuilder 11 | 12 | 13 | 14 | 15 | com.android.ide.eclipse.adt.PreCompilerBuilder 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javabuilder 21 | 22 | 23 | 24 | 25 | org.eclipse.ui.externaltools.ExternalToolBuilder 26 | full,incremental, 27 | 28 | 29 | LaunchConfigHandle 30 | <project>/.externalToolBuilders/org.eclipse.cdt.managedbuilder.core.genmakebuilder.launch 31 | 32 | 33 | 34 | 35 | com.android.ide.eclipse.adt.ApkBuilder 36 | 37 | 38 | 39 | 40 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 41 | full,incremental, 42 | 43 | 44 | 45 | 46 | 47 | com.android.ide.eclipse.adt.AndroidNature 48 | org.eclipse.jdt.core.javanature 49 | org.eclipse.cdt.core.cnature 50 | org.eclipse.cdt.core.ccnature 51 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 52 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 53 | 54 | 55 | 56 | Classes 57 | 2 58 | $%7BPARENT-1-PROJECT_LOC%7D/Classes 59 | 60 | 61 | cocos2d 62 | 2 63 | $%7BPARENT-1-PROJECT_LOC%7D/cocos2d 64 | 65 | 66 | libcocos2d 67 | 2 68 | PARENT-1-PROJECT_LOC/cocos2d/cocos/platform/android/java/src 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /planeGame/proj.android/.settings/org.eclipse.cdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | environment/project/0.1230402123/append=true 3 | environment/project/0.1230402123/appendContributed=true 4 | -------------------------------------------------------------------------------- /planeGame/proj.android/.settings/org.eclipse.ltk.core.refactoring.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false 3 | -------------------------------------------------------------------------------- /planeGame/proj.android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 17 | 18 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /planeGame/proj.android/ant.properties: -------------------------------------------------------------------------------- 1 | # This file is used to override default values used by the Ant build system. 2 | # 3 | # This file must be checked into Version Control Systems, as it is 4 | # integral to the build system of your project. 5 | 6 | # This file is only used by the Ant script. 7 | 8 | # You can use this to override default values such as 9 | # 'source.dir' for the location of your java source folder and 10 | # 'out.dir' for the location of your output folder. 11 | 12 | # You can also use it define how the release builds are signed by declaring 13 | # the following properties: 14 | # 'key.store' for the location of your keystore and 15 | # 'key.alias' for the name of the key to use. 16 | # The password will be asked during the build when you use the 'release' target. 17 | 18 | -------------------------------------------------------------------------------- /planeGame/proj.android/build-cfg.json: -------------------------------------------------------------------------------- 1 | { 2 | "ndk_module_path" :[ 3 | "${COCOS_X_ROOT}/cocos2d-x-3.10", 4 | "${COCOS_X_ROOT}/cocos2d-x-3.10/cocos", 5 | "${COCOS_X_ROOT}/cocos2d-x-3.10/external" 6 | ], 7 | "copy_resources": [ 8 | { 9 | "from": "../Resources", 10 | "to": "" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /planeGame/proj.android/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 29 | 30 | 31 | 40 | 41 | 42 | 43 | 47 | 48 | 60 | 61 | 62 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /planeGame/proj.android/build_native.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # build_native.py 3 | # Build native codes 4 | # 5 | # Please use cocos console instead 6 | 7 | 8 | import sys 9 | import os, os.path 10 | import shutil 11 | from optparse import OptionParser 12 | 13 | def build(build_mode): 14 | 15 | 16 | current_dir = os.path.dirname(os.path.realpath(__file__)) 17 | cocos_root = os.path.join(current_dir, "../cocos2d") 18 | 19 | app_android_root = os.path.join(current_dir, "../") 20 | 21 | if build_mode is None: 22 | build_mode = 'debug' 23 | elif build_mode != 'release': 24 | build_mode = 'debug' 25 | 26 | command = 'cocos compile -p android -s %s -m %s' % (app_android_root, build_mode) 27 | if os.system(command) != 0: 28 | raise Exception("Build dynamic library for project [ " + app_android_root + " ] fails!") 29 | 30 | # -------------- main -------------- 31 | if __name__ == '__main__': 32 | 33 | parser = OptionParser() 34 | parser.add_option("-n", "--ndk", dest="ndk_build_param", help='it is not used', action="append") 35 | parser.add_option("-p", "--platform", dest="android_platform", 36 | help='it is not used') 37 | parser.add_option("-b", "--build", dest="build_mode", 38 | help='the build mode for java project,debug[default] or release.Get more information,please refer to http://developer.android.com/tools/building/building-cmdline.html') 39 | (opts, args) = parser.parse_args() 40 | 41 | print "Please use cocos console instead.\n" 42 | 43 | build(opts.build_mode) 44 | -------------------------------------------------------------------------------- /planeGame/proj.android/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | 6 | 7 | 8 | 9 | LOCAL_MODULE := cocos2dcpp_shared 10 | 11 | LOCAL_MODULE_FILENAME := libcocos2dcpp 12 | 13 | LOCAL_SRC_FILES := hellocpp/main.cpp \ 14 | ../../Classes/AppDelegate.cpp \ 15 | ../../Classes/HelloWorldScene.cpp 16 | 17 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes 18 | 19 | # _COCOS_HEADER_ANDROID_BEGIN 20 | # _COCOS_HEADER_ANDROID_END 21 | 22 | 23 | LOCAL_STATIC_LIBRARIES := cocos2dx_static 24 | 25 | # _COCOS_LIB_ANDROID_BEGIN 26 | # _COCOS_LIB_ANDROID_END 27 | 28 | include $(BUILD_SHARED_LIBRARY) 29 | 30 | $(call import-module,./prebuilt-mk) 31 | 32 | # _COCOS_LIB_IMPORT_ANDROID_BEGIN 33 | # _COCOS_LIB_IMPORT_ANDROID_END 34 | -------------------------------------------------------------------------------- /planeGame/proj.android/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_STL := gnustl_static 2 | 3 | APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char 4 | APP_LDFLAGS := -latomic 5 | 6 | 7 | ifeq ($(NDK_DEBUG),1) 8 | APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 9 | APP_OPTIM := debug 10 | else 11 | APP_CPPFLAGS += -DNDEBUG 12 | APP_OPTIM := release 13 | endif 14 | -------------------------------------------------------------------------------- /planeGame/proj.android/jni/hellocpp/main.cpp: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "cocos2d.h" 3 | #include "platform/android/jni/JniHelper.h" 4 | #include 5 | #include 6 | 7 | #define LOG_TAG "main" 8 | #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) 9 | 10 | using namespace cocos2d; 11 | 12 | void cocos_android_app_init (JNIEnv* env) { 13 | LOGD("cocos_android_app_init"); 14 | AppDelegate *pAppDelegate = new AppDelegate(); 15 | } 16 | -------------------------------------------------------------------------------- /planeGame/proj.android/libs/android-async-http-1.4.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.android/libs/android-async-http-1.4.8.jar -------------------------------------------------------------------------------- /planeGame/proj.android/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /planeGame/proj.android/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system use, 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | 10 | # Project target. 11 | target=android-15 12 | 13 | -------------------------------------------------------------------------------- /planeGame/proj.android/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.android/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /planeGame/proj.android/res/drawable-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.android/res/drawable-ldpi/icon.png -------------------------------------------------------------------------------- /planeGame/proj.android/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.android/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /planeGame/proj.android/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | planeGame 4 | 5 | -------------------------------------------------------------------------------- /planeGame/proj.android/src 16.52.10 16.52.10/com/chukong/cocosplay/client/CocosPlayClient.java: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2015 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | package com.chukong.cocosplay.client; 25 | 26 | import android.app.Activity; 27 | 28 | public class CocosPlayClient { 29 | 30 | public static boolean init(Activity activity, boolean isDemo) { 31 | return false; 32 | } 33 | 34 | public static boolean isEnabled() { 35 | return false; 36 | } 37 | 38 | public static boolean isDemo() { 39 | return false; 40 | } 41 | 42 | public static boolean isNotifyFileLoadedEnabled() { 43 | return false; 44 | } 45 | 46 | public static void notifyFileLoaded(String filePath) { 47 | 48 | } 49 | 50 | public static void updateAssets(String filePath) { 51 | 52 | } 53 | 54 | public static String getGameRoot() { 55 | return ""; 56 | } 57 | 58 | public static native String[] getSearchPaths(); 59 | } 60 | -------------------------------------------------------------------------------- /planeGame/proj.android/src 16.52.10 16.52.10/com/enhance/gameservice/IGameTuningService.aidl: -------------------------------------------------------------------------------- 1 | package com.enhance.gameservice; 2 | 3 | interface IGameTuningService 4 | { 5 | int setPreferredResolution(int resolution); 6 | int setFramePerSecond(int fps); 7 | int boostUp(int seconds); 8 | int getAbstractTemperature(); 9 | int setGamePowerSaving(boolean enable); 10 | } -------------------------------------------------------------------------------- /planeGame/proj.android/src 16.52.10 16.52.10/org/cocos2dx/cpp/AppActivity.java: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2008-2010 Ricardo Quesada 3 | Copyright (c) 2010-2012 cocos2d-x.org 4 | Copyright (c) 2011 Zynga Inc. 5 | Copyright (c) 2013-2014 Chukong Technologies Inc. 6 | 7 | http://www.cocos2d-x.org 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in 17 | all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | THE SOFTWARE. 26 | ****************************************************************************/ 27 | package org.cocos2dx.cpp; 28 | 29 | import org.cocos2dx.lib.Cocos2dxActivity; 30 | 31 | public class AppActivity extends Cocos2dxActivity { 32 | } 33 | -------------------------------------------------------------------------------- /planeGame/proj.android/src 16.52.10 16.52.10/org/cocos2dx/lib/Cocos2dxHandler.java: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010-2011 cocos2d-x.org 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | 25 | package org.cocos2dx.lib; 26 | 27 | import android.app.AlertDialog; 28 | import android.content.DialogInterface; 29 | import android.os.Handler; 30 | import android.os.Message; 31 | 32 | import java.lang.ref.WeakReference; 33 | 34 | public class Cocos2dxHandler extends Handler { 35 | // =========================================================== 36 | // Constants 37 | // =========================================================== 38 | public final static int HANDLER_SHOW_DIALOG = 1; 39 | 40 | // =========================================================== 41 | // Fields 42 | // =========================================================== 43 | private WeakReference mActivity; 44 | 45 | // =========================================================== 46 | // Constructors 47 | // =========================================================== 48 | public Cocos2dxHandler(Cocos2dxActivity activity) { 49 | this.mActivity = new WeakReference(activity); 50 | } 51 | 52 | // =========================================================== 53 | // Getter & Setter 54 | // =========================================================== 55 | 56 | // =========================================================== 57 | // Methods for/from SuperClass/Interfaces 58 | // =========================================================== 59 | 60 | // =========================================================== 61 | // Methods 62 | // =========================================================== 63 | 64 | public void handleMessage(Message msg) { 65 | switch (msg.what) { 66 | case Cocos2dxHandler.HANDLER_SHOW_DIALOG: 67 | showDialog(msg); 68 | break; 69 | } 70 | } 71 | 72 | private void showDialog(Message msg) { 73 | Cocos2dxActivity theActivity = this.mActivity.get(); 74 | DialogMessage dialogMessage = (DialogMessage)msg.obj; 75 | new AlertDialog.Builder(theActivity) 76 | .setTitle(dialogMessage.titile) 77 | .setMessage(dialogMessage.message) 78 | .setPositiveButton("Ok", 79 | new DialogInterface.OnClickListener() { 80 | 81 | @Override 82 | public void onClick(DialogInterface dialog, int which) { 83 | // TODO Auto-generated method stub 84 | 85 | } 86 | }).create().show(); 87 | } 88 | 89 | 90 | // =========================================================== 91 | // Inner and Anonymous Classes 92 | // =========================================================== 93 | 94 | public static class DialogMessage { 95 | public String titile; 96 | public String message; 97 | 98 | public DialogMessage(String title, String message) { 99 | this.titile = title; 100 | this.message = message; 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /planeGame/proj.android/src 16.52.10 16.52.10/org/cocos2dx/lib/Cocos2dxJavascriptJavaBridge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2014 Chukong Technologies Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | package org.cocos2dx.lib; 24 | 25 | public class Cocos2dxJavascriptJavaBridge { 26 | public static native int evalString(String value); 27 | } 28 | -------------------------------------------------------------------------------- /planeGame/proj.android/src 16.52.10 16.52.10/org/cocos2dx/lib/Cocos2dxLocalStorage.java: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2013-2014 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | package org.cocos2dx.lib; 25 | 26 | import android.content.Context; 27 | import android.database.Cursor; 28 | import android.database.sqlite.SQLiteDatabase; 29 | import android.database.sqlite.SQLiteOpenHelper; 30 | import android.util.Log; 31 | 32 | 33 | public class Cocos2dxLocalStorage { 34 | 35 | private static final String TAG = "Cocos2dxLocalStorage"; 36 | 37 | private static String DATABASE_NAME = "jsb.sqlite"; 38 | private static String TABLE_NAME = "data"; 39 | private static final int DATABASE_VERSION = 1; 40 | 41 | private static DBOpenHelper mDatabaseOpenHelper = null; 42 | private static SQLiteDatabase mDatabase = null; 43 | /** 44 | * Constructor 45 | * @param context The Context within which to work, used to create the DB 46 | * @return 47 | */ 48 | public static boolean init(String dbName, String tableName) { 49 | if (Cocos2dxActivity.getContext() != null) { 50 | DATABASE_NAME = dbName; 51 | TABLE_NAME = tableName; 52 | mDatabaseOpenHelper = new DBOpenHelper(Cocos2dxActivity.getContext()); 53 | mDatabase = mDatabaseOpenHelper.getWritableDatabase(); 54 | return true; 55 | } 56 | return false; 57 | } 58 | 59 | public static void destory() { 60 | if (mDatabase != null) { 61 | mDatabase.close(); 62 | } 63 | } 64 | 65 | public static void setItem(String key, String value) { 66 | try { 67 | String sql = "replace into "+TABLE_NAME+"(key,value)values(?,?)"; 68 | mDatabase.execSQL(sql, new Object[] { key, value }); 69 | } catch (Exception e) { 70 | e.printStackTrace(); 71 | } 72 | } 73 | 74 | public static String getItem(String key) { 75 | String ret = null; 76 | try { 77 | String sql = "select value from "+TABLE_NAME+" where key=?"; 78 | Cursor c = mDatabase.rawQuery(sql, new String[]{key}); 79 | while (c.moveToNext()) { 80 | // only return the first value 81 | if (ret != null) 82 | { 83 | Log.e(TAG, "The key contains more than one value."); 84 | break; 85 | } 86 | ret = c.getString(c.getColumnIndex("value")); 87 | } 88 | c.close(); 89 | } catch (Exception e) { 90 | e.printStackTrace(); 91 | } 92 | return ret == null ? "" : ret; 93 | } 94 | 95 | public static void removeItem(String key) { 96 | try { 97 | String sql = "delete from "+TABLE_NAME+" where key=?"; 98 | mDatabase.execSQL(sql, new Object[] {key}); 99 | } catch (Exception e) { 100 | e.printStackTrace(); 101 | } 102 | } 103 | 104 | public static void clear() { 105 | try { 106 | String sql = "delete from "+TABLE_NAME; 107 | mDatabase.execSQL(sql); 108 | } catch (Exception e) { 109 | e.printStackTrace(); 110 | } 111 | } 112 | 113 | 114 | /** 115 | * This creates/opens the database. 116 | */ 117 | private static class DBOpenHelper extends SQLiteOpenHelper { 118 | 119 | DBOpenHelper(Context context) { 120 | super(context, DATABASE_NAME, null, DATABASE_VERSION); 121 | } 122 | 123 | @Override 124 | public void onCreate(SQLiteDatabase db) { 125 | db.execSQL("CREATE TABLE IF NOT EXISTS "+TABLE_NAME+"(key TEXT PRIMARY KEY,value TEXT);"); 126 | } 127 | 128 | @Override 129 | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { 130 | Log.w(TAG, "Upgrading database from version " + oldVersion + " to " 131 | + newVersion + ", which will destroy all old data"); 132 | //db.execSQL("DROP TABLE IF EXISTS " + VIRTUAL_TABLE); 133 | //onCreate(db); 134 | } 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /planeGame/proj.android/src 16.52.10 16.52.10/org/cocos2dx/lib/Cocos2dxLuaJavaBridge.java: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2013-2014 Chukong Technologies Inc. 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | 25 | package org.cocos2dx.lib; 26 | 27 | public class Cocos2dxLuaJavaBridge 28 | { 29 | public static native int callLuaFunctionWithString(int luaFunctionId, String value); 30 | public static native int callLuaGlobalFunctionWithString(String luaFunctionName, String value); 31 | public static native int retainLuaFunction(int luaFunctionId); 32 | public static native int releaseLuaFunction(int luaFunctionId); 33 | } 34 | -------------------------------------------------------------------------------- /planeGame/proj.android/src 16.52.10 16.52.10/org/cocos2dx/lib/Cocos2dxTypefaces.java: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010-2012 cocos2d-x.org 3 | Copyright (c) 2013-2014 Chukong Technologies Inc. 4 | 5 | http://www.cocos2d-x.org 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | ****************************************************************************/ 25 | package org.cocos2dx.lib; 26 | 27 | import android.content.Context; 28 | import android.graphics.Typeface; 29 | 30 | import java.util.HashMap; 31 | 32 | public class Cocos2dxTypefaces { 33 | // =========================================================== 34 | // Constants 35 | // =========================================================== 36 | 37 | // =========================================================== 38 | // Fields 39 | // =========================================================== 40 | 41 | private static final HashMap sTypefaceCache = new HashMap(); 42 | 43 | // =========================================================== 44 | // Constructors 45 | // =========================================================== 46 | 47 | // =========================================================== 48 | // Getter & Setter 49 | // =========================================================== 50 | 51 | // =========================================================== 52 | // Methods for/from SuperClass/Interfaces 53 | // =========================================================== 54 | 55 | // =========================================================== 56 | // Methods 57 | // =========================================================== 58 | 59 | public static synchronized Typeface get(final Context context, final String assetName) { 60 | if (!Cocos2dxTypefaces.sTypefaceCache.containsKey(assetName)) { 61 | Typeface typeface = null; 62 | if (assetName.startsWith("/")) 63 | { 64 | typeface = Typeface.createFromFile(assetName); 65 | } 66 | else 67 | { 68 | typeface = Typeface.createFromAsset(context.getAssets(), assetName); 69 | } 70 | Cocos2dxTypefaces.sTypefaceCache.put(assetName, typeface); 71 | } 72 | 73 | return Cocos2dxTypefaces.sTypefaceCache.get(assetName); 74 | } 75 | 76 | // =========================================================== 77 | // Inner and Anonymous Classes 78 | // =========================================================== 79 | 80 | } 81 | -------------------------------------------------------------------------------- /planeGame/proj.android/src 16.52.10 16.52.10/org/cocos2dx/lib/GameControllerAdapter.java: -------------------------------------------------------------------------------- 1 | package org.cocos2dx.lib; 2 | 3 | import java.util.ArrayList; 4 | 5 | public class GameControllerAdapter { 6 | private static ArrayList sRunnableFrameStartList = null; 7 | 8 | public static void addRunnableToFrameStartList(Runnable runnable) { 9 | if (sRunnableFrameStartList == null) 10 | sRunnableFrameStartList = new ArrayList(); 11 | sRunnableFrameStartList.add(runnable); 12 | } 13 | 14 | public static void removeRunnableFromFrameStartList(Runnable runnable) { 15 | if (sRunnableFrameStartList != null) 16 | sRunnableFrameStartList.remove(runnable); 17 | } 18 | 19 | public static void onDrawFrameStart() { 20 | if (sRunnableFrameStartList != null) 21 | { 22 | int size = sRunnableFrameStartList.size(); 23 | for (int i = 0; i < size; ++i) { 24 | sRunnableFrameStartList.get(i).run(); 25 | } 26 | } 27 | } 28 | 29 | public static void onConnected(final String vendorName, final int controller) 30 | { 31 | Cocos2dxHelper.runOnGLThread(new Runnable() { 32 | 33 | @Override 34 | public void run() { 35 | nativeControllerConnected(vendorName, controller); 36 | } 37 | }); 38 | } 39 | 40 | public static void onDisconnected(final String vendorName, final int controller) 41 | { 42 | Cocos2dxHelper.runOnGLThread(new Runnable() { 43 | 44 | @Override 45 | public void run() { 46 | nativeControllerDisconnected(vendorName, controller); 47 | } 48 | }); 49 | } 50 | 51 | public static void onButtonEvent(final String vendorName, final int controller, final int button, final boolean isPressed, final float value, final boolean isAnalog) 52 | { 53 | Cocos2dxHelper.runOnGLThread(new Runnable() { 54 | 55 | @Override 56 | public void run() { 57 | nativeControllerButtonEvent(vendorName, controller, button, isPressed, value, isAnalog); 58 | } 59 | }); 60 | } 61 | 62 | public static void onAxisEvent(final String vendorName, final int controller, final int axisID, final float value, final boolean isAnalog) 63 | { 64 | Cocos2dxHelper.runOnGLThread(new Runnable() { 65 | 66 | @Override 67 | public void run() { 68 | nativeControllerAxisEvent(vendorName, controller, axisID, value, isAnalog); 69 | } 70 | }); 71 | } 72 | 73 | private static native void nativeControllerConnected(final String vendorName, final int controller); 74 | private static native void nativeControllerDisconnected(final String vendorName, final int controller); 75 | private static native void nativeControllerButtonEvent(final String vendorName, final int controller, final int button, final boolean isPressed, final float value, final boolean isAnalog); 76 | private static native void nativeControllerAxisEvent(final String vendorName, final int controller, final int axisID, final float value, final boolean isAnalog); 77 | } 78 | -------------------------------------------------------------------------------- /planeGame/proj.android/src 16.52.10 16.52.10/org/cocos2dx/lib/GameControllerDelegate.java: -------------------------------------------------------------------------------- 1 | package org.cocos2dx.lib; 2 | 3 | import android.content.Context; 4 | import android.view.KeyEvent; 5 | import android.view.MotionEvent; 6 | 7 | public interface GameControllerDelegate { 8 | 9 | static final int KEY_BASE = 1000; 10 | 11 | public static final int THUMBSTICK_LEFT_X = KEY_BASE; 12 | public static final int THUMBSTICK_LEFT_Y = KEY_BASE + 1; 13 | public static final int THUMBSTICK_RIGHT_X = KEY_BASE + 2; 14 | public static final int THUMBSTICK_RIGHT_Y = KEY_BASE + 3; 15 | 16 | public static final int BUTTON_A = KEY_BASE + 4; 17 | public static final int BUTTON_B = KEY_BASE + 5; 18 | public static final int BUTTON_C = KEY_BASE + 6; 19 | public static final int BUTTON_X = KEY_BASE + 7; 20 | public static final int BUTTON_Y = KEY_BASE + 8; 21 | public static final int BUTTON_Z = KEY_BASE + 9; 22 | 23 | public static final int BUTTON_DPAD_UP = KEY_BASE + 10; 24 | public static final int BUTTON_DPAD_DOWN = KEY_BASE + 11; 25 | public static final int BUTTON_DPAD_LEFT = KEY_BASE + 12; 26 | public static final int BUTTON_DPAD_RIGHT = KEY_BASE + 13; 27 | public static final int BUTTON_DPAD_CENTER = KEY_BASE + 14; 28 | 29 | public static final int BUTTON_LEFT_SHOULDER = KEY_BASE + 15; 30 | public static final int BUTTON_RIGHT_SHOULDER = KEY_BASE + 16; 31 | public static final int BUTTON_LEFT_TRIGGER = KEY_BASE + 17; 32 | public static final int BUTTON_RIGHT_TRIGGER = KEY_BASE + 18; 33 | 34 | public static final int BUTTON_LEFT_THUMBSTICK = KEY_BASE + 19; 35 | public static final int BUTTON_RIGHT_THUMBSTICK = KEY_BASE + 20; 36 | 37 | public static final int BUTTON_START = KEY_BASE + 21; 38 | public static final int BUTTON_SELECT = KEY_BASE + 22; 39 | 40 | void onCreate(Context context); 41 | void onPause(); 42 | void onResume(); 43 | void onDestroy(); 44 | 45 | boolean dispatchKeyEvent(KeyEvent event); 46 | boolean dispatchGenericMotionEvent(MotionEvent event); 47 | 48 | void setControllerEventListener(ControllerEventListener listener); 49 | 50 | public interface ControllerEventListener { 51 | void onButtonEvent(String vendorName, int controller, int button, boolean isPressed, float value, boolean isAnalog); 52 | void onAxisEvent(String vendorName, int controller, int axisID, float value, boolean isAnalog); 53 | 54 | void onConnected(String vendorName, int controller); 55 | void onDisconnected(String vendorName, int controller); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /planeGame/proj.android/src 16.52.10 16.52.10/org/cocos2dx/lib/GameControllerUtils.java: -------------------------------------------------------------------------------- 1 | package org.cocos2dx.lib; 2 | 3 | import java.io.File; 4 | import java.io.FileInputStream; 5 | 6 | public class GameControllerUtils { 7 | 8 | public static void ensureDirectoryExist(String path){ 9 | 10 | File sdkDir = new File(path); 11 | if(!sdkDir.exists()){ 12 | sdkDir.mkdirs(); 13 | } 14 | } 15 | 16 | public static String readJsonFile(String filePath) { 17 | 18 | File file = new File(filePath); 19 | 20 | if (!file.exists()){ 21 | return null; 22 | } 23 | 24 | try { 25 | 26 | FileInputStream is = new FileInputStream(file);; 27 | 28 | int size = is.available(); 29 | byte[] buffer = new byte[size]; 30 | 31 | is.read(buffer); 32 | is.close(); 33 | 34 | String jsonstr = new String(buffer, "UTF-8"); 35 | 36 | return jsonstr; 37 | } catch (Exception e) { 38 | e.printStackTrace(); 39 | } 40 | 41 | return null; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /planeGame/proj.android/src 16.52.10 16.52.10/org/cocos2dx/lib/ResizeLayout.java: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010-2013 cocos2d-x.org 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | package org.cocos2dx.lib; 25 | 26 | import android.content.Context; 27 | import android.os.Handler; 28 | import android.util.AttributeSet; 29 | import android.widget.FrameLayout; 30 | 31 | public class ResizeLayout extends FrameLayout { 32 | private boolean mEnableForceDoLayout = false; 33 | 34 | public ResizeLayout(Context context){ 35 | super(context); 36 | } 37 | 38 | public ResizeLayout(Context context, AttributeSet attrs) { 39 | super(context, attrs); 40 | } 41 | 42 | public void setEnableForceDoLayout(boolean flag){ 43 | mEnableForceDoLayout = flag; 44 | } 45 | 46 | @Override 47 | protected void onLayout(boolean changed, int l, int t, int r, int b) { 48 | super.onLayout(changed, l, t, r, b); 49 | if(mEnableForceDoLayout){ 50 | /*This is a hot-fix for some android devices which don't do layout when the main window 51 | * is paned. We refersh the layout in 24 frames per seconds. 52 | * When the editBox is lose focus or when user begin to type, the do layout is disabled. 53 | */ 54 | final Handler handler = new Handler(); 55 | handler.postDelayed(new Runnable() { 56 | @Override 57 | public void run() { 58 | //Do something after 100ms 59 | requestLayout(); 60 | invalidate(); 61 | } 62 | }, 1000 / 24); 63 | 64 | } 65 | 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/.DS_Store -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/build/SharedPrecompiledHeaders/Prefix-dlurvezdordfczcdwkbywekkqqxk/Prefix.pch.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/build/SharedPrecompiledHeaders/Prefix-dlurvezdordfczcdwkbywekkqqxk/Prefix.pch.dia -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/build/SharedPrecompiledHeaders/Prefix-dlurvezdordfczcdwkbywekkqqxk/Prefix.pch.pch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/build/SharedPrecompiledHeaders/Prefix-dlurvezdordfczcdwkbywekkqqxk/Prefix.pch.pch -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/build/SharedPrecompiledHeaders/Prefix-dlurvezdordfczcdwkbywekkqqxk/Prefix.pch.pch.hash-criteria: -------------------------------------------------------------------------------- 1 | -x 2 | c++ 3 | -arch 4 | x86_64 5 | -std=c++11 6 | -stdlib=libc++ 7 | -gmodules 8 | -fpascal-strings 9 | -O0 10 | -fno-common 11 | -DUSE_FILE32API 12 | -DCC_TARGET_OS_MAC 13 | -DCOCOS2D_DEBUG=1 14 | -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 15 | -isysroot 16 | /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk 17 | -fasm-blocks 18 | -mmacosx-version-min=10.7 19 | -g 20 | -I/Users/shiyi/Documents/CocosProjects/planeGame/bin/debug/mac/include 21 | -I/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10 22 | -I/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/cocos 23 | -I/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/cocos/base 24 | -I/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/cocos/physics 25 | -I/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/cocos/math 26 | -I/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/cocos/2d 27 | -I/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/cocos/ui 28 | -I/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/cocos/network 29 | -I/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/cocos/audio/include 30 | -I/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/cocos/editor-support 31 | -I/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/extensions 32 | -I/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/external 33 | -I/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/external/chipmunk/include/chipmunk 34 | -I/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/cocos/platform/mac 35 | -I/Applications/Cocos/Cocos2d-x/cocos2d-x-3.10/external/glfw3/include/mac 36 | -F/Users/shiyi/Documents/CocosProjects/planeGame/bin/debug/mac 37 | x86_64-apple-darwin15.5.0 38 | "4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)" 39 | SDK_PRODUCT_BUILD_VERSION=16A300 40 | 16A300 41 | -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/Objects-normal/x86_64/AppDelegate.d: -------------------------------------------------------------------------------- 1 | dependencies: \ 2 | /Users/shiyi/Documents/CocosProjects/planeGame/Classes/AppDelegate.cpp \ 3 | /Users/shiyi/Documents/CocosProjects/planeGame/Classes/AppDelegate.h \ 4 | /Users/shiyi/Documents/CocosProjects/planeGame/Classes/HelloWorldScene.h 5 | -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/Objects-normal/x86_64/AppDelegate.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/Objects-normal/x86_64/AppDelegate.dia -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/Objects-normal/x86_64/AppDelegate.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/Objects-normal/x86_64/AppDelegate.o -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/Objects-normal/x86_64/HelloWorldScene.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/Objects-normal/x86_64/HelloWorldScene.dia -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/Objects-normal/x86_64/HelloWorldScene.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/Objects-normal/x86_64/HelloWorldScene.o -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/Objects-normal/x86_64/main.d: -------------------------------------------------------------------------------- 1 | dependencies: \ 2 | /Users/shiyi/Documents/CocosProjects/planeGame/proj.ios_mac/mac/main.cpp \ 3 | /Users/shiyi/Documents/CocosProjects/planeGame/Classes/AppDelegate.h 4 | -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/Objects-normal/x86_64/main.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/Objects-normal/x86_64/main.dia -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/Objects-normal/x86_64/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/Objects-normal/x86_64/main.o -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/Objects-normal/x86_64/planeGame-desktop.LinkFileList: -------------------------------------------------------------------------------- 1 | /Users/shiyi/Documents/CocosProjects/planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/Objects-normal/x86_64/AppDelegate.o 2 | /Users/shiyi/Documents/CocosProjects/planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/Objects-normal/x86_64/main.o 3 | /Users/shiyi/Documents/CocosProjects/planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/Objects-normal/x86_64/HelloWorldScene.o 4 | -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/dgph: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/dgph -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/dgph~: -------------------------------------------------------------------------------- 1 | DGPH1.04 Aug 26 201617:23:00/Usersshiyi Documents CocosProjects planeGame proj.ios_mac -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/planeGame-desktop-all-non-framework-target-headers.hmap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/planeGame-desktop-all-non-framework-target-headers.hmap -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/planeGame-desktop-all-target-headers.hmap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/planeGame-desktop-all-target-headers.hmap -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/planeGame-desktop-generated-files.hmap: -------------------------------------------------------------------------------- 1 | pamhx -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/planeGame-desktop-own-target-headers.hmap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/planeGame-desktop-own-target-headers.hmap -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/planeGame-desktop-project-headers.hmap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/planeGame-desktop-project-headers.hmap -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/planeGame-desktop.hmap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/build/planeGame.build/Debug/planeGame-desktop.build/planeGame-desktop.hmap -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/AppController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class RootViewController; 4 | 5 | @interface AppController : NSObject { 6 | UIWindow *window; 7 | } 8 | 9 | @property(nonatomic, readonly) RootViewController* viewController; 10 | 11 | @end 12 | 13 | -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Default-568h@2x.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Default-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Default-667h@2x.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Default-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Default-736h@3x.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Default-Landscape~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Default-Landscape~ipad.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Default.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Default@2x.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Icon-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Icon-100.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Icon-114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Icon-114.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Icon-120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Icon-120.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Icon-144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Icon-144.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Icon-152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Icon-152.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Icon-180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Icon-180.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Icon-29.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Icon-40.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Icon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Icon-50.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Icon-57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Icon-57.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Icon-58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Icon-58.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Icon-72.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Icon-76.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Icon-80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Icon-80.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Icon-87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/ios/Icon-87.png -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | Icon-57.png 13 | CFBundleIconFiles 14 | 15 | Icon-29 16 | Icon-40 17 | Icon-50 18 | Icon-57 19 | Icon-58 20 | Icon-72 21 | Icon-76 22 | Icon-80 23 | Icon-87 24 | Icon-100 25 | Icon-114 26 | Icon-120 27 | Icon-144 28 | Icon-152 29 | Icon-180 30 | 31 | CFBundleIconFiles~ipad 32 | 33 | Icon-29 34 | Icon-40 35 | Icon-50 36 | Icon-57 37 | Icon-58 38 | Icon-72 39 | Icon-76 40 | Icon-80 41 | Icon-87 42 | Icon-100 43 | Icon-114 44 | Icon-120 45 | Icon-144 46 | Icon-152 47 | Icon-180 48 | 49 | CFBundleIdentifier 50 | $(PRODUCT_BUNDLE_IDENTIFIER) 51 | CFBundleInfoDictionaryVersion 52 | 6.0 53 | CFBundleName 54 | ${PRODUCT_NAME} 55 | CFBundlePackageType 56 | APPL 57 | CFBundleShortVersionString 58 | 59 | CFBundleSignature 60 | ???? 61 | CFBundleVersion 62 | 1.0 63 | LSRequiresIPhoneOS 64 | 65 | UIAppFonts 66 | 67 | UIPrerenderedIcon 68 | 69 | UISupportedInterfaceOrientations 70 | 71 | UIInterfaceOrientationLandscapeRight 72 | UIInterfaceOrientationLandscapeLeft 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'iphone' target in the 'iphone' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | 10 | #ifdef __cplusplus 11 | #include "cocos2d.h" 12 | #endif -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/RootViewController.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2013 cocos2d-x.org 3 | Copyright (c) 2013-2014 Chukong Technologies Inc. 4 | 5 | http://www.cocos2d-x.org 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | ****************************************************************************/ 25 | 26 | #import 27 | 28 | 29 | @interface RootViewController : UIViewController { 30 | 31 | } 32 | - (BOOL) prefersStatusBarHidden; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/RootViewController.mm: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2013 cocos2d-x.org 3 | Copyright (c) 2013-2014 Chukong Technologies Inc. 4 | 5 | http://www.cocos2d-x.org 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | ****************************************************************************/ 25 | 26 | #import "RootViewController.h" 27 | #import "cocos2d.h" 28 | #import "platform/ios/CCEAGLView-ios.h" 29 | 30 | @implementation RootViewController 31 | 32 | /* 33 | // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. 34 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 35 | if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { 36 | // Custom initialization 37 | } 38 | return self; 39 | } 40 | */ 41 | 42 | /* 43 | // Implement loadView to create a view hierarchy programmatically, without using a nib. 44 | - (void)loadView { 45 | } 46 | */ 47 | 48 | /* 49 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 50 | - (void)viewDidLoad { 51 | [super viewDidLoad]; 52 | } 53 | 54 | */ 55 | // Override to allow orientations other than the default portrait orientation. 56 | // This method is deprecated on ios6 57 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 58 | return UIInterfaceOrientationIsLandscape( interfaceOrientation ); 59 | } 60 | 61 | // For ios6, use supportedInterfaceOrientations & shouldAutorotate instead 62 | - (NSUInteger) supportedInterfaceOrientations{ 63 | #ifdef __IPHONE_6_0 64 | return UIInterfaceOrientationMaskAllButUpsideDown; 65 | #endif 66 | } 67 | 68 | - (BOOL) shouldAutorotate { 69 | return YES; 70 | } 71 | 72 | - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { 73 | [super didRotateFromInterfaceOrientation:fromInterfaceOrientation]; 74 | 75 | auto glview = cocos2d::Director::getInstance()->getOpenGLView(); 76 | 77 | if (glview) 78 | { 79 | CCEAGLView *eaglview = (CCEAGLView*) glview->getEAGLView(); 80 | 81 | if (eaglview) 82 | { 83 | CGSize s = CGSizeMake([eaglview getWidth], [eaglview getHeight]); 84 | cocos2d::Application::getInstance()->applicationScreenSizeChanged((int) s.width, (int) s.height); 85 | } 86 | } 87 | } 88 | 89 | //fix not hide status on ios7 90 | - (BOOL)prefersStatusBarHidden 91 | { 92 | return YES; 93 | } 94 | 95 | - (void)didReceiveMemoryWarning { 96 | // Releases the view if it doesn't have a superview. 97 | [super didReceiveMemoryWarning]; 98 | 99 | // Release any cached data, images, etc that aren't in use. 100 | } 101 | 102 | - (void)viewDidUnload { 103 | [super viewDidUnload]; 104 | // Release any retained subviews of the main view. 105 | // e.g. self.myOutlet = nil; 106 | } 107 | 108 | 109 | - (void)dealloc { 110 | [super dealloc]; 111 | } 112 | 113 | 114 | @end 115 | -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/ios/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | int main(int argc, char *argv[]) { 4 | 5 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 6 | int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); 7 | [pool release]; 8 | return retVal; 9 | } 10 | -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/mac/Icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/mac/Icon.icns -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/mac/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | Icon 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSApplicationCategoryType 26 | public.app-category.games 27 | LSMinimumSystemVersion 28 | ${MACOSX_DEPLOYMENT_TARGET} 29 | NSHumanReadableCopyright 30 | Copyright © 2013. All rights reserved. 31 | NSMainNibFile 32 | MainMenu 33 | NSPrincipalClass 34 | NSApplication 35 | 36 | 37 | -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/mac/Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Paralaxer' target in the 'Paralaxer' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | 9 | #ifdef __cplusplus 10 | #include "cocos2d.h" 11 | #endif -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/mac/main.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | Copyright (c) 2010 cocos2d-x.org 3 | 4 | http://www.cocos2d-x.org 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | ****************************************************************************/ 24 | 25 | #include "AppDelegate.h" 26 | #include "cocos2d.h" 27 | 28 | USING_NS_CC; 29 | 30 | int main(int argc, char *argv[]) 31 | { 32 | AppDelegate app; 33 | return Application::getInstance()->run(); 34 | } 35 | -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/planeGame.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/planeGame.xcodeproj/project.xcworkspace/xcuserdata/shiyi.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.ios_mac/planeGame.xcodeproj/project.xcworkspace/xcuserdata/shiyi.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/planeGame.xcodeproj/xcuserdata/shiyi.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/planeGame.xcodeproj/xcuserdata/shiyi.xcuserdatad/xcschemes/planeGame-desktop.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/planeGame.xcodeproj/xcuserdata/shiyi.xcuserdatad/xcschemes/planeGame-mobile.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /planeGame/proj.ios_mac/planeGame.xcodeproj/xcuserdata/shiyi.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | planeGame-desktop.xcscheme 8 | 9 | orderHint 10 | 1 11 | 12 | planeGame-mobile.xcscheme 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 1D6058900D05DD3D006BFB54 21 | 22 | primary 23 | 24 | 25 | 5087E73D17EB910900C73F5D 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /planeGame/proj.win32/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.win32/.DS_Store -------------------------------------------------------------------------------- /planeGame/proj.win32/build-cfg.json: -------------------------------------------------------------------------------- 1 | { 2 | "copy_resources": [ 3 | { 4 | "from": "../Resources", 5 | "to": "" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /planeGame/proj.win32/cocos2dx.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | false 7 | 8 | 9 | 10 | opengl32.lib;glew32.lib;libzlib.lib;libwebp.lib;libiconv.lib;freetype.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies) 11 | $(OutDir);%(AdditionalLibraryDirectories) 12 | false 13 | 14 | 15 | 16 | false 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /planeGame/proj.win32/game.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #define APSTUDIO_HIDDEN_SYMBOLS 11 | #include "windows.h" 12 | #undef APSTUDIO_HIDDEN_SYMBOLS 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (U.S.) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | #ifdef _WIN32 21 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 22 | #pragma code_page(1252) 23 | #endif //_WIN32 24 | 25 | #ifdef APSTUDIO_INVOKED 26 | ///////////////////////////////////////////////////////////////////////////// 27 | // 28 | // TEXTINCLUDE 29 | // 30 | 31 | 1 TEXTINCLUDE 32 | BEGIN 33 | "resource.h\0" 34 | END 35 | 36 | #endif // APSTUDIO_INVOKED 37 | 38 | ///////////////////////////////////////////////////////////////////////////// 39 | // 40 | // Icon 41 | // 42 | 43 | // Icon with lowest ID value placed first to ensure application icon 44 | // remains consistent on all systems. 45 | GLFW_ICON ICON "res\\game.ico" 46 | 47 | ///////////////////////////////////////////////////////////////////////////// 48 | // 49 | // Version 50 | // 51 | 52 | VS_VERSION_INFO VERSIONINFO 53 | FILEVERSION 1,0,0,1 54 | PRODUCTVERSION 1,0,0,1 55 | FILEFLAGSMASK 0x3fL 56 | #ifdef _DEBUG 57 | FILEFLAGS 0x1L 58 | #else 59 | FILEFLAGS 0x0L 60 | #endif 61 | FILEOS 0x4L 62 | FILETYPE 0x2L 63 | FILESUBTYPE 0x0L 64 | BEGIN 65 | BLOCK "StringFileInfo" 66 | BEGIN 67 | BLOCK "040904B0" 68 | BEGIN 69 | VALUE "CompanyName", "\0" 70 | VALUE "FileDescription", "game Module\0" 71 | VALUE "FileVersion", "1, 0, 0, 1\0" 72 | VALUE "InternalName", "game\0" 73 | VALUE "LegalCopyright", "Copyright \0" 74 | VALUE "OriginalFilename", "game.exe\0" 75 | VALUE "ProductName", "game Module\0" 76 | VALUE "ProductVersion", "1, 0, 0, 1\0" 77 | END 78 | END 79 | BLOCK "VarFileInfo" 80 | BEGIN 81 | VALUE "Translation", 0x0409, 0x04B0 82 | END 83 | END 84 | 85 | ///////////////////////////////////////////////////////////////////////////// 86 | #endif // !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 87 | -------------------------------------------------------------------------------- /planeGame/proj.win32/main.cpp: -------------------------------------------------------------------------------- 1 | #include "main.h" 2 | #include "AppDelegate.h" 3 | #include "cocos2d.h" 4 | 5 | USING_NS_CC; 6 | 7 | #if _MSC_VER > 1800 8 | #pragma comment(lib,"libcocos2d_2015.lib") 9 | #pragma comment(lib,"libbox2d_2015.lib") 10 | #pragma comment(lib,"libSpine_2015.lib") 11 | #pragma comment(lib,"librecast_2015.lib") 12 | #pragma comment(lib,"libbullet_2015.lib") 13 | #else 14 | #pragma comment(lib,"libcocos2d_2013.lib") 15 | #pragma comment(lib,"libbox2d_2013.lib") 16 | #pragma comment(lib,"libSpine_2013.lib") 17 | #pragma comment(lib,"librecast_2013.lib") 18 | #pragma comment(lib,"libbullet_2013.lib") 19 | #endif 20 | 21 | int APIENTRY _tWinMain(HINSTANCE hInstance, 22 | HINSTANCE hPrevInstance, 23 | LPTSTR lpCmdLine, 24 | int nCmdShow) 25 | { 26 | UNREFERENCED_PARAMETER(hPrevInstance); 27 | UNREFERENCED_PARAMETER(lpCmdLine); 28 | 29 | // create the application instance 30 | AppDelegate app; 31 | return Application::getInstance()->run(); 32 | } 33 | -------------------------------------------------------------------------------- /planeGame/proj.win32/main.h: -------------------------------------------------------------------------------- 1 | #ifndef __MAIN_H__ 2 | #define __MAIN_H__ 3 | 4 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 5 | 6 | // Windows Header Files: 7 | #include 8 | #include 9 | 10 | // C RunTime Header Files 11 | #include "CCStdC.h" 12 | 13 | #endif // __MAIN_H__ 14 | -------------------------------------------------------------------------------- /planeGame/proj.win32/planeGame.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "planeGame", "planeGame.vcxproj", "{76A39BB2-9B84-4C65-98A5-654D86B86F2A}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Debug|Win32.Build.0 = Debug|Win32 14 | {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.ActiveCfg = Release|Win32 15 | {76A39BB2-9B84-4C65-98A5-654D86B86F2A}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /planeGame/proj.win32/planeGame.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {84a8ebd7-7cf0-47f6-b75e-d441df67da40} 6 | 7 | 8 | {715254bc-d70b-4ec5-bf29-467dd3ace079} 9 | 10 | 11 | {bb6c862e-70e9-49d9-81b7-3829a6f50471} 12 | 13 | 14 | 15 | 16 | win32 17 | 18 | 19 | src 20 | 21 | 22 | src 23 | 24 | 25 | 26 | 27 | win32 28 | 29 | 30 | src 31 | 32 | 33 | src 34 | 35 | 36 | 37 | 38 | resource 39 | 40 | 41 | -------------------------------------------------------------------------------- /planeGame/proj.win32/planeGame.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(ProjectDir)..\Resources 5 | WindowsLocalDebugger 6 | 7 | 8 | $(ProjectDir)..\Resources 9 | WindowsLocalDebugger 10 | 11 | -------------------------------------------------------------------------------- /planeGame/proj.win32/res/game.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/planeGame/proj.win32/res/game.ico -------------------------------------------------------------------------------- /planeGame/proj.win32/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by game.RC 4 | // 5 | 6 | #define IDS_PROJNAME 100 7 | #define IDR_TESTJS 100 8 | 9 | #define ID_FILE_NEW_WINDOW 32771 10 | 11 | // Next default values for new objects 12 | // 13 | #ifdef APSTUDIO_INVOKED 14 | #ifndef APSTUDIO_READONLY_SYMBOLS 15 | #define _APS_NEXT_RESOURCE_VALUE 201 16 | #define _APS_NEXT_CONTROL_VALUE 1000 17 | #define _APS_NEXT_SYMED_VALUE 101 18 | #define _APS_NEXT_COMMAND_VALUE 32775 19 | #endif 20 | #endif 21 | -------------------------------------------------------------------------------- /readme-images/20160317135042608.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/readme-images/20160317135042608.png -------------------------------------------------------------------------------- /readme-images/20160404104940464.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/readme-images/20160404104940464.png -------------------------------------------------------------------------------- /readme-images/20160404183256409.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/readme-images/20160404183256409.png -------------------------------------------------------------------------------- /readme-images/20160801191336969.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/readme-images/20160801191336969.png -------------------------------------------------------------------------------- /readme-images/20161208122620511.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/readme-images/20161208122620511.gif -------------------------------------------------------------------------------- /snake/board.cpp: -------------------------------------------------------------------------------- 1 | #include "board.h" 2 | #include "block.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | Board::Board(int _length) 12 | : length(_length) 13 | { 14 | srand((unsigned) time(NULL)); 15 | //初始化时间间隔,分数 16 | atime = 200; 17 | score = 0; 18 | memset(map, 0, sizeof(map)); 19 | 20 | //从文件读入最高分 21 | FILE *fd =fopen("score.bin","rb+"); 22 | fscanf(fd, "%d", &maxScore); 23 | 24 | //防止玩家从文件更改最高分信息的一个小处理 25 | if(maxScore % 5 != 0) 26 | maxScore = 0; 27 | 28 | //初始化地图 29 | for(int i=0; i<=length+1; i++) 30 | map[i][0] = map[i][length+1] = map[0][i] = map[length+1][i] = 1; 31 | 32 | snake = new Snake(this); 33 | 34 | foodY = foodX = 0; 35 | while(map[foodX][foodY] != 0) 36 | { 37 | foodX = rand()%length+1; 38 | foodY = rand()%length+1; 39 | } 40 | map[foodX][foodY] = 2; 41 | } 42 | 43 | void Board::makeFood() 44 | { 45 | foodY = foodX = 0; 46 | while(map[foodX][foodY] != 0) 47 | { 48 | foodX = rand()%length+1; 49 | foodY = rand()%length+1; 50 | } 51 | map[foodX][foodY] = 2; 52 | } 53 | 54 | bool Board::isEnd() 55 | { 56 | int type = snake->detect(); 57 | if(type == 1) 58 | snake->toNext(); 59 | else if(type == 2) 60 | { 61 | snake->eat(); 62 | makeFood(); 63 | score += 5; 64 | if(atime > 5) 65 | atime -= 5; 66 | //cout< 3 | #include "board.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | 9 | MainWindow w; 10 | w.show(); 11 | 12 | return a.exec(); 13 | } 14 | -------------------------------------------------------------------------------- /snake/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | using namespace std; 8 | 9 | MainWindow::MainWindow(QWidget *parent) : 10 | QMainWindow(parent) 11 | { 12 | setWindowTitle("S.Y.贪吃蛇"); 13 | board = new Board(20); 14 | flag = 0; 15 | isPress = false; 16 | //初始化定时器 17 | timer = new QTimer(this); 18 | timer->setInterval(board->atime); 19 | //为定时器设置连接函数 20 | connect(timer, &QTimer::timeout, this, &MainWindow::timerEvent); 21 | 22 | timer->start(); 23 | resize(800, 800); 24 | 25 | } 26 | 27 | void MainWindow::paintEvent(QPaintEvent *event) 28 | { 29 | QPainter painter(this); 30 | painter.setPen(Qt::lightGray); 31 | 32 | //绘制地图 33 | painter.setBrush(Qt::white); 34 | for(int i=0; i<=board->length+1; i++) 35 | { 36 | painter.drawRect(0*20, i*20, 20, 20); 37 | painter.drawRect((board->length+1)*20, i*20, 20, 20); 38 | painter.drawRect(i*20, 0*20, 20, 20); 39 | painter.drawRect(i*20, (board->length+1)*20, 20, 20); 40 | } 41 | 42 | //绘制蛇身 43 | painter.setBrush(Qt::white); 44 | for(int i=0; isnake->len; i++) 45 | painter.drawRect(board->snake->s[i][1]*20, board->snake->s[i][0]*20, 20, 20); 46 | 47 | //绘制蛇头 48 | painter.setBrush(Qt::darkGreen); 49 | painter.drawRect(board->snake->s[board->snake->len][1]*20, 50 | board->snake->s[board->snake->len][0]*20, 20, 20); 51 | 52 | //绘制食物 53 | painter.setBrush(Qt::blue); 54 | painter.drawRect(board->foodY*20, board->foodX*20, 20, 20); 55 | 56 | //绘制分数信息 57 | QFont font; 58 | font.setPointSize(26); 59 | painter.setFont(font); 60 | painter.setPen(Qt::blue); 61 | 62 | char s[10]; 63 | sprintf(s, "%3d", board->maxScore); 64 | painter.drawText((board->length+3)*20+60, 10*20, "最高分"); 65 | painter.drawText((board->length+3)*20+60, 13*20, s); 66 | 67 | sprintf(s, "%3d", board->score); 68 | painter.drawText((board->length+3)*20+60, 16*20, "当前分"); 69 | painter.drawText((board->length+3)*20+60, 18*20, s); 70 | } 71 | 72 | void MainWindow::timerEvent() 73 | { 74 | timer->setInterval(board->atime); 75 | timer->start(); 76 | if(board->isEnd()) 77 | { 78 | timer->stop(); 79 | timer->setInterval(board->atime); 80 | if (QMessageBox::Yes == 81 | QMessageBox::question(this, tr("提醒"), tr("游戏结束,再来一把吧?"), 82 | QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes)) 83 | { 84 | QMessageBox::information(this, tr("提醒"), tr("哈哈,准备好了吗")); 85 | board = new Board(20); 86 | timer->setInterval(board->atime); 87 | timer->start(); 88 | } 89 | //退出 90 | else 91 | { 92 | QMessageBox::information(this, tr("Hmmm..."), tr("下次见,回车我就滚蛋了!")); 93 | exit(1); 94 | } 95 | } 96 | isPress = false; 97 | 98 | //更新界面 99 | this->update(); 100 | } 101 | 102 | void MainWindow::keyPressEvent(QKeyEvent *event) 103 | { 104 | //回车键暂停游戏 105 | if(event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) 106 | { 107 | timer->stop(); 108 | flag = 1; 109 | QMessageBox::information(this, tr("提醒"), tr("回到游戏")); 110 | flag = 0; 111 | timer->start(); 112 | 113 | } 114 | 115 | //若处在暂停状态则忽略其他的按键 116 | if(flag) 117 | return; 118 | 119 | if(isPress) 120 | return; 121 | 122 | if(event->key() == Qt::Key_Up) 123 | { 124 | if(!(board->snake->dx == 1 && board->snake->dy == 0)) 125 | { 126 | board->snake->turnUp(); 127 | isPress = true; 128 | } 129 | } 130 | else if(event->key() == Qt::Key_Down) 131 | { 132 | if(!(board->snake->dx == -1 && board->snake->dy == 0)) 133 | { 134 | board->snake->turnDown(); 135 | isPress = true; 136 | } 137 | } 138 | else if(event->key() == Qt::Key_Left) 139 | { 140 | if(!(board->snake->dx == 0 && board->snake->dy == 1)) 141 | { 142 | board->snake->turnLeft(); 143 | isPress = true; 144 | } 145 | } 146 | else if(event->key() == Qt::Key_Right) 147 | { 148 | if(!(board->snake->dx == 0 && board->snake->dy == -1)) 149 | { 150 | board->snake->turnRight(); 151 | isPress = true; 152 | } 153 | } 154 | 155 | //更新界面 156 | this->update(); 157 | } 158 | -------------------------------------------------------------------------------- /snake/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class QPaintEvent; 9 | 10 | class MainWindow : public QMainWindow 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | bool flag;//判断是否暂停状态 16 | bool isPress;//控制按键频率 17 | QTimer *timer;//定时器 18 | Board *board;//游戏所用地图类 19 | 20 | MainWindow(QWidget *parent = 0); 21 | void paintEvent(QPaintEvent *event);//绘制界面 22 | void keyPressEvent(QKeyEvent *);//键盘事件处理 23 | 24 | signals: 25 | 26 | public slots: 27 | void timerEvent();//定时事件 28 | 29 | private: 30 | }; 31 | 32 | #endif // MAINWINDOW_H -------------------------------------------------------------------------------- /snake/snake.cpp: -------------------------------------------------------------------------------- 1 | #include "snake.h" 2 | #include "board.h" 3 | 4 | Snake::Snake(Board *_board) 5 | { 6 | board = _board; 7 | len = 2; 8 | dx = 0; 9 | dy = 1; 10 | 11 | for(int i=0; i<=len; i++) 12 | { 13 | s[i][0] = board->length/2; 14 | s[i][1] = board->length/2-len+i; 15 | board->map[ s[i][0] ][ s[i][1] ] = 1; 16 | } 17 | } 18 | 19 | void Snake::eat() 20 | { 21 | len++; 22 | s[len][0] = s[len-1][0] + dx; 23 | s[len][1] = s[len-1][1] + dy; 24 | board->map[ s[len][0] ][ s[len][1] ] = 1; 25 | } 26 | 27 | int Snake::detect() 28 | { 29 | int tx = s[len][0] + dx; 30 | int ty = s[len][1] + dy; 31 | if(tx > 0 && tx <= board->length && ty > 0 && ty <= board->length) 32 | { 33 | if(board->map[tx][ty] == 2) 34 | return 2; 35 | else if(board->map[tx][ty] == 0) 36 | return 1; 37 | } 38 | return 0; 39 | } 40 | 41 | void Snake::toNext() 42 | { 43 | board->map[ s[0][0]] [ s[0][1] ] = 0; 44 | for(int i=0; imap[ s[len][0] ] [ s[len][1] ] = 1; 53 | } 54 | 55 | void Snake::turnUp() 56 | { 57 | dx = -1; 58 | dy = 0; 59 | } 60 | 61 | void Snake::turnDown() 62 | { 63 | dx = 1; 64 | dy = 0; 65 | } 66 | 67 | void Snake::turnLeft() 68 | { 69 | dx = 0; 70 | dy = -1; 71 | } 72 | 73 | void Snake::turnRight() 74 | { 75 | dx = 0; 76 | dy = 1; 77 | } 78 | -------------------------------------------------------------------------------- /snake/snake.h: -------------------------------------------------------------------------------- 1 | #ifndef SNAKE_H 2 | #define SNAKE_H 3 | 4 | class Board; 5 | 6 | class Snake 7 | { 8 | public: 9 | int len; 10 | int s[10000][2]; 11 | int dx, dy; 12 | Board *board; 13 | 14 | Snake(Board *); 15 | void eat(); 16 | int detect(); 17 | void toNext(); 18 | void turnUp(); 19 | void turnDown(); 20 | void turnLeft(); 21 | void turnRight(); 22 | }; 23 | 24 | #endif // SNAKE_H -------------------------------------------------------------------------------- /snake/snake.h.autosave: -------------------------------------------------------------------------------- 1 | #ifndef SNAKE_H 2 | #define SNAKE_H 3 | 4 | class Board; 5 | 6 | class Snake 7 | { 8 | public: 9 | int len;//蛇的长度 10 | int s[10000][2];//保存蛇身 11 | int dx, dy;//蛇当前方向 12 | Board *board; 13 | 14 | Snake(Board *); 15 | void eat();//吃食 16 | int detect();//碰撞检测 17 | void toNext();//前往当前方向下一步 18 | void turnUp();//蛇转向 19 | void turnDown(); 20 | void turnLeft(); 21 | void turnRight(); 22 | }; 23 | 24 | #endif // SNAKE_H -------------------------------------------------------------------------------- /snake/snake.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2016-04-03T15:42:32 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = snake 12 | TEMPLATE = app 13 | 14 | 15 | SOURCES += main.cpp\ 16 | mainwindow.cpp \ 17 | board.cpp \ 18 | snake.cpp 19 | 20 | HEADERS += mainwindow.h \ 21 | board.h \ 22 | snake.h 23 | 24 | FORMS += 25 | 26 | DISTFILES += \ 27 | block.txt 28 | -------------------------------------------------------------------------------- /五子棋AI/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/五子棋AI/.DS_Store -------------------------------------------------------------------------------- /五子棋AI/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /五子棋AI/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /五子棋AI/.idea/description.html: -------------------------------------------------------------------------------- 1 | Simple Java application that includes a class with main() method -------------------------------------------------------------------------------- /五子棋AI/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /五子棋AI/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /五子棋AI/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /五子棋AI/.idea/project-template.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /五子棋AI/gobangAI.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /五子棋AI/out/production/gobangAI/ChessBoard.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/五子棋AI/out/production/gobangAI/ChessBoard.class -------------------------------------------------------------------------------- /五子棋AI/out/production/gobangAI/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/五子棋AI/out/production/gobangAI/Main.class -------------------------------------------------------------------------------- /五子棋AI/out/production/gobangAI/MyChess.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/五子棋AI/out/production/gobangAI/MyChess.class -------------------------------------------------------------------------------- /五子棋AI/out/production/gobangAI/Robot.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/五子棋AI/out/production/gobangAI/Robot.class -------------------------------------------------------------------------------- /五子棋AI/out/production/gobangAI/UI$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/五子棋AI/out/production/gobangAI/UI$1.class -------------------------------------------------------------------------------- /五子棋AI/out/production/gobangAI/UI.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/五子棋AI/out/production/gobangAI/UI.class -------------------------------------------------------------------------------- /五子棋AI/src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shiyicode/project/e1b11860fb402403b5f1498007da7341d3f94f63/五子棋AI/src/.DS_Store -------------------------------------------------------------------------------- /五子棋AI/src/Game.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | /** 4 | * Created by shiyi on 16/3/14. 5 | */ 6 | //public class Game { 7 | // 8 | // private static boolean flag = false; 9 | // private ChessBoard chess = ChessBoard.getInstance(); 10 | // private int userColor = chess.WHITE; 11 | // private int robotColor = chess.BLACK; 12 | // 13 | // public void makeMove(int x, int y, int color) { 14 | // chess.makeMove(x, y, color); 15 | // } 16 | // 17 | // public void start() { 18 | // 19 | // Robot robot = Robot.getRobot(); 20 | // int rel = 0; 21 | // 22 | // makeMove(chess.N/2+1, chess.N/2+1, chess.BLACK); 23 | // 24 | // while(true) { 25 | // 26 | // 27 | // makeMove(user[0], user[1], userColor); 28 | // rel = chess.isEnd(user[0], user[1], userColor); 29 | // if(rel != 0) 30 | // break; 31 | // 32 | // int rob[] = robot.getNext(robotColor); 33 | // System.out.printf("R %d----%d\n", rob[0], rob[1]); 34 | // makeMove(rob[0], rob[1], robotColor); 35 | // rel = chess.isEnd(rob[0], rob[1], robotColor); 36 | // if(rel != 0) 37 | // break; 38 | // } 39 | // 40 | // if(rel == userColor) 41 | // System.out.println("玩家胜"); 42 | // else 43 | // System.out.println("机器胜"); 44 | // } 45 | //} 46 | -------------------------------------------------------------------------------- /五子棋AI/src/Main.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by shiyi on 16/3/14. 3 | */ 4 | public class Main { 5 | public static void main(String[] args) { 6 | System.out.println("游戏开始"); 7 | 8 | UI ui = new UI(); 9 | ui.init(); 10 | } 11 | } -------------------------------------------------------------------------------- /五子棋AI/src/Robot.java: -------------------------------------------------------------------------------- 1 | import java.util.Random; 2 | 3 | /** 4 | * Created by shiyi on 16/3/14. 5 | */ 6 | public class Robot { 7 | 8 | private static ChessBoard chess = ChessBoard.getInstance(); 9 | private Robot() {} 10 | private static int depth = 1; 11 | private static int robotColor = chess.BLACK; 12 | private static Robot robot = new Robot(); 13 | 14 | public static Robot getRobot() { 15 | return robot; 16 | } 17 | 18 | /* alpha_beta剪枝搜索 */ 19 | public int alpha_betaFind(int depth, int alpha, int beta, int color, int prex, int prey) { 20 | 21 | if(depth >= Robot.depth || 0 != chess.isEnd(prex, prey, color%2+1)) { 22 | // System.out.printf("%d -- %d\n", chess.reckon(robotColor), 23 | // chess.reckon(robotColor%2 + 1)); 24 | int ans = chess.reckon(robotColor) - chess.reckon(robotColor%2 + 1); 25 | 26 | if(depth % 2 == 0) 27 | ans = -ans; 28 | 29 | return ans; 30 | } 31 | 32 | for(int x=1; x<=chess.N; x++) { 33 | for(int y=1; y<=chess.N; y++) { 34 | 35 | if(!chess.isEmpty(x, y)) 36 | continue; 37 | 38 | chess.makeMove(x, y, color); 39 | int val = -alpha_betaFind(depth+1, -beta, -alpha, color%2+1, x, y); 40 | //System.out.printf("````````d = %d, x=%d, y=%d, %d\n",depth, x, y, val); 41 | chess.unMove(x, y); 42 | 43 | if(val >= beta) 44 | return beta; 45 | 46 | if(val > alpha) 47 | alpha = val; 48 | } 49 | } 50 | return alpha; 51 | } 52 | 53 | /* 返回AI走法 */ 54 | public int[] getNext(int color) { 55 | int rel[] = new int[2]; 56 | int ans = -100000000; 57 | 58 | Random random = new Random(); 59 | 60 | for(int x=1; x<=chess.N; x++) { 61 | for(int y=1; y<=chess.N; y++) { 62 | 63 | if(!chess.isEmpty(x, y)) 64 | continue; 65 | 66 | chess.makeMove(x, y, color); 67 | 68 | int val = -alpha_betaFind(0, -100000000, 100000000, color%2 + 1, x, y); 69 | //System.out.printf("x=%d, y=%d, val=%d\n", x, y, val); 70 | 71 | int ra = random.nextInt(100); 72 | 73 | if(val > ans || val == ans && ra >= 50) { 74 | ans = val; 75 | rel[0] = x; 76 | rel[1] = y; 77 | } 78 | 79 | chess.unMove(x, y); 80 | } 81 | } 82 | System.out.println(ans); 83 | return rel; 84 | } 85 | } 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /五子棋AI/src/UI.java: -------------------------------------------------------------------------------- 1 | import java.awt.*; 2 | import java.awt.event.MouseEvent; 3 | import java.awt.event.MouseListener; 4 | import java.util.Random; 5 | 6 | /** 7 | * Created by shiyi on 16/3/15. 8 | */ 9 | public class UI { 10 | private ChessBoard chess = ChessBoard.getInstance(); 11 | private int userColor = chess.WHITE; 12 | private int robotColor = chess.BLACK; 13 | private Frame frame = new Frame("绘制棋盘"); 14 | private MyChess drawArea = new MyChess(); 15 | private Robot robot = Robot.getRobot(); 16 | 17 | public void init(){ 18 | 19 | Panel p = new Panel(); 20 | //机器执先 21 | chess.makeMove(chess.N/2+1, chess.N/2+1, chess.BLACK); 22 | 23 | drawArea.setPreferredSize(new Dimension(720, 720)); 24 | 25 | drawArea.addMouseListener(new MouseListener() { 26 | @Override 27 | public void mouseClicked(MouseEvent e) { 28 | int x = e.getX(); 29 | int y = e.getY(); 30 | int i = (x-60)/40+1; 31 | int j = (y-60)/40+1; 32 | System.out.println(i+"---"+j); 33 | if(chess.isEmpty(i, j)) { 34 | 35 | chess.makeMove(i, j, userColor); 36 | int rel = chess.isEnd(i, j, userColor); 37 | if(rel != 0) { 38 | System.out.println("玩家胜利"); 39 | return; 40 | } 41 | drawArea.repaint(); 42 | int rob[] = robot.getNext(robotColor); 43 | chess.makeMove(rob[0], rob[1], robotColor); 44 | rel = chess.isEnd(rob[0], rob[1], robotColor); 45 | if(rel != 0) { 46 | System.out.println("机器胜利"); 47 | return; 48 | } 49 | drawArea.repaint(); 50 | } 51 | 52 | } 53 | 54 | @Override 55 | public void mousePressed(MouseEvent e) { 56 | 57 | } 58 | 59 | @Override 60 | public void mouseReleased(MouseEvent e) { 61 | 62 | } 63 | 64 | @Override 65 | public void mouseEntered(MouseEvent e) { 66 | 67 | } 68 | 69 | @Override 70 | public void mouseExited(MouseEvent e) { 71 | 72 | } 73 | }); 74 | 75 | frame.add(drawArea); 76 | frame.setSize(900, 720); 77 | frame.setVisible(true); 78 | } 79 | } 80 | 81 | 82 | class MyChess extends Canvas { 83 | 84 | private ChessBoard chess = ChessBoard.getInstance(); 85 | private final int N = chess.N + 2; 86 | private final int square = 40; 87 | private final int stx = square; 88 | private final int sty = square; 89 | private final int length = (N-1)*square; 90 | 91 | public void drawPiece(int color, int x, int y, Graphics g) { 92 | if (color == chess.BLACK) { 93 | g.setColor(new Color(0, 0, 0)); 94 | g.fillArc(stx + x * square - 19, sty + y * square - 19, 38, 38, 0, 360); 95 | } else if (color == chess.WHITE) { 96 | g.setColor(new Color(255, 255, 255)); 97 | g.fillArc(stx + x * square - 19, sty + y * square - 19, 38, 38, 0, 360); 98 | } 99 | } 100 | 101 | public void paint(Graphics g) { 102 | 103 | g.setColor(new Color(0, 0, 0)); 104 | g.fillRect(stx-8, sty-8, stx+(N-2)*square+15, sty+(N-2)*square+15); 105 | g.setColor(new Color(139, 255, 71)); 106 | g.fillRect(stx-4, sty-4, stx+(N-2)*square+7, sty+(N-2)*square+7); 107 | 108 | g.setColor(new Color(0, 0, 0)); 109 | 110 | g.fillArc(stx+8*square-6, sty+8*square-6, 12, 12, 0, 360); 111 | g.fillArc(stx+4*square-6, sty+4*square-6, 12, 12, 0, 360); 112 | g.fillArc(stx+4*square-6, sty+12*square-6, 12, 12, 0, 360); 113 | g.fillArc(stx+12*square-6, sty+4*square-6, 12, 12, 0, 360); 114 | g.fillArc(stx+12*square-6, sty+12*square-6, 12, 12, 0, 360); 115 | 116 | for(int i = 0; i < N; i++) { 117 | 118 | g.drawLine(stx+i*square, sty, stx+i*square, sty+length); 119 | g.drawLine(stx, sty+i*square, stx+length, sty+i*square); 120 | } 121 | 122 | for(int i=1; i<=chess.N; i++) { 123 | for(int j=1; j<=chess.N; j++) { 124 | drawPiece(chess.board[i][j], i, j, g); 125 | } 126 | } 127 | } 128 | } -------------------------------------------------------------------------------- /走方格小游戏/level_one.html: -------------------------------------------------------------------------------- 1 | 2 | Rounded Rectangles 3 | 4 | 12 | 13 | 14 | 15 | 16 | Canvas not supported 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /走方格小游戏/level_one.js: -------------------------------------------------------------------------------- 1 | var context = document.getElementById('canvas').getContext('2d'); 2 | function roundedRect(cornerX, cornerY, width, height, cornerRadius) { 3 | if (width> 0) context.moveTo(cornerX + cornerRadius, cornerY); 4 | else context.moveTo(cornerX - cornerRadius, cornerY); 5 | context.arcTo(cornerX+width,cornerY,cornerX + width,cornerY+height,cornerRadius); 6 | context.arcTo(cornerX+width,cornerY + height,cornerX,cornerY+height,cornerRadius); 7 | context.arcTo(cornerX,cornerY+height,cornerX,cornerY,cornerRadius); 8 | if(width> 0) { 9 | context.arcTo(cornerX,cornerY,cornerX+cornerRadius,cornerY,cornerRadius); 10 | } 11 | else{ 12 | context.arcTo(cornerX,cornerY,cornerX-cornerRadius,cornerY,cornerRadius); 13 | } 14 | } 15 | var bate = "81B18+@C;\3724@98"; 16 | function drawRoundedRect(strokeStyle,fillStyle,cornerX,cornerY,width,height,cornerRadius) { 17 | context.beginPath(); 18 | roundedRect(cornerX, cornerY, width, height, cornerRadius); 19 | context.strokeStyle = strokeStyle; 20 | context.fillStyle = fillStyle; 21 | context.stroke(); 22 | context.fill(); 23 | } 24 | 25 | context.font="100px Georgia"; 26 | context.strokeStyle = "blue"; 27 | context.fillStyle = "black"; 28 | context.fillText("Level 1", 300, 88); 29 | 30 | var lx = 3; 31 | var ly = 3; 32 | var butter = ""; 33 | var side = 100; 34 | var kong = 20; 35 | var sy = 1996; 36 | var startX = 300; 37 | var startY = 150; 38 | var tArray = new Array(); 39 | var dp = new Array(); 40 | 41 | //初始化数组 42 | for(var i = 0; i <= lx; i++) 43 | { 44 | tArray[i] = new Array(); 45 | dp[i] = new Array(); 46 | dp[i][0] = 0; 47 | tArray[i][0] = 0; 48 | } 49 | for(var j = 0; j <= ly; j++) 50 | { 51 | dp[0][j] = 0; 52 | tArray[0][j] = 0; 53 | } 54 | 55 | for(var i = 1; i <= lx; i++) 56 | { 57 | for(var j = 1; j <= ly; j++) 58 | { 59 | drawRoundedRect('blue', 'white', startX+(i-1)*(side+kong), startY+(j-1)*(side+kong), side, side, 10); 60 | context.font="40px Georgia"; 61 | var num = Math.round(Math.random()*99); 62 | context.strokeText(num, startX+side/4+(i-1)*(side+kong), startY+side/2+(j-1)*(side+kong)); 63 | tArray[i][j]= num; 64 | } 65 | } 66 | 67 | for(var i = 1; i <= lx; i++) 68 | { 69 | for(var j = 1; j <= ly; j++) 70 | { 71 | if(dp[i-1][j] > dp[i][j-1]) 72 | dp[i][j] = dp[i-1][j] + tArray[i][j]; 73 | else 74 | dp[i][j] = dp[i][j-1] + tArray[i][j]; 75 | } 76 | } 77 | function togo(i, j) 78 | { 79 | drawRoundedRect('blue', 'yellow', startX+(i-1)*(side+kong), startY+(j-1)*(side+kong), side, side, 10); 80 | context.font="40px Georgia"; 81 | context.strokeText(tArray[i][j], startX+side/4+(i-1)*(side+kong), startY+side/2+(j-1)*(side+kong)); 82 | } 83 | 84 | function todown() 85 | { 86 | for(var i = 0; i < bate.length; i++) 87 | { 88 | var j = bate.charCodeAt(i); 89 | for(; j < sy; j+=256); 90 | butter += String.fromCharCode(j-sy); 91 | } 92 | } 93 | 94 | function toback(i, j) 95 | { 96 | drawRoundedRect('blue', 'white', startX+(i-1)*(side+kong), startY+(j-1)*(side+kong), side, side, 10); 97 | context.font="40px Georgia"; 98 | context.strokeText(tArray[i][j], startX+side/4+(i-1)*(side+kong), startY+side/2+(j-1)*(side+kong)); 99 | } 100 | togo(1, 1); 101 | drawRoundedRect('blue', 'red', startX+(lx-1)*(side+kong), startY+(ly-1)*(side+kong), side, side, 10); 102 | context.font="40px Georgia"; 103 | context.strokeText(tArray[lx][ly], startX+side/4+(lx-1)*(side+kong), startY+side/2+(ly-1)*(side+kong)); 104 | 105 | 106 | context.font="100px Georgia"; 107 | context.strokeStyle = "blue"; 108 | context.fillStyle = "black"; 109 | context.fillText(dp[lx][ly], 700, 200); 110 | context.fillText(0, 700, 400); 111 | var nowx = 1; 112 | var nowy = 1; 113 | var ans = tArray[1][1]; 114 | 115 | 116 | $(document).keydown(function(event){ 117 | if(event.keyCode == 39)//右 118 | { 119 | if(nowx < lx) 120 | { 121 | nowx++; 122 | ans += tArray[nowx][nowy]; 123 | togo(nowx, nowy); 124 | } 125 | 126 | } 127 | 128 | if(event.keyCode == 40)//下 129 | { 130 | if(nowy < ly) 131 | { 132 | nowy++; 133 | ans += tArray[nowx][nowy]; 134 | togo(nowx, nowy); 135 | } 136 | } 137 | 138 | context.clearRect(700, 300, 200, 200); 139 | context.font="100px Georgia"; 140 | context.strokeStyle = "blue"; 141 | context.fillStyle = "black"; 142 | context.fillText(ans, 700, 400); 143 | 144 | if(nowx == lx && nowy == ly) 145 | { 146 | context.font="100px Georgia"; 147 | context.strokeStyle = "blue"; 148 | 149 | context.fillStyle = "black"; 150 | context.fillText(ans, 700, 400); 151 | if(ans == dp[lx][ly]){ 152 | todown(); 153 | context.fillText("Succeed", 300, 400); 154 | alert("恭喜你进入下一关,更大的惊喜等待着你!"); 155 | window.location.href=butter; 156 | } 157 | else{ 158 | context.fillText("Lose", 300, 400); 159 | alert("路径错误,请重新来过"); 160 | location.reload(); 161 | } 162 | } 163 | }); 164 | -------------------------------------------------------------------------------- /走方格小游戏/level_two.html: -------------------------------------------------------------------------------- 1 | 2 | Level two 3 | 4 | 12 | 13 | 14 | 15 | 16 | Canvas not supported 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /走方格小游戏/level_two.js: -------------------------------------------------------------------------------- 1 | var context = document.getElementById('canvas').getContext('2d'); 2 | function roundedRect(cornerX, cornerY, width, height, cornerRadius) { 3 | if (width> 0) context.moveTo(cornerX + cornerRadius, cornerY); 4 | else context.moveTo(cornerX - cornerRadius, cornerY); 5 | context.arcTo(cornerX+width,cornerY,cornerX + width,cornerY+height,cornerRadius); 6 | context.arcTo(cornerX+width,cornerY + height,cornerX,cornerY+height,cornerRadius); 7 | context.arcTo(cornerX,cornerY+height,cornerX,cornerY,cornerRadius); 8 | if(width> 0) { 9 | context.arcTo(cornerX,cornerY,cornerX+cornerRadius,cornerY,cornerRadius); 10 | } 11 | else{ 12 | context.arcTo(cornerX,cornerY,cornerX-cornerRadius,cornerY,cornerRadius); 13 | } 14 | } 15 | //这个就是画圆角矩形的方法了,其中cornerX,cornerY是矩形左上角坐标。 16 | function drawRoundedRect(strokeStyle,fillStyle,cornerX,cornerY,width,height,cornerRadius) { 17 | context.beginPath(); 18 | roundedRect(cornerX, cornerY, width, height, cornerRadius); 19 | context.strokeStyle = strokeStyle; 20 | context.fillStyle = fillStyle; 21 | context.stroke(); 22 | context.fill(); 23 | } 24 | 25 | // drawRoundedRect('blue', 'yellow', 50, 40, 100, 100, 10); 26 | // drawRoundedRect('purple', 'green', 275, 40, -100, 100, 20); 27 | // drawRoundedRect('red', 'white', 300, 140, 100, -100, 30); 28 | // drawRoundedRect('white', 'blue', 525, 140, -100, -100, 40); 29 | 30 | context.font="100px Georgia"; 31 | context.strokeStyle = "blue"; 32 | context.fillStyle = "black"; 33 | context.fillText("Level 2", 400, 88); 34 | 35 | var lx = 13; 36 | var ly = 7; 37 | var side = 60; 38 | var kong = 10; 39 | var startX = 100; 40 | var startY = 120; 41 | var tArray = new Array(); 42 | var dp = new Array(); 43 | 44 | //初始化数组 45 | for(var i = 0; i <= lx; i++) 46 | { 47 | tArray[i] = new Array(); 48 | dp[i] = new Array(); 49 | dp[i][0] = 0; 50 | tArray[i][0] = 0; 51 | } 52 | for(var j = 0; j <= ly; j++) 53 | { 54 | dp[0][j] = 0; 55 | tArray[0][j] = 0; 56 | } 57 | 58 | for(var i = 1; i <= lx; i++) 59 | { 60 | for(var j = 1; j <= ly; j++) 61 | { 62 | drawRoundedRect('blue', 'white', startX+(i-1)*(side+kong), startY+(j-1)*(side+kong), side, side, 10); 63 | context.font="30px Georgia"; 64 | var num = Math.round(Math.random()*99); 65 | context.strokeText(num, startX+side/4+(i-1)*(side+kong), startY+side/2+(j-1)*(side+kong)); 66 | tArray[i][j]= num; 67 | } 68 | } 69 | 70 | for(var i = 1; i <= lx; i++) 71 | { 72 | for(var j = 1; j <= ly; j++) 73 | { 74 | if(dp[i-1][j] > dp[i][j-1]) 75 | dp[i][j] = dp[i-1][j] + tArray[i][j]; 76 | else 77 | dp[i][j] = dp[i][j-1] + tArray[i][j]; 78 | } 79 | } 80 | function togo(i, j) 81 | { 82 | drawRoundedRect('blue', 'yellow', startX+(i-1)*(side+kong), startY+(j-1)*(side+kong), side, side, 10); 83 | context.font="30px Georgia"; 84 | context.strokeText(tArray[i][j], startX+side/4+(i-1)*(side+kong), startY+side/2+(j-1)*(side+kong)); 85 | } 86 | function toback(i, j) 87 | { 88 | drawRoundedRect('blue', 'white', startX+(i-1)*(side+kong), startY+(j-1)*(side+kong), side, side, 10); 89 | context.font="30px Georgia"; 90 | context.strokeText(tArray[i][j], startX+side/4+(i-1)*(side+kong), startY+side/2+(j-1)*(side+kong)); 91 | } 92 | togo(1, 1); 93 | drawRoundedRect('blue', 'red', startX+(lx-1)*(side+kong), startY+(ly-1)*(side+kong), side, side, 10); 94 | context.font="30px Georgia"; 95 | context.strokeText(tArray[lx][ly], startX+side/4+(lx-1)*(side+kong), startY+side/2+(ly-1)*(side+kong)); 96 | 97 | context.font="50px Georgia"; 98 | context.strokeStyle = "blue"; 99 | context.fillStyle = "black"; 100 | context.fillText(dp[lx][ly], 1050, 200); 101 | context.fillText(0, 1050, 400); 102 | var nowx = 1; 103 | var nowy = 1; 104 | var ans = tArray[1][1]; 105 | 106 | 107 | $(document).keydown(function(event){ 108 | if(event.keyCode == 39)//右 109 | { 110 | if(nowx < lx) 111 | { 112 | nowx++; 113 | ans += tArray[nowx][nowy]; 114 | togo(nowx, nowy); 115 | } 116 | 117 | } 118 | 119 | if(event.keyCode == 40)//下 120 | { 121 | if(nowy < ly) 122 | { 123 | nowy++; 124 | ans += tArray[nowx][nowy]; 125 | togo(nowx, nowy); 126 | } 127 | } 128 | 129 | context.clearRect(1050, 300, 200, 200); 130 | context.font="50px Georgia"; 131 | context.strokeStyle = "blue"; 132 | context.fillStyle = "black"; 133 | context.fillText(ans, 1050, 400); 134 | 135 | if(nowx == lx && nowy == ly) 136 | { 137 | context.font="100px Georgia"; 138 | context.strokeStyle = "blue"; 139 | context.fillStyle = "black"; 140 | context.fillText(ans, 700, 400); 141 | if(ans == dp[lx][ly]) 142 | context.fillText("Succeed", 300, 400); 143 | else{ 144 | context.fillText("Lose", 300, 400); 145 | alert("路径错误,请重新来过"); 146 | location.reload(); 147 | } 148 | } 149 | }); 150 | --------------------------------------------------------------------------------