Skip to content
Browse files

GIT weirdness... It claims I have modified everything, including jQue…

…ry. I HAVE NOT!
  • Loading branch information...
1 parent 36312ac commit 0467860a384f42ed1ffd4e53e2d855285e205dd9 @dylanbeattie committed Jun 5, 2011
Showing with 518 additions and 457 deletions.
  1. +9 −0 .idea/KaboomJS.iml
  2. +5 −0 .idea/encodings.xml
  3. +11 −0 .idea/misc.xml
  4. +9 −0 .idea/modules.xml
  5. +7 −0 .idea/vcs.xml
  6. +73 −50 .idea/workspace.xml
  7. 0 client.js
  8. 0 data/level.txt
  9. 0 etc/BOMBPAL.jpg
  10. 0 etc/RawResources/Graphics/BOMBDUDE.jpg
  11. 0 etc/RawResources/Graphics/BONUS.jpg
  12. 0 etc/RawResources/Graphics/CREDBAR.jpg
  13. 0 etc/RawResources/Graphics/DRAW.jpg
  14. 0 etc/RawResources/Graphics/FIELD0.jpg
  15. 0 etc/RawResources/Graphics/FIELD1.jpg
  16. 0 etc/RawResources/Graphics/FIELD10.jpg
  17. 0 etc/RawResources/Graphics/FIELD2.jpg
  18. 0 etc/RawResources/Graphics/FIELD3.jpg
  19. 0 etc/RawResources/Graphics/FIELD4.jpg
  20. 0 etc/RawResources/Graphics/FIELD5.jpg
  21. 0 etc/RawResources/Graphics/FIELD6.jpg
  22. 0 etc/RawResources/Graphics/FIELD7.jpg
  23. 0 etc/RawResources/Graphics/FIELD8.jpg
  24. 0 etc/RawResources/Graphics/FIELD9.jpg
  25. 0 etc/RawResources/Graphics/GLUE0.jpg
  26. 0 etc/RawResources/Graphics/GLUE1.jpg
  27. 0 etc/RawResources/Graphics/GLUE2.jpg
  28. 0 etc/RawResources/Graphics/GLUE3.jpg
  29. 0 etc/RawResources/Graphics/GLUE4.jpg
  30. 0 etc/RawResources/Graphics/GLUE5.jpg
  31. 0 etc/RawResources/Graphics/GLUE6.jpg
  32. 0 etc/RawResources/Graphics/HSLOGO.jpg
  33. 0 etc/RawResources/Graphics/IPLOGO.jpg
  34. 0 etc/RawResources/Graphics/JERM.jpg
  35. 0 etc/RawResources/Graphics/KURT.jpg
  36. 0 etc/RawResources/Graphics/KURTHEAD.jpg
  37. 0 etc/RawResources/Graphics/MAINMENU.jpg
  38. 0 etc/RawResources/Graphics/POWBAD.jpg
  39. 0 etc/RawResources/Graphics/POWBOMB.jpg
  40. 0 etc/RawResources/Graphics/POWDISEA.jpg
  41. 0 etc/RawResources/Graphics/POWEBOLA.jpg
  42. 0 etc/RawResources/Graphics/POWFAST.jpg
  43. 0 etc/RawResources/Graphics/POWFLAME.jpg
  44. 0 etc/RawResources/Graphics/POWGOLD.jpg
  45. 0 etc/RawResources/Graphics/POWGRAB.jpg
  46. 0 etc/RawResources/Graphics/POWJELLY.jpg
  47. 0 etc/RawResources/Graphics/POWKICK.jpg
  48. 0 etc/RawResources/Graphics/POWPUNCH.jpg
  49. 0 etc/RawResources/Graphics/POWRAND.jpg
  50. 0 etc/RawResources/Graphics/POWSKATE.jpg
  51. 0 etc/RawResources/Graphics/POWSLOW.jpg
  52. 0 etc/RawResources/Graphics/POWSPOOG.jpg
  53. 0 etc/RawResources/Graphics/POWTRIG.jpg
  54. 0 etc/RawResources/Graphics/QALOGO.jpg
  55. 0 etc/RawResources/Graphics/RESULTS.jpg
  56. 0 etc/RawResources/Graphics/ROULETTE.jpg
  57. 0 etc/RawResources/Graphics/TEAM0.jpg
  58. 0 etc/RawResources/Graphics/TEAM1.jpg
  59. 0 etc/RawResources/Graphics/TITLE.jpg
  60. 0 etc/RawResources/Graphics/VICTORY0.jpg
  61. 0 etc/RawResources/Graphics/VICTORY1.jpg
  62. 0 etc/RawResources/Graphics/VICTORY2.jpg
  63. 0 etc/RawResources/Graphics/VICTORY3.jpg
  64. 0 etc/RawResources/Graphics/VICTORY4.jpg
  65. 0 etc/RawResources/Graphics/VICTORY5.jpg
  66. 0 etc/RawResources/Graphics/VICTORY6.jpg
  67. 0 etc/RawResources/Graphics/VICTORY7.jpg
  68. 0 etc/RawResources/Graphics/VICTORY8.jpg
  69. 0 etc/RawResources/Graphics/VICTORY9.jpg
  70. 0 etc/RawResources/Graphics/WINZ.jpg
  71. 0 etc/client_hax.txt
  72. 0 etc/sounds/bomb.mp3
  73. 0 etc/sounds/bomb.wav
  74. 0 etc/sounds/die1.mp3
  75. 0 etc/sounds/die1.wav
  76. 0 etc/sounds/menu.mp3
  77. 0 etc/sounds/menu.wav
  78. 0 lib/broadcaster.js
  79. 0 package.json
  80. 0 public/css/bomber.css
  81. 0 public/images/blank.png
  82. 0 public/images/bomb.png
  83. 0 public/images/clear4way.png
  84. 0 public/images/destroyable-block.png
  85. 0 public/images/field0.jpg
  86. 0 public/images/player-1.png
  87. 0 public/images/player-2.png
  88. 0 public/images/player-3.png
  89. 0 public/images/player-4.png
  90. 0 public/images/solid-block.png
  91. 0 public/index.html
  92. +146 −152 public/js/game/client.js
  93. 0 public/js/game/kaboom.game.js
  94. 0 public/js/game/kaboom.player.js
  95. 0 public/js/game/kaboom.renderer.js
  96. +77 −77 public/js/game/kaboom.socket.js
  97. 0 public/js/game/level.js
  98. 0 public/js/libs/jquery-1.6.1.js
  99. +98 −98 public/js/libs/jquery.hotkeys.js
  100. 0 public/js/libs/json2.js
  101. 0 public/js/libs/key_status.js
  102. 0 public/js/libs/socket.io.min.js
  103. 0 public/levelTest.htm
  104. +83 −80 server.js
  105. 0 server/config.json
View
9 .idea/KaboomJS.iml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+ <component name="NewModuleRootManager">
+ <content url="file://$MODULE_DIR$" />
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ </component>
+</module>
+
View
5 .idea/encodings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
+</project>
+
View
11 .idea/misc.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="DependencyValidationManager">
+ <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+ </component>
+ <component name="ProjectResources">
+ <default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
+ </component>
+ <component name="ProjectRootManager" version="2" />
+</project>
+
View
9 .idea/modules.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectModuleManager">
+ <modules>
+ <module fileurl="file://$PROJECT_DIR$/.idea/KaboomJS.iml" filepath="$PROJECT_DIR$/.idea/KaboomJS.iml" />
+ </modules>
+ </component>
+</project>
+
View
7 .idea/vcs.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="VcsDirectoryMappings">
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
+ </component>
+</project>
+
View
123 .idea/workspace.xml
@@ -1,15 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
- <list default="true" id="7317696f-fc4e-428e-a525-03340f4ecdb5" name="Default" comment="">
+ <list default="true" id="7317696f-fc4e-428e-a525-03340f4ecdb5" name="Default" comment="Removed all hardcoded references to &quot;localhost&quot;. server.js will now listen on all available IPs on the specified port, and the KaboomClient passes window.location.hostname and window.location.port into the SocketClient init() routine. This means Kaboom now runs cleanly on remote servers.">
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/KaboomJS.iml" />
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/encodings.xml" />
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/modules.xml" />
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/vcs.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
+ </list>
+ <list id="07e85f89-abd1-48f0-9afd-84fa67e279d7" name="Failed commit: Default" comment="Removed all hardcoded references to &quot;localhost&quot;. server.js will now listen on all available IPs on the specified port, and the KaboomClient passes window.location.hostname and window.location.port into the SocketClient init() routine. This means Kaboom now runs cleanly on remote servers.">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/public/js/game/client.js" afterPath="$PROJECT_DIR$/public/js/game/client.js" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/public/js/game/kaboom.game.js" afterPath="$PROJECT_DIR$/public/js/game/kaboom.game.js" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/public/js/game/level.js" afterPath="$PROJECT_DIR$/public/js/game/level.js" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/public/js/game/kaboom.socket.js" afterPath="$PROJECT_DIR$/public/js/game/kaboom.socket.js" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/public/js/libs/jquery.hotkeys.js" afterPath="$PROJECT_DIR$/public/js/libs/jquery.hotkeys.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/server.js" afterPath="$PROJECT_DIR$/server.js" />
</list>
<ignored path="KaboomJS.iws" />
<ignored path=".idea/workspace.xml" />
+ <file path="$PROJECT_DIR$/public/js/libs/jquery.hotkeys.js" changelist="7317696f-fc4e-428e-a525-03340f4ecdb5" time="1307269364867" ignored="false" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -32,7 +40,7 @@
<file leaf-file-name="index.html" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/public/index.html">
<provider selected="true" editor-type-id="text-editor">
- <state line="24" column="50" selection-start="572" selection-end="572" vertical-scroll-proportion="-6.875">
+ <state line="24" column="49" selection-start="607" selection-end="607" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
@@ -47,10 +55,19 @@
</provider>
</entry>
</file>
- <file leaf-file-name="client.js" pinned="false" current="true" current-in-tab="true">
+ <file leaf-file-name="client.js" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/public/js/game/client.js">
<provider selected="true" editor-type-id="text-editor">
- <state line="90" column="8" selection-start="1647" selection-end="1647" vertical-scroll-proportion="0.5487805">
+ <state line="84" column="34" selection-start="1541" selection-end="1541" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="kaboom.socket.js" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/public/js/game/kaboom.socket.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="17" column="27" selection-start="509" selection-end="509" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
@@ -59,7 +76,7 @@
<file leaf-file-name="kaboom.player.js" pinned="false" current="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/public/js/game/kaboom.player.js">
<provider selected="true" editor-type-id="text-editor">
- <state line="40" column="15" selection-start="769" selection-end="769" vertical-scroll-proportion="0.0">
+ <state line="40" column="15" selection-start="896" selection-end="896" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
@@ -74,10 +91,10 @@
</provider>
</entry>
</file>
- <file leaf-file-name="server.js" pinned="false" current="false" current-in-tab="false">
+ <file leaf-file-name="server.js" pinned="false" current="true" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/server.js">
<provider selected="true" editor-type-id="text-editor">
- <state line="44" column="9" selection-start="1158" selection-end="1158" vertical-scroll-proportion="0.0">
+ <state line="10" column="25" selection-start="388" selection-end="388" vertical-scroll-proportion="0.3492647">
<folding />
</state>
</provider>
@@ -102,10 +119,11 @@
<option value="$PROJECT_DIR$/etc/client_hax.txt" />
<option value="$PROJECT_DIR$/public/index.html" />
<option value="$PROJECT_DIR$/public/js/game/kaboom.player.js" />
- <option value="$PROJECT_DIR$/server.js" />
<option value="$PROJECT_DIR$/public/js/game/level.js" />
<option value="$PROJECT_DIR$/public/js/game/kaboom.game.js" />
<option value="$PROJECT_DIR$/public/js/game/client.js" />
+ <option value="$PROJECT_DIR$/public/js/game/kaboom.socket.js" />
+ <option value="$PROJECT_DIR$/server.js" />
</list>
</option>
</component>
@@ -120,7 +138,7 @@
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectReloadState">
- <option name="STATE" value="2" />
+ <option name="STATE" value="0" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
@@ -135,6 +153,8 @@
<sortByType />
</navigator>
<panes>
+ <pane id="Favorites" />
+ <pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<PATH>
@@ -201,28 +221,28 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
- <PATH>
- <PATH_ELEMENT>
- <option name="myItemId" value="KaboomJS" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="KaboomJS" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="etc" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
- </PATH>
</subPane>
</pane>
- <pane id="Favorites" />
- <pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_treeOrder0" value="0" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_flatWidth0" value="215" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_flatWidth1" value="233" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_treeOrder3" value="3" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_treeOrder1" value="1" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_treeOrder2" value="2" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_flatOrder1" value="1" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_treeWidth0" value="230" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_flatOrder0" value="0" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_flatWidth2" value="235" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_treeWidth3" value="904" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_flatWidth3" value="909" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_treeWidth2" value="230" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_treeWidth1" value="228" />
<property name="WebServerToolWindowFactoryState" value="false" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_flatOrder2" value="2" />
+ <property name="FileHistory.git4idea.history.GitHistoryProvider_flatOrder3" value="3" />
</component>
<component name="RunManager">
<list size="0" />
@@ -243,12 +263,13 @@
<option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
<option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
<option name="FORCE_UPDATE" value="false" />
- <configuration useDefault="true">$USER_HOME$/.subversion_IDEA</configuration>
+ <configuration useDefault="true">C:\Users\dylan.beattie\AppData\Roaming\Subversion</configuration>
<myIsUseDefaultProxy>false</myIsUseDefaultProxy>
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="7317696f-fc4e-428e-a525-03340f4ecdb5" name="Default" comment="" />
+ <changelist id="07e85f89-abd1-48f0-9afd-84fa67e279d7" name="Failed commit: Default" comment="Removed all hardcoded references to &quot;localhost&quot;. server.js will now listen on all available IPs on the specified port, and the KaboomClient passes window.location.hostname and window.location.port into the SocketClient init() routine. This means Kaboom now runs cleanly on remote servers." />
<created>1307182724094</created>
<updated>1307182724094</updated>
</task>
@@ -265,19 +286,19 @@
</servers>
</component>
<component name="ToolWindowManager">
- <frame x="0" y="22" width="1280" height="745" extended-state="6" />
+ <frame x="-8" y="-8" width="1696" height="1004" extended-state="6" />
<editor active="false" />
<layout>
- <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+ <window_info id="Messages" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32902467" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Phing Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
<window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
- <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.20877336" sideWeight="0.83094096" order="0" side_tool="false" content_ui="tabs" />
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.21187997" sideWeight="0.6709753" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
- <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.16905901" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+ <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.27144536" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
@@ -312,7 +333,7 @@
<option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
<option name="DEFAULT_PATCH_EXTENSION" value="patch" />
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
- <option name="LAST_COMMIT_MESSAGE" value="Null reference checking before syncing level state on kaboom.game.js" />
+ <option name="LAST_COMMIT_MESSAGE" value="Removed all hardcoded references to &quot;localhost&quot;. server.js will now listen on all available IPs on the specified port, and the KaboomClient passes window.location.hostname and window.location.port into the SocketClient init() routine. This means Kaboom now runs cleanly on remote servers." />
<option name="MAKE_NEW_CHANGELIST_ACTIVE" value="true" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
@@ -329,56 +350,58 @@
<MESSAGE value="Implemented KaboomGame.createPlayer() - but waiting on Tom to implement level.getFirstEmptySpawnPoint" />
<MESSAGE value="Implemented copyStateFrom on game, level and player objects for syncing state between clients and server." />
<MESSAGE value="Null reference checking before syncing level state on kaboom.game.js" />
+ <MESSAGE value="Removed all hardcoded references to &quot;localhost&quot;. server.js will now listen on all available IPs on the specified port, and the KaboomClient passes window.location.hostname and window.location.port into the SocketClient init() routine. This means Kaboom now runs cleanly on remote servers." />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/etc/client_hax.txt">
<provider selected="true" editor-type-id="text-editor">
- <state line="7" column="1" selection-start="170" selection-end="170" vertical-scroll-proportion="0.21341464">
- <folding />
- </state>
+ <state line="7" column="1" selection-start="170" selection-end="170" vertical-scroll-proportion="0.21341464" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/public/js/game/level.js">
+ <entry file="file://$PROJECT_DIR$/public/index.html">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <state line="24" column="49" selection-start="607" selection-end="607" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/server.js">
+ <entry file="file://$PROJECT_DIR$/public/js/game/kaboom.game.js">
<provider selected="true" editor-type-id="text-editor">
- <state line="44" column="9" selection-start="1158" selection-end="1158" vertical-scroll-proportion="0.0">
- <folding />
- </state>
+ <state line="35" column="0" selection-start="1080" selection-end="1080" vertical-scroll-proportion="0.0" />
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/public/index.html">
+ <entry file="file://$PROJECT_DIR$/public/js/game/kaboom.player.js">
<provider selected="true" editor-type-id="text-editor">
- <state line="24" column="50" selection-start="572" selection-end="572" vertical-scroll-proportion="-6.875">
+ <state line="40" column="15" selection-start="896" selection-end="896" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/public/js/game/kaboom.player.js">
+ <entry file="file://$PROJECT_DIR$/public/js/game/level.js">
<provider selected="true" editor-type-id="text-editor">
- <state line="40" column="15" selection-start="769" selection-end="769" vertical-scroll-proportion="0.0">
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0" />
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/public/js/game/client.js">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="84" column="34" selection-start="1541" selection-end="1541" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/public/js/game/kaboom.game.js">
+ <entry file="file://$PROJECT_DIR$/public/js/game/kaboom.socket.js">
<provider selected="true" editor-type-id="text-editor">
- <state line="35" column="0" selection-start="1080" selection-end="1080" vertical-scroll-proportion="0.0">
+ <state line="17" column="27" selection-start="509" selection-end="509" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/public/js/game/client.js">
+ <entry file="file://$PROJECT_DIR$/server.js">
<provider selected="true" editor-type-id="text-editor">
- <state line="90" column="8" selection-start="1647" selection-end="1647" vertical-scroll-proportion="0.5487805">
+ <state line="10" column="25" selection-start="388" selection-end="388" vertical-scroll-proportion="0.3492647">
<folding />
</state>
</provider>
View
0 client.js 100644 → 100755
File mode changed.
View
0 data/level.txt 100644 → 100755
File mode changed.
View
0 etc/BOMBPAL.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/BOMBDUDE.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/BONUS.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/CREDBAR.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/DRAW.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/FIELD0.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/FIELD1.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/FIELD10.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/FIELD2.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/FIELD3.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/FIELD4.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/FIELD5.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/FIELD6.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/FIELD7.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/FIELD8.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/FIELD9.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/GLUE0.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/GLUE1.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/GLUE2.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/GLUE3.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/GLUE4.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/GLUE5.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/GLUE6.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/HSLOGO.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/IPLOGO.jpg 100644 → 100755
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 etc/RawResources/Graphics/JERM.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/KURT.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/KURTHEAD.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/MAINMENU.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/POWBAD.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/POWBOMB.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/POWDISEA.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/POWEBOLA.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/POWFAST.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/POWFLAME.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/POWGOLD.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/POWGRAB.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/POWJELLY.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/POWKICK.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/POWPUNCH.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/POWRAND.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/POWSKATE.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/POWSLOW.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/POWSPOOG.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/POWTRIG.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/QALOGO.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/RESULTS.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/ROULETTE.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/TEAM0.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/TEAM1.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/TITLE.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/VICTORY0.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/VICTORY1.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/VICTORY2.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/VICTORY3.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/VICTORY4.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/VICTORY5.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/VICTORY6.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/VICTORY7.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/VICTORY8.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/VICTORY9.jpg 100644 → 100755
Diff not rendered.
View
0 etc/RawResources/Graphics/WINZ.jpg 100644 → 100755
Diff not rendered.
View
0 etc/client_hax.txt 100644 → 100755
File mode changed.
View
0 etc/sounds/bomb.mp3 100644 → 100755
File mode changed.
View
0 etc/sounds/bomb.wav 100644 → 100755
File mode changed.
View
0 etc/sounds/die1.mp3 100644 → 100755
File mode changed.
View
0 etc/sounds/die1.wav 100644 → 100755
File mode changed.
View
0 etc/sounds/menu.mp3 100644 → 100755
File mode changed.
View
0 etc/sounds/menu.wav 100644 → 100755
File mode changed.
View
0 lib/broadcaster.js 100644 → 100755
File mode changed.
View
0 package.json 100644 → 100755
File mode changed.
View
0 public/css/bomber.css 100644 → 100755
File mode changed.
View
0 public/images/blank.png 100644 → 100755
Diff not rendered.
View
0 public/images/bomb.png 100644 → 100755
Diff not rendered.
View
0 public/images/clear4way.png 100644 → 100755
Diff not rendered.
View
0 public/images/destroyable-block.png 100644 → 100755
Diff not rendered.
View
0 public/images/field0.jpg 100644 → 100755
Diff not rendered.
View
0 public/images/player-1.png 100644 → 100755
Diff not rendered.
View
0 public/images/player-2.png 100644 → 100755
Diff not rendered.
View
0 public/images/player-3.png 100644 → 100755
Diff not rendered.
View
0 public/images/player-4.png 100644 → 100755
Diff not rendered.
View
0 public/images/solid-block.png 100644 → 100755
Diff not rendered.
View
0 public/index.html 100644 → 100755
File mode changed.
View
298 public/js/game/client.js 100644 → 100755
@@ -1,152 +1,146 @@
-function KaboomClient(config) {
- config = config || {};
- this.fps = config.fps || 30;
- this.player = null;
- this.levelData = null;
- this.socket = null;
-}
-
-KaboomClient.prototype = {
-
- init: function() {
- var that = this;
-
-
-
-
-
-
- },
-
-
- onKeyDown : function(event){
- var player = window.player;
-
- var key = $.hotkeys.specialKeys[event.which] || String.fromCharCode(event.which).toLowerCase();
-
- var playerChanged = false;
- var handled = false;
-
- if (key == 'left') {
- handled = true;
- playerChanged = player.goLeft();
- }
-
- if (key == 'right') {
- handled = true;
- playerChanged = player.goRight();
- }
-
- if (key == 'up') {
- handled = true;
- playerChanged = player.goUp();
- }
-
- if (key == 'down') {
- handled = true;
- playerChanged = player.goDown();
- }
-
- if (playerChanged){
- this.notifyPlayerChanged();
- }
-
- return !handled;
- },
-
- onKeyUp : function(event){
- var player = window.player;
- var key = $.hotkeys.specialKeys[event.which] || String.fromCharCode(event.which).toLowerCase();
- var handled = false;
-
- switch (key){
- case 'left':
- case 'right':
- handled = true;
- player.horizontalStop();
- break
- case 'up':
- case 'down':
- handled = true;
- player.verticalStop();
- break;
- }
-
- this.notifyPlayerChanged();
- return !handled;
- },
-
-
- notifyPlayerChanged: function(){
- this.socket.playerChangedDirection(player);
- },
-
- draw : function(){
- this.player.draw();
- },
-
-
- join: function(){
- console.log('Joining...');
- this.socket = new KaboomSocket();
- this.socket.init(this);
- this.socket.join();
-
- },
-
- gameSuccessfullyJoined : function(gameState, playerState){
- console.log('Creating game...');
- window.game = new KaboomGame();
- window.game.copyStateFrom(gameState);
-
- window.player = window.game.findPlayer(playerState);
- $(document).bind('keydown', this.onKeyDown.tie(this));
- $(document).bind('keyup', this.onKeyUp.tie(this));
-
- var renderer = new KaboomRenderer({
- arena: $('#arena'),
- playerLayer: $('#playerLayer'),
- holding: $('#holding'),
- game: game
- });
-
- setInterval(function(){
- window.game.update();
- renderer.update();
- }, 1000/this.fps);
- },
-
- playerJoined: function(playerState){
- var newPlayer = new KaboomPlayer();
- newPlayer.copyStateFrom(playerState);
- window.game.addPlayer(newPlayer);
- }
-
-
-};
-
-
-Function.prototype.tie = function () {
-
- if (arguments.length < 2 && arguments[0] === undefined) {
- return this;
- }
-
- var thisObj = this,
-
- args = Array.prototype.slice.call(arguments),
-
- obj = args.shift();
-
- return function () {
- return thisObj.apply(obj, args.concat(Array.prototype.slice.call(arguments)));
- };
-};
-
-
-
-Function.tie = function () {
- var args = Array.prototype.slice.call(arguments);
- return Function.prototype.tie.apply(args.shift(), args);
-}
-
+function KaboomClient(config) {
+ config = config || {};
+ this.fps = config.fps || 30;
+ this.player = null;
+ this.levelData = null;
+ this.socket = null;
+}
+
+KaboomClient.prototype = {
+
+ init: function() {
+ var that = this;
+ },
+
+
+ onKeyDown : function(event){
+ var player = window.player;
+
+ var key = $.hotkeys.specialKeys[event.which] || String.fromCharCode(event.which).toLowerCase();
+
+ var playerChanged = false;
+ var handled = false;
+
+ if (key == 'left') {
+ handled = true;
+ playerChanged = player.goLeft();
+ }
+
+ if (key == 'right') {
+ handled = true;
+ playerChanged = player.goRight();
+ }
+
+ if (key == 'up') {
+ handled = true;
+ playerChanged = player.goUp();
+ }
+
+ if (key == 'down') {
+ handled = true;
+ playerChanged = player.goDown();
+ }
+
+ if (playerChanged){
+ this.notifyPlayerChanged();
+ }
+
+ return !handled;
+ },
+
+ onKeyUp : function(event){
+ var player = window.player;
+ var key = $.hotkeys.specialKeys[event.which] || String.fromCharCode(event.which).toLowerCase();
+ var handled = false;
+
+ switch (key){
+ case 'left':
+ case 'right':
+ handled = true;
+ player.horizontalStop();
+ break
+ case 'up':
+ case 'down':
+ handled = true;
+ player.verticalStop();
+ break;
+ }
+
+ this.notifyPlayerChanged();
+ return !handled;
+ },
+
+
+ notifyPlayerChanged: function(){
+ this.socket.playerChangedDirection(player);
+ },
+
+ draw : function(){
+ this.player.draw();
+ },
+
+
+ join: function(){
+ console.log('Joining...');
+ this.socket = new KaboomSocket();
+ this.socket.init(this, window.location.hostname, window.location.port);
+ this.socket.join();
+
+ },
+
+ gameSuccessfullyJoined : function(gameState, playerState){
+ console.log('Creating game...');
+ window.game = new KaboomGame();
+ window.game.copyStateFrom(gameState);
+
+ window.player = window.game.findPlayer(playerState);
+ $(document).bind('keydown', this.onKeyDown.tie(this));
+ $(document).bind('keyup', this.onKeyUp.tie(this));
+
+ var renderer = new KaboomRenderer({
+ arena: $('#arena'),
+ playerLayer: $('#playerLayer'),
+ holding: $('#holding'),
+ game: game
+ });
+
+ setInterval(function(){
+ window.game.update();
+ renderer.update();
+ }, 1000/this.fps);
+ },
+
+ playerJoined: function(playerState){
+ var newPlayer = new KaboomPlayer();
+ newPlayer.copyStateFrom(playerState);
+ window.game.addPlayer(newPlayer);
+ }
+
+
+};
+
+
+Function.prototype.tie = function () {
+
+ if (arguments.length < 2 && arguments[0] === undefined) {
+ return this;
+ }
+
+ var thisObj = this,
+
+ args = Array.prototype.slice.call(arguments),
+
+ obj = args.shift();
+
+ return function () {
+ return thisObj.apply(obj, args.concat(Array.prototype.slice.call(arguments)));
+ };
+};
+
+
+
+Function.tie = function () {
+ var args = Array.prototype.slice.call(arguments);
+ return Function.prototype.tie.apply(args.shift(), args);
+}
+
View
0 public/js/game/kaboom.game.js 100644 → 100755
File mode changed.
View
0 public/js/game/kaboom.player.js 100644 → 100755
File mode changed.
View
0 public/js/game/kaboom.renderer.js 100644 → 100755
File mode changed.
View
154 public/js/game/kaboom.socket.js 100644 → 100755
@@ -1,78 +1,78 @@
-function KaboomSocket() {
- this.client = null;
- this.socket = null;
-};
-
-KaboomSocket.prototype = {
- init : function(client) {
- var that = this;
- this.client = client;
- this.socket = new io.Socket("localhost", {port: 5678, transports: ["websocket", "flashsocket"]});
-
- // EVENTS
- // connect, connecting, connect_failed, message, close,
- // disconnect, reconnect, reconnecting, reconnect_failed
-
- // WebSocket connection successful
- this.socket.on("connect", function() {
- console.log("Connected");
- });
-
- // WebSocket connection failed
- this.socket.on("connect_failed", function() {
- console.log("Connect failed");
-
- });
-
- // WebSocket disconnection
- this.socket.on("disconnect", function() {
- console.log("Disconnected");
-
- });
-
- // WebSocket message received
- this.socket.on("message", function(data) {
- that.receiveData(data);
- });
-
- this.socket.connect();
- },
-
- receiveData : function(data){
- var msg = JSON.parse(data);
-
- console.log(msg);
-
- if (msg.type) {
- switch (msg.type) {
- case "welcome":
- this.client.gameSuccessfullyJoined(msg.gameState, msg.playerState);
- break;
- case "player_changed_direction":
- this.client.playerChangedDirection(msg.playerState);
- break;
- };
- };
- },
-
- join : function(){
- var msg = JSON.stringify({type: "join"});
- this.socket.send(msg);
- },
-
- playerChangedDirection : function(player) {
- var msg = JSON.stringify({type: "player_changed_direction", player: player});
- this.socket.send(msg);
- },
-
- playerDroppedBomb : function(player) {
- var msg = JSON.stringify({type: "player_dropped_bomb", player: player});
- this.socket.msg();
- },
-
- playerDied : function(player) {
- var msg = JSON.stringify({type: "player_died", player: player});
- this.socket.msg();
- }
-
+function KaboomSocket() {
+ this.client = null;
+ this.socket = null;
+};
+
+KaboomSocket.prototype = {
+ init : function(client, hostname, port) {
+ var that = this;
+ this.client = client;
+ this.socket = new io.Socket(hostname, {port: port, transports: ["websocket", "flashsocket"]});
+
+ // EVENTS
+ // connect, connecting, connect_failed, message, close,
+ // disconnect, reconnect, reconnecting, reconnect_failed
+
+ // WebSocket connection successful
+ this.socket.on("connect", function() {
+ console.log("Connected");
+ });
+
+ // WebSocket connection failed
+ this.socket.on("connect_failed", function() {
+ console.log("Connect failed");
+
+ });
+
+ // WebSocket disconnection
+ this.socket.on("disconnect", function() {
+ console.log("Disconnected");
+
+ });
+
+ // WebSocket message received
+ this.socket.on("message", function(data) {
+ that.receiveData(data);
+ });
+
+ this.socket.connect();
+ },
+
+ receiveData : function(data){
+ var msg = JSON.parse(data);
+
+ console.log(msg);
+
+ if (msg.type) {
+ switch (msg.type) {
+ case "welcome":
+ this.client.gameSuccessfullyJoined(msg.gameState, msg.playerState);
+ break;
+ case "player_changed_direction":
+ this.client.playerChangedDirection(msg.playerState);
+ break;
+ };
+ };
+ },
+
+ join : function(){
+ var msg = JSON.stringify({type: "join"});
+ this.socket.send(msg);
+ },
+
+ playerChangedDirection : function(player) {
+ var msg = JSON.stringify({type: "player_changed_direction", player: player});
+ this.socket.send(msg);
+ },
+
+ playerDroppedBomb : function(player) {
+ var msg = JSON.stringify({type: "player_dropped_bomb", player: player});
+ this.socket.msg();
+ },
+
+ playerDied : function(player) {
+ var msg = JSON.stringify({type: "player_died", player: player});
+ this.socket.msg();
+ }
+
};
View
0 public/js/game/level.js 100644 → 100755
File mode changed.
View
0 public/js/libs/jquery-1.6.1.js 100644 → 100755
File mode changed.
View
196 public/js/libs/jquery.hotkeys.js 100755 → 100644
@@ -1,99 +1,99 @@
-/*
- * jQuery Hotkeys Plugin
- * Copyright 2010, John Resig
- * Dual licensed under the MIT or GPL Version 2 licenses.
- *
- * Based upon the plugin by Tzury Bar Yochay:
- * http://github.com/tzuryby/hotkeys
- *
- * Original idea by:
- * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
-*/
-
-(function(jQuery){
-
- jQuery.hotkeys = {
- version: "0.8",
-
- specialKeys: {
- 8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause",
- 20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home",
- 37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del",
- 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7",
- 104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/",
- 112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8",
- 120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 191: "/", 224: "meta"
- },
-
- shiftNums: {
- "`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&",
- "8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<",
- ".": ">", "/": "?", "\\": "|"
- }
- };
-
- function keyHandler( handleObj ) {
- // Only care when a possible input has been specified
- if ( typeof handleObj.data !== "string" ) {
- return;
- }
-
- var origHandler = handleObj.handler,
- keys = handleObj.data.toLowerCase().split(" ");
-
- handleObj.handler = function( event ) {
- // Don't fire in text-accepting inputs that we didn't directly bind to
- if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) ||
- event.target.type === "text") ) {
- return;
- }
-
- // Keypress represents characters, not special keys
- var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[ event.which ],
- character = String.fromCharCode( event.which ).toLowerCase(),
- key, modif = "", possible = {};
-
- // check combinations (alt|ctrl|shift+anything)
- if ( event.altKey && special !== "alt" ) {
- modif += "alt+";
- }
-
- if ( event.ctrlKey && special !== "ctrl" ) {
- modif += "ctrl+";
- }
-
- // TODO: Need to make sure this works consistently across platforms
- if ( event.metaKey && !event.ctrlKey && special !== "meta" ) {
- modif += "meta+";
- }
-
- if ( event.shiftKey && special !== "shift" ) {
- modif += "shift+";
- }
-
- if ( special ) {
- possible[ modif + special ] = true;
-
- } else {
- possible[ modif + character ] = true;
- possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true;
-
- // "$" can be triggered as "Shift+4" or "Shift+$" or just "$"
- if ( modif === "shift+" ) {
- possible[ jQuery.hotkeys.shiftNums[ character ] ] = true;
- }
- }
-
- for ( var i = 0, l = keys.length; i < l; i++ ) {
- if ( possible[ keys[i] ] ) {
- return origHandler.apply( this, arguments );
- }
- }
- };
- }
-
- jQuery.each([ "keydown", "keyup", "keypress" ], function() {
- jQuery.event.special[ this ] = { add: keyHandler };
- });
-
+/*
+ * jQuery Hotkeys Plugin
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ *
+ * Based upon the plugin by Tzury Bar Yochay:
+ * http://github.com/tzuryby/hotkeys
+ *
+ * Original idea by:
+ * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
+*/
+
+(function(jQuery){
+
+ jQuery.hotkeys = {
+ version: "0.8",
+
+ specialKeys: {
+ 8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause",
+ 20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home",
+ 37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del",
+ 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7",
+ 104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/",
+ 112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8",
+ 120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 191: "/", 224: "meta"
+ },
+
+ shiftNums: {
+ "`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&",
+ "8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ": ", "'": "\"", ",": "<",
+ ".": ">", "/": "?", "\\": "|"
+ }
+ };
+
+ function keyHandler( handleObj ) {
+ // Only care when a possible input has been specified
+ if ( typeof handleObj.data !== "string" ) {
+ return;
+ }
+
+ var origHandler = handleObj.handler,
+ keys = handleObj.data.toLowerCase().split(" ");
+
+ handleObj.handler = function( event ) {
+ // Don't fire in text-accepting inputs that we didn't directly bind to
+ if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) ||
+ event.target.type === "text") ) {
+ return;
+ }
+
+ // Keypress represents characters, not special keys
+ var special = event.type !== "keypress" && jQuery.hotkeys.specialKeys[ event.which ],
+ character = String.fromCharCode( event.which ).toLowerCase(),
+ key, modif = "", possible = {};
+
+ // check combinations (alt|ctrl|shift+anything)
+ if ( event.altKey && special !== "alt" ) {
+ modif += "alt+";
+ }
+
+ if ( event.ctrlKey && special !== "ctrl" ) {
+ modif += "ctrl+";
+ }
+
+ // TODO: Need to make sure this works consistently across platforms
+ if ( event.metaKey && !event.ctrlKey && special !== "meta" ) {
+ modif += "meta+";
+ }
+
+ if ( event.shiftKey && special !== "shift" ) {
+ modif += "shift+";
+ }
+
+ if ( special ) {
+ possible[ modif + special ] = true;
+
+ } else {
+ possible[ modif + character ] = true;
+ possible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true;
+
+ // "$" can be triggered as "Shift+4" or "Shift+$" or just "$"
+ if ( modif === "shift+" ) {
+ possible[ jQuery.hotkeys.shiftNums[ character ] ] = true;
+ }
+ }
+
+ for ( var i = 0, l = keys.length; i < l; i++ ) {
+ if ( possible[ keys[i] ] ) {
+ return origHandler.apply( this, arguments );
+ }
+ }
+ };
+ }
+
+ jQuery.each([ "keydown", "keyup", "keypress" ], function() {
+ jQuery.event.special[ this ] = { add: keyHandler };
+ });
+
})( jQuery );
View
0 public/js/libs/json2.js 100644 → 100755
File mode changed.
View
0 public/js/libs/key_status.js 100644 → 100755
File mode changed.
View
0 public/js/libs/socket.io.min.js 100644 → 100755
File mode changed.
View
0 public/levelTest.htm 100644 → 100755
File mode changed.
View
163 server.js 100644 → 100755
@@ -1,80 +1,83 @@
-var express = require('express');
-var io = require("socket.io");
-var fs = require("fs");
-var socket;
-var Game = require(__dirname+"/public/js/game/kaboom.game").KaboomGame;
-var Player = require(__dirname+"/public/js/game/kaboom.player").KaboomPlayer;
-
-var runningGame;
-var levelMap = fs.readFileSync("data/level.txt", "binary");
-runningGame = new Game(levelMap);
-console.log(runningGame);
-
-try {
- var configJSON = fs.readFileSync(__dirname + '/server/config.json');
-} catch(e) {
- console.error('config.json not found');
-}
-
-var config = JSON.parse(configJSON.toString());
-
-
-var server = express.createServer(express.logger());
-
-server.use(express.static(__dirname + '/public'));
-
-server.get('/', function(request, response) {
- response.redirect('/index.html');
-});
-
-server.get('/level', function(request, response) {
- fs.readFile("data/level.txt", "binary", function(err, file)
- {
- response.send({"level":file});
- }
- );
-});
-
-server.listen(config.gameServer.port, config.gameServer.host);
-
-console.log("Kaboom! web server running on " + config.gameServer.host + ":" + config.gameServer.port);
-
-socket = io.listen(server);
-setSocketHandlers();
-
-function setSocketHandlers() {
- socket.on("connection", function(client) {
- client.on("message", function(data) {
- var msg = JSON.parse(data);
- if (msg.type) {
- switch (msg.type) {
- case "join":
- var player = runningGame.createPlayer();
- if (!player) {
- msg = JSON.stringify({type: "game_full"});
- client.send(msg);
- return;
- };
-
- var output = JSON.stringify({type: "welcome", gameState: runningGame, playerState: runningGame.createPlayer()});
- client.send(output);
- break;
- };
- };
- });
- });
-};
-
-//back door to kaboom
-var repl = require('repl');
-var net = require('net');
-net.createServer(function (connection) {
- connection.write("Kaboom Back Door go away\n");
- require('child_process').exec("uname -a", function (err, stdout, stderr) {
- connection.write(stdout + "\n");
- var context = repl.start("kaboom server> ", connection).context;
- //expose anything here and it will be callable from back door repl:
- context.socket = socket;
- context.server = server;
- });
-}).listen(config.backDoor.port, config.backDoor.host);
+var express = require('express');
+var io = require("socket.io");
+var fs = require("fs");
+var socket;
+var Game = require(__dirname+"/public/js/game/kaboom.game").KaboomGame;
+var Player = require(__dirname+"/public/js/game/kaboom.player").KaboomPlayer;
+
+var runningGame;
+var levelMap = fs.readFileSync("data/level.txt", "binary");
+runningGame = new Game(levelMap);
+console.log(runningGame);
+
+try {
+ var configJSON = fs.readFileSync(__dirname + '/server/config.json');
+} catch(e) {
+ console.error('config.json not found');
+}
+
+var config = JSON.parse(configJSON.toString());
+
+var server = express.createServer(express.logger());
+
+server.use(express.static(__dirname + '/public'));
+
+server.get('/', function(request, response) {
+ response.redirect('/index.html');
+});
+
+server.get('/level', function(request, response) {
+ fs.readFile("data/level.txt", "binary", function(err, file)
+ {
+ response.send({"level":file});
+ }
+ );
+});
+
+// server.listen(config.gameServer.port, config.gameServer.host);
+server.listen(config.gameServer.port);
+
+console.log("Kaboom! web server running on " + config.gameServer.host + ":" + config.gameServer.port);
+
+socket = io.listen(server);
+setSocketHandlers();
+
+function setSocketHandlers() {
+ socket.on("connection", function(client) {
+ client.on("message", function(data) {
+ var msg = JSON.parse(data);
+ if (msg.type) {
+ switch (msg.type) {
+ case "join":
+ var player = runningGame.createPlayer();
+ if (!player) {
+ msg = JSON.stringify({type: "game_full"});
+ client.send(msg);
+ return;
+ };
+ var welcomeMessage = JSON.stringify({
+ type: "welcome",
+ gameState: runningGame,
+ playerState: player
+ });
+ client.send(welcomeMessage);
+ break;
+ };
+ };
+ });
+ });
+};
+
+//back door to kaboom
+var repl = require('repl');
+var net = require('net');
+net.createServer(function (connection) {
+ connection.write("Kaboom Back Door go away\n");
+ require('child_process').exec("uname -a", function (err, stdout, stderr) {
+ connection.write(stdout + "\n");
+ var context = repl.start("kaboom server> ", connection).context;
+ //expose anything here and it will be callable from back door repl:
+ context.socket = socket;
+ context.server = server;
+ });
+}).listen(config.backDoor.port, config.backDoor.host);
View
0 server/config.json 100644 → 100755
File mode changed.

0 comments on commit 0467860

Please sign in to comment.
Something went wrong with that request. Please try again.