Add millennium-legacy
6
millennium-legacy/.classpath
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="src" path="src"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||||
|
<classpathentry kind="output" path="bin"/>
|
||||||
|
</classpath>
|
||||||
17
millennium-legacy/.project
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>EYSnotBroken</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
11
millennium-legacy/.settings/org.eclipse.jdt.core.prefs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
|
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||||
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.source=1.8
|
||||||
1
millennium-legacy/README.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
hi
|
||||||
BIN
millennium-legacy/WorldGenerator.exe
Normal file
16
millennium-legacy/bin/map.txt
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
ggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
ggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
ggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
ggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
ggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
ggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
ggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
ggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwww
|
||||||
BIN
millennium-legacy/bin/milleniumlegacy/Algorithm.class
Normal file
BIN
millennium-legacy/bin/milleniumlegacy/Animation.class
Normal file
BIN
millennium-legacy/bin/milleniumlegacy/Button.class
Normal file
BIN
millennium-legacy/bin/milleniumlegacy/ClanHandler.class
Normal file
BIN
millennium-legacy/bin/milleniumlegacy/GUI$1.class
Normal file
BIN
millennium-legacy/bin/milleniumlegacy/GUI.class
Normal file
BIN
millennium-legacy/bin/milleniumlegacy/ImageHandler.class
Normal file
BIN
millennium-legacy/bin/milleniumlegacy/ImageLoader.class
Normal file
BIN
millennium-legacy/bin/milleniumlegacy/Inventory.class
Normal file
BIN
millennium-legacy/bin/milleniumlegacy/Item.class
Normal file
BIN
millennium-legacy/bin/milleniumlegacy/KeyManager.class
Normal file
BIN
millennium-legacy/bin/milleniumlegacy/MainGame.class
Normal file
BIN
millennium-legacy/bin/milleniumlegacy/Map.class
Normal file
BIN
millennium-legacy/bin/milleniumlegacy/MapLoader.class
Normal file
BIN
millennium-legacy/bin/milleniumlegacy/MouseManager.class
Normal file
BIN
millennium-legacy/bin/milleniumlegacy/OptionsPane.class
Normal file
BIN
millennium-legacy/bin/milleniumlegacy/Research.class
Normal file
BIN
millennium-legacy/bin/milleniumlegacy/SolidTile.class
Normal file
BIN
millennium-legacy/bin/milleniumlegacy/Tile.class
Normal file
BIN
millennium-legacy/bin/milleniumlegacy/player.class
Normal file
100
millennium-legacy/milleniumWorld.txt
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
---------------------g-------------------------------------------------------------------------www--
|
||||||
|
---------------------rr-----------------------------------------------------------------------wwwww-
|
||||||
|
--------------------rrr---------------------www-----------------------------------------------wwwww-
|
||||||
|
--------------------rr---------------------wwwww----------rr----------------------------------wwwww-
|
||||||
|
--------------------gr---------------------wwwww----------rr-----------------------------------www--
|
||||||
|
-------------------------------------------wwwww---------grr----------------------------------------
|
||||||
|
--------------------------------------------wwwcc---------------------------------------------------
|
||||||
|
-----------------------------------------------c----------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
--------------------------------------------c-------------------------------------------------------
|
||||||
|
-------------------------------------------ccwww----------------------------------------------------
|
||||||
|
--------------------------------------------wwwww---------------------------------------------------
|
||||||
|
--------------------------------------------wwwww---------------------------------------------------
|
||||||
|
--------------------------------------------wwwww---------------------------------------------------
|
||||||
|
---------------------------------------------www----------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
-----rr---------------------------------------------------------------------------------------------
|
||||||
|
-------r--------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------c-www-------
|
||||||
|
---------------------------------------------------------------------------------------ccwwwww------
|
||||||
|
----------------------------------------------------------------------------------------cwwwww------
|
||||||
|
-----------------------------------------------------------------------------------------wwwww------
|
||||||
|
------------------------------------------------------------------------------------------www-------
|
||||||
|
---------------------------------------------g------------------------------------------------------
|
||||||
|
---------------------------------------------rr----------www----------------------------------------
|
||||||
|
----------------------------------------------rr--------wwwwwc--------------www---------------------
|
||||||
|
--------------------------------------------grr---------wwwwwcc------------wwwww--------------------
|
||||||
|
--------------------------------------------------------wwwwwc------------cwwwww--------------------
|
||||||
|
---------------------------------------------------------www-------------ccwwwww--------------------
|
||||||
|
--------------------------------------------------------------------------c-www---------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
------------------------------------------------------------------------g---------------------------
|
||||||
|
------------------------------------------------------------------------rr--------------------------
|
||||||
|
-----------------------------------------------------------------------rrg--------------------------
|
||||||
|
-----------------------------------------------------------------------grr--------------------------
|
||||||
|
---------------------------------------------rg-----------------------------------------------------
|
||||||
|
-------------------------------------------grrr-----------------------------------------------------
|
||||||
|
-------------------------------------------grr------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
------------------------------------------------------------------------------rrrg------------------
|
||||||
|
-------------------------------------------------------r----------------------rrg-------------------
|
||||||
|
-----------------------------------------------------grrr---------------------grr-------------------
|
||||||
|
-------------------------------------------rr--------grrrg------------------------------------------
|
||||||
|
-------------------------------------------rr----------g--------------------------------------------
|
||||||
|
rr-----------------------------------------rr-------------------------------------------------------
|
||||||
|
rrr----------www------------------------------------------------------------------------------------
|
||||||
|
-rg---------wwwww-----------------------------------------------------------------------------------
|
||||||
|
-g---------cwwwww-----------------------------------------------------------------------------------
|
||||||
|
----------ccwwwww-----------------------------------------------------------------------------------
|
||||||
|
-----------ccwww------------------------------------------------------------------------------------
|
||||||
|
------------c---------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------rrr---------------------------------------------------------------------------------------
|
||||||
|
----------rrr------------------rrr------------------------------------------------------------------
|
||||||
|
----------rrr-----------------wrrrw-----------------------------------------------------------------
|
||||||
|
------------g-----------------wwrrw-----------------------------------------------------------------
|
||||||
|
------------------------------wwwww-----------------------------------------------------------------
|
||||||
|
-------------------------------www------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
---------------------------------------------------c------------------------------------------------
|
||||||
|
------------------------------------------------wwwcc-----------------------------------------------
|
||||||
|
-----------------------------------------------wwwwwc-----------------------------------------------
|
||||||
|
-----------------------------------------------wwwwwcc----------------------------------------------
|
||||||
|
-----------------------------------------------wwwwwc-----------------------------------------------
|
||||||
|
------------------------------------------------www-------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
------------------c----------------------------c-------------------c--------------------------------
|
||||||
|
-----------------gcg---------g------g---------ccc-----------------ccc-------g--g----c---------------
|
||||||
|
----gwwwww-----wwwww----gwwwww----gwwwww-----wwwww-----wwwwwg---gwwwww-----wwwww---ccwwwww-----wwwww
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
wwwwwg----wwwwwg-gggwwwww-----wwwwwcc---wwwww-----wwwww----gwwwww-g---wwwwwg----wwwww-----wwwwwg----
|
||||||
|
-----------------------------------c-----------------------ccg--------------------------------------
|
||||||
|
------------------------------------------------------------c---------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
----------------------------------------------------------------------------------------------------
|
||||||
|
-----------------------------------rr---------------------------------------------------------------
|
||||||
|
-----------------------------------grr--------------------------------------------------------------
|
||||||
|
-----------------------------------rrr--------------------------------------------------------------
|
||||||
BIN
millennium-legacy/resources/gui/hotbar.png
Normal file
|
After Width: | Height: | Size: 350 B |
BIN
millennium-legacy/resources/gui/research.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
92
millennium-legacy/resources/maps/map.txt
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
|
||||||
BIN
millennium-legacy/resources/sprites/arsenic.png
Normal file
|
After Width: | Height: | Size: 417 B |
BIN
millennium-legacy/resources/sprites/city.png
Normal file
|
After Width: | Height: | Size: 678 B |
BIN
millennium-legacy/resources/sprites/clay.png
Normal file
|
After Width: | Height: | Size: 444 B |
BIN
millennium-legacy/resources/sprites/dirt.png
Normal file
|
After Width: | Height: | Size: 696 B |
BIN
millennium-legacy/resources/sprites/electricity.png
Normal file
|
After Width: | Height: | Size: 369 B |
BIN
millennium-legacy/resources/sprites/fire.png
Normal file
|
After Width: | Height: | Size: 771 B |
BIN
millennium-legacy/resources/sprites/flower.png
Normal file
|
After Width: | Height: | Size: 618 B |
BIN
millennium-legacy/resources/sprites/food.png
Normal file
|
After Width: | Height: | Size: 585 B |
BIN
millennium-legacy/resources/sprites/fridge.png
Normal file
|
After Width: | Height: | Size: 492 B |
BIN
millennium-legacy/resources/sprites/garden.png
Normal file
|
After Width: | Height: | Size: 756 B |
BIN
millennium-legacy/resources/sprites/house.png
Normal file
|
After Width: | Height: | Size: 609 B |
BIN
millennium-legacy/resources/sprites/ice.png
Normal file
|
After Width: | Height: | Size: 486 B |
BIN
millennium-legacy/resources/sprites/iron.png
Normal file
|
After Width: | Height: | Size: 624 B |
BIN
millennium-legacy/resources/sprites/metal.png
Normal file
|
After Width: | Height: | Size: 624 B |
BIN
millennium-legacy/resources/sprites/npc.png
Normal file
|
After Width: | Height: | Size: 266 B |
BIN
millennium-legacy/resources/sprites/plant.png
Normal file
|
After Width: | Height: | Size: 714 B |
BIN
millennium-legacy/resources/sprites/plastic.png
Normal file
|
After Width: | Height: | Size: 384 B |
BIN
millennium-legacy/resources/sprites/player.png
Normal file
|
After Width: | Height: | Size: 440 B |
BIN
millennium-legacy/resources/sprites/quantumcomputer.png
Normal file
|
After Width: | Height: | Size: 402 B |
BIN
millennium-legacy/resources/sprites/suburb.png
Normal file
|
After Width: | Height: | Size: 609 B |
BIN
millennium-legacy/resources/sprites/sugar.png
Normal file
|
After Width: | Height: | Size: 519 B |
BIN
millennium-legacy/resources/sprites/supercomputer.png
Normal file
|
After Width: | Height: | Size: 387 B |
BIN
millennium-legacy/resources/sprites/timemachine.png
Normal file
|
After Width: | Height: | Size: 825 B |
BIN
millennium-legacy/resources/sprites/water.png
Normal file
|
After Width: | Height: | Size: 555 B |
BIN
millennium-legacy/resources/textures/Water0.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
millennium-legacy/resources/textures/Water1.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
millennium-legacy/resources/textures/Water2.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
millennium-legacy/resources/textures/Water3.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
millennium-legacy/resources/textures/Water4.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
millennium-legacy/resources/textures/Water5.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
millennium-legacy/resources/textures/Water6.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
millennium-legacy/resources/textures/Water7.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
millennium-legacy/resources/textures/Water8.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
millennium-legacy/resources/textures/Water9.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
millennium-legacy/resources/textures/clay.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
millennium-legacy/resources/textures/grass.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
millennium-legacy/resources/textures/gravel.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
millennium-legacy/resources/textures/rock.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
millennium-legacy/resources/textures/water.gif
Normal file
|
After Width: | Height: | Size: 18 KiB |
16
millennium-legacy/src/map.txt
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
ggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
ggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
ggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
ggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
ggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
ggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
ggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwww
|
||||||
|
ggggggggggggggggggggggg
|
||||||
|
wwwwwwwwwwwwwwwwwwwwwww
|
||||||
60
millennium-legacy/src/milleniumlegacy/Algorithm.java
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
package milleniumlegacy;
|
||||||
|
|
||||||
|
public class Algorithm
|
||||||
|
{
|
||||||
|
|
||||||
|
public static void research(int pSelect1, int pSelect2)
|
||||||
|
{
|
||||||
|
Object[] keyArray = Item.items.keySet().toArray();
|
||||||
|
for (int i = 1; i <= keyArray.length; i++)
|
||||||
|
{
|
||||||
|
String[] Craftable = (String[])Item.items.get(i);
|
||||||
|
int Craft1int = Integer.parseInt(Craftable[4]);
|
||||||
|
int Craft2int = Integer.parseInt(Craftable[6]);
|
||||||
|
int rand = (int) (Math.random() * (100));
|
||||||
|
int Prob = rand;
|
||||||
|
if ((Craft1int == pSelect1 || Craft1int == pSelect2) &&
|
||||||
|
(Craft2int == pSelect1 || Craft2int == pSelect2))
|
||||||
|
{
|
||||||
|
String[] requisite = (String[]) Item.items.get(i);
|
||||||
|
int current1 = Inventory.inventory.get(pSelect1);
|
||||||
|
int current2 = Inventory.inventory.get(pSelect2);
|
||||||
|
int requisite1 = Integer.parseInt(requisite[3]);
|
||||||
|
int requisite2 = Integer.parseInt(requisite[5]);
|
||||||
|
if ((current1 >= requisite1 && current2 >= requisite2) )
|
||||||
|
{
|
||||||
|
if ((current1 -= requisite1) <= 0)
|
||||||
|
{
|
||||||
|
Inventory.inventory.remove(pSelect1);
|
||||||
|
Research.squareOffset+=2;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Inventory.inventory.put(pSelect1, current1 -= requisite1);
|
||||||
|
}
|
||||||
|
if ((current2 -= requisite2) <= 0)
|
||||||
|
{
|
||||||
|
Inventory.inventory.remove(pSelect2);
|
||||||
|
Research.squareOffset+=2;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
Inventory.inventory.put(pSelect2, current2 -= requisite2);
|
||||||
|
}
|
||||||
|
int craftability = Integer.parseInt(requisite[2]);
|
||||||
|
if (Prob <= craftability)
|
||||||
|
{
|
||||||
|
int outputnum = Integer.parseInt(requisite[7]);
|
||||||
|
Inventory.addItem(i, outputnum);
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
32
millennium-legacy/src/milleniumlegacy/Animation.java
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
package milleniumlegacy;
|
||||||
|
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
|
||||||
|
public class Animation
|
||||||
|
{
|
||||||
|
BufferedImage[] imagearray;
|
||||||
|
int[] time;
|
||||||
|
int counter;
|
||||||
|
public Animation(BufferedImage[] imagearray, int[] time)
|
||||||
|
{
|
||||||
|
this.imagearray = imagearray;
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
public Animation(BufferedImage[] imagearray)
|
||||||
|
{
|
||||||
|
this.imagearray = imagearray;
|
||||||
|
}
|
||||||
|
public BufferedImage animate()
|
||||||
|
{
|
||||||
|
if (counter < imagearray.length - 1)
|
||||||
|
{
|
||||||
|
counter++;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
counter = 0;
|
||||||
|
}
|
||||||
|
BufferedImage temp = imagearray[counter];
|
||||||
|
return temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
61
millennium-legacy/src/milleniumlegacy/Button.java
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
package milleniumlegacy;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import java.awt.Rectangle;
|
||||||
|
|
||||||
|
public class Button
|
||||||
|
{
|
||||||
|
int x,y,width,height,ButtonID;
|
||||||
|
public boolean selected1;
|
||||||
|
public Button(int x, int y, int width, int height, int ButtonID)
|
||||||
|
{
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
this.width = width;
|
||||||
|
this.height = height;
|
||||||
|
this.ButtonID = ButtonID;
|
||||||
|
}
|
||||||
|
public Rectangle getBounds()
|
||||||
|
{
|
||||||
|
return new Rectangle(x,y,width,height);
|
||||||
|
}
|
||||||
|
public void clicked(Rectangle MouseRectangle)
|
||||||
|
{
|
||||||
|
if (MouseRectangle.intersects(this.getBounds()))
|
||||||
|
{
|
||||||
|
if (!Research.selected1)
|
||||||
|
{
|
||||||
|
if (Inventory.inventory.size() >= ButtonID)
|
||||||
|
{
|
||||||
|
Research.selectionOne(Inventory.getIdFromButton(ButtonID));
|
||||||
|
selected1 =true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (Research.selected1)
|
||||||
|
{
|
||||||
|
if (Inventory.inventory.size() >= ButtonID)
|
||||||
|
{
|
||||||
|
Research.selectionTwo(Inventory.getIdFromButton(ButtonID));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public void ResearchButton(Rectangle MouseRect)
|
||||||
|
{
|
||||||
|
if (MouseRect.intersects(this.getBounds()))
|
||||||
|
{
|
||||||
|
if (Research.selected1 && Research.selected2)
|
||||||
|
{
|
||||||
|
Algorithm.research(Research.selection1, Research.selection2);
|
||||||
|
Research.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void render(Graphics g)
|
||||||
|
{
|
||||||
|
g.setColor(Color.GRAY);
|
||||||
|
g.fillRect(x,y,width,height);
|
||||||
|
}
|
||||||
|
}
|
||||||
5
millennium-legacy/src/milleniumlegacy/ClanHandler.java
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package milleniumlegacy;
|
||||||
|
|
||||||
|
public class ClanHandler {
|
||||||
|
|
||||||
|
}
|
||||||
42
millennium-legacy/src/milleniumlegacy/GUI.java
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
package milleniumlegacy;
|
||||||
|
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.SwingUtilities;
|
||||||
|
import javax.swing.WindowConstants;
|
||||||
|
|
||||||
|
public class GUI {
|
||||||
|
public static JFrame f;
|
||||||
|
public static void main(String[] args) {
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Process process = new ProcessBuilder("WorldGenerator.exe","","").start();
|
||||||
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
createAndShowGUI();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
public static void createAndShowGUI()
|
||||||
|
{
|
||||||
|
f = new JFrame("Millenium Legacy");
|
||||||
|
MainGame draw = new MainGame();
|
||||||
|
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
||||||
|
f.getContentPane().add(draw);
|
||||||
|
f.setResizable(false);
|
||||||
|
f.pack();
|
||||||
|
f.setSize(825, 625);
|
||||||
|
f.setVisible(true);
|
||||||
|
draw.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
62
millennium-legacy/src/milleniumlegacy/ImageHandler.java
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
package milleniumlegacy;
|
||||||
|
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
|
||||||
|
public class ImageHandler
|
||||||
|
{
|
||||||
|
static ImageLoader IL = new ImageLoader();
|
||||||
|
static BufferedImage[] imageArray = {
|
||||||
|
IL.loadImage("resources/sprites/dirt.png"),
|
||||||
|
IL.loadImage("resources/sprites/water.png"),
|
||||||
|
IL.loadImage("resources/sprites/clay.png"),
|
||||||
|
IL.loadImage("resources/textures/gravel.png"),
|
||||||
|
IL.loadImage("resources/textures/rock.png"),
|
||||||
|
IL.loadImage("resources/sprites/plant.png"),
|
||||||
|
IL.loadImage("resources/sprites/iron.png"),
|
||||||
|
IL.loadImage("resources/sprites/fire.png"),
|
||||||
|
IL.loadImage("resources/sprites/fridge.png"),
|
||||||
|
IL.loadImage("resources/sprites/ice.png"),
|
||||||
|
IL.loadImage("resources/sprites/fire.png"),
|
||||||
|
IL.loadImage("resources/sprites/flower.png"),
|
||||||
|
IL.loadImage("resources/sprites/garden.png"),
|
||||||
|
IL.loadImage("resources/sprites/metal.png"),
|
||||||
|
IL.loadImage("resources/sprites/plastic.png"),
|
||||||
|
IL.loadImage("resources/sprites/sugar.png"),
|
||||||
|
IL.loadImage("resources/sprites/arsenic.png"),
|
||||||
|
IL.loadImage("resources/sprites/food.png"),
|
||||||
|
IL.loadImage("resources/sprites/house.png"),
|
||||||
|
IL.loadImage("resources/sprites/suburb.png"),
|
||||||
|
IL.loadImage("resources/sprites/city.png"),
|
||||||
|
IL.loadImage("resources/sprites/garden.png"),
|
||||||
|
IL.loadImage("resources/sprites/electricity.png"),
|
||||||
|
IL.loadImage("resources/sprites/supercomputer.png"),
|
||||||
|
IL.loadImage("resources/sprites/supercomputer.png"),
|
||||||
|
IL.loadImage("resources/sprites/quantumcomputer.png"),
|
||||||
|
IL.loadImage("resources/sprites/timemachine.png")
|
||||||
|
|
||||||
|
};
|
||||||
|
static BufferedImage[] waterArray = {
|
||||||
|
IL.loadImage("resources/textures/water0.png"),
|
||||||
|
IL.loadImage("resources/textures/water1.png"),
|
||||||
|
IL.loadImage("resources/textures/water2.png"),
|
||||||
|
IL.loadImage("resources/textures/water3.png"),
|
||||||
|
IL.loadImage("resources/textures/water4.png"),
|
||||||
|
IL.loadImage("resources/textures/water5.png"),
|
||||||
|
IL.loadImage("resources/textures/water6.png"),
|
||||||
|
IL.loadImage("resources/textures/water7.png"),
|
||||||
|
IL.loadImage("resources/textures/water8.png"),
|
||||||
|
IL.loadImage("resources/textures/water9.png")
|
||||||
|
};
|
||||||
|
public static BufferedImage Grass = IL.loadImage("resources/textures/grass.png");
|
||||||
|
public static BufferedImage Gravel = IL.loadImage("resources/textures/gravel.png");
|
||||||
|
public static BufferedImage Rock = IL.loadImage("resources/textures/rock.png");
|
||||||
|
public static BufferedImage Clay = IL.loadImage("resources/textures/clay.png");
|
||||||
|
public static BufferedImage Water = IL.loadImage("resources/textures/water.gif");
|
||||||
|
public static BufferedImage Hotbar = IL.loadImage("resources/gui/hotbar.png");
|
||||||
|
public static BufferedImage researchMenu = IL.loadImage("resources/gui/research.png");
|
||||||
|
|
||||||
|
public static BufferedImage getImage(int num)
|
||||||
|
{
|
||||||
|
return imageArray[num];
|
||||||
|
}
|
||||||
|
}
|
||||||
22
millennium-legacy/src/milleniumlegacy/ImageLoader.java
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package milleniumlegacy;
|
||||||
|
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
|
||||||
|
public class ImageLoader
|
||||||
|
{
|
||||||
|
public BufferedImage loadImage (String path)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
BufferedImage bi = ImageIO.read(new FileInputStream(path));
|
||||||
|
return bi;
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.out.println("Error loading Image");
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
89
millennium-legacy/src/milleniumlegacy/Inventory.java
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
package milleniumlegacy;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import java.util.Hashtable;
|
||||||
|
|
||||||
|
|
||||||
|
public class Inventory {
|
||||||
|
|
||||||
|
public static final Hashtable<Integer, Integer> inventory;
|
||||||
|
public static boolean shouldRender = true;
|
||||||
|
static
|
||||||
|
{
|
||||||
|
//Putting items
|
||||||
|
inventory = new Hashtable<Integer, Integer>();
|
||||||
|
}
|
||||||
|
public static void addItem(int id, int amount)
|
||||||
|
{
|
||||||
|
if (inventory.containsKey(id))
|
||||||
|
{
|
||||||
|
int current = inventory.get(id);
|
||||||
|
if (current <= 998)
|
||||||
|
{
|
||||||
|
inventory.put(id, current+=1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
inventory.put(id, 999);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
inventory.put(id, amount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static int getIdFromButton(int Button)
|
||||||
|
{
|
||||||
|
int counter = 0;
|
||||||
|
if (inventory.size() >= Button)
|
||||||
|
{
|
||||||
|
for (int i = 0; i <= 100; i++)
|
||||||
|
{
|
||||||
|
if (inventory.containsKey(i))
|
||||||
|
{
|
||||||
|
counter++;
|
||||||
|
if (counter == Button)
|
||||||
|
{
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Button;
|
||||||
|
|
||||||
|
}
|
||||||
|
public static void render(Graphics g)
|
||||||
|
{
|
||||||
|
if (shouldRender)
|
||||||
|
{
|
||||||
|
g.drawImage(ImageHandler.Hotbar, 180, 548, 464, 48, null);
|
||||||
|
int offset = 0;
|
||||||
|
for (int i = 0; i <= 100; i++)
|
||||||
|
{
|
||||||
|
if (inventory.containsKey(i))
|
||||||
|
{
|
||||||
|
g.drawImage(ImageHandler.getImage(i - 1), 188 + offset, 556, 32, 32, null);
|
||||||
|
g.setColor(Color.cyan);
|
||||||
|
if (inventory.get(i) > 99)
|
||||||
|
{
|
||||||
|
g.drawString("" + inventory.get(i), 188+offset + 4, 564);
|
||||||
|
}
|
||||||
|
else if (inventory.get(i) > 9)
|
||||||
|
{
|
||||||
|
g.drawString("" + inventory.get(i), 188+offset + 8, 564);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g.drawString("" + inventory.get(i), 188+offset + 12, 564);
|
||||||
|
}
|
||||||
|
offset += (41 + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
40
millennium-legacy/src/milleniumlegacy/Item.java
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
package milleniumlegacy;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class Item {
|
||||||
|
|
||||||
|
public static final HashMap<Integer, String[]> items;
|
||||||
|
static
|
||||||
|
{
|
||||||
|
//Putting items
|
||||||
|
items = new HashMap<Integer, String[]>();
|
||||||
|
items.put(1, new String[] {"1","Dirt","0","0","0","0","0","0"});
|
||||||
|
items.put(2, new String[] {"2","Water","0","0","0","0","0","0"});
|
||||||
|
items.put(3, new String[] {"3","Clay", "99","1","1","1","2","1"});
|
||||||
|
items.put(4, new String[] {"4","Gravel", "0","0","0","0","0","0"});
|
||||||
|
items.put(5, new String[] {"5","Rock", "0","0","0","0","0","0"});
|
||||||
|
items.put(6, new String[] {"6","Plant", "90","1","1","1","4","1"});
|
||||||
|
items.put(7, new String[] {"7","Iron", "70","1","3","3","2","1"});
|
||||||
|
items.put(8, new String[] {"8","Fire", "90","1","6","2","2","1"});
|
||||||
|
items.put(9, new String[] {"9","Fridge", "50","3","8","1","7","1"});
|
||||||
|
items.put(10, new String[] {"10","Ice", "70","4","5","5","8","1"});
|
||||||
|
items.put(11, new String[] {"11","Furnace", "60","3","10","2","6","1"});
|
||||||
|
items.put(12, new String[] {"12","Flower", "80","3","7","1","6","1"});
|
||||||
|
items.put(13, new String[] {"13","Garden", "75","12","12","10","3","1"});
|
||||||
|
items.put(14, new String[] {"14","Metal", "70","4","13","1","20","50"});
|
||||||
|
items.put(15, new String[] {"15","Plastic", "60","3","14","5","2","1"});
|
||||||
|
items.put(16, new String[] {"16","Sugar", "90","2","15","7","5","10"});
|
||||||
|
items.put(17, new String[] {"17","Arsenic", "80","3","16","6","3","1"});
|
||||||
|
items.put(18, new String[] {"18","Food", "90","1","17","6","22","10"});
|
||||||
|
items.put(19, new String[] {"19","House", "90","3","10","4","8","1"});
|
||||||
|
items.put(20, new String[] {"20","Suburb", "65","30","19","3","13","1"});
|
||||||
|
items.put(21, new String[] {"21","City", "75","1","20","20","19","1"});
|
||||||
|
items.put(22, new String[] {"22","Farm", "100","5","13","25","6","1"});
|
||||||
|
items.put(23, new String[] {"23","Electricity", "90","32","18","2","7","20"});
|
||||||
|
items.put(24, new String[] {"24","Computer", "85","60","23","3","10","1"});
|
||||||
|
items.put(25, new String[] {"25","Super Computer", "90","100","24","10","21","1"});
|
||||||
|
items.put(26, new String[] {"26","Quantum Computer", "90","10","25","4","11","1"});
|
||||||
|
items.put(27, new String[] {"27","Time Machine", "30","20","26","45","8","1"});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
74
millennium-legacy/src/milleniumlegacy/KeyManager.java
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
package milleniumlegacy;
|
||||||
|
|
||||||
|
import java.awt.event.KeyEvent;
|
||||||
|
import java.awt.event.KeyListener;
|
||||||
|
|
||||||
|
public class KeyManager implements KeyListener
|
||||||
|
{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void keyPressed(KeyEvent e)
|
||||||
|
{
|
||||||
|
if (e.getKeyCode() == KeyEvent.VK_W)
|
||||||
|
{
|
||||||
|
MainGame.up = true;
|
||||||
|
}
|
||||||
|
if (e.getKeyCode() == KeyEvent.VK_S)
|
||||||
|
{
|
||||||
|
MainGame.down = true;
|
||||||
|
}
|
||||||
|
if (e.getKeyCode() == KeyEvent.VK_A)
|
||||||
|
{
|
||||||
|
MainGame.left = true;
|
||||||
|
}
|
||||||
|
if (e.getKeyCode() == KeyEvent.VK_D)
|
||||||
|
{
|
||||||
|
MainGame.right = true;
|
||||||
|
}
|
||||||
|
if (e.getKeyCode() == KeyEvent.VK_SPACE)
|
||||||
|
{
|
||||||
|
MainGame.getPlayer().Add();
|
||||||
|
}
|
||||||
|
if (e.getKeyCode() == KeyEvent.VK_R){
|
||||||
|
if (Research.shouldRender)
|
||||||
|
{
|
||||||
|
Research.shouldRender = false;
|
||||||
|
Inventory.shouldRender = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Research.shouldRender = true;
|
||||||
|
Inventory.shouldRender = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void keyReleased(KeyEvent e)
|
||||||
|
{
|
||||||
|
if (e.getKeyCode() == KeyEvent.VK_W)
|
||||||
|
{
|
||||||
|
MainGame.up = false;
|
||||||
|
}
|
||||||
|
if (e.getKeyCode() == KeyEvent.VK_S)
|
||||||
|
{
|
||||||
|
MainGame.down = false;
|
||||||
|
}
|
||||||
|
if (e.getKeyCode() == KeyEvent.VK_A)
|
||||||
|
{
|
||||||
|
MainGame.left = false;
|
||||||
|
}
|
||||||
|
if (e.getKeyCode() == KeyEvent.VK_D)
|
||||||
|
{
|
||||||
|
MainGame.right = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void keyTyped(KeyEvent arg0) {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
136
millennium-legacy/src/milleniumlegacy/MainGame.java
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
package milleniumlegacy;
|
||||||
|
|
||||||
|
import java.awt.Canvas;
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import java.awt.Toolkit;
|
||||||
|
import java.awt.image.BufferStrategy;
|
||||||
|
|
||||||
|
public class MainGame extends Canvas implements Runnable
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = -1902119798739765822L;
|
||||||
|
public static Tile[][] map = Map.readyMap();
|
||||||
|
public static boolean up, down, left, right, running;
|
||||||
|
public static int offsetx = 50 * -48, offsety = 50 * -48, speed = 10;;
|
||||||
|
static ImageLoader IL = new ImageLoader();
|
||||||
|
static player ply = new player(375, 300, IL);
|
||||||
|
KeyManager km;
|
||||||
|
MouseManager mm;
|
||||||
|
|
||||||
|
Thread main;
|
||||||
|
Research re = new Research();
|
||||||
|
|
||||||
|
|
||||||
|
public void init()
|
||||||
|
{
|
||||||
|
km = new KeyManager();
|
||||||
|
this.addKeyListener(km);
|
||||||
|
mm = new MouseManager();
|
||||||
|
this.addMouseListener(mm);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void render()
|
||||||
|
{
|
||||||
|
BufferStrategy bs = this.getBufferStrategy();
|
||||||
|
if (bs == null)
|
||||||
|
{
|
||||||
|
createBufferStrategy(3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Graphics g = bs.getDrawGraphics();
|
||||||
|
g.setColor(Color.black);
|
||||||
|
g.fillRect(0, 0, Toolkit.getDefaultToolkit().getScreenSize().width,
|
||||||
|
Toolkit.getDefaultToolkit().getScreenSize().height);
|
||||||
|
g.setColor(Color.BLACK);
|
||||||
|
for (Tile[] ta : map)
|
||||||
|
{
|
||||||
|
for (Tile t : ta)
|
||||||
|
{
|
||||||
|
t.Render(g, offsetx, offsety);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ply.render(g);
|
||||||
|
Inventory.render(g);
|
||||||
|
re.render(g);
|
||||||
|
g.dispose();
|
||||||
|
bs.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void tick()
|
||||||
|
{
|
||||||
|
ply.tick();
|
||||||
|
if (up && offsety <= 0)
|
||||||
|
{
|
||||||
|
offsety += speed;
|
||||||
|
}
|
||||||
|
if (down && offsety >= 86*-48)
|
||||||
|
{
|
||||||
|
offsety -= speed;
|
||||||
|
}
|
||||||
|
if (left && offsetx <= 0)
|
||||||
|
{
|
||||||
|
offsetx += speed;
|
||||||
|
}
|
||||||
|
if (right && offsetx >= 81*-48)
|
||||||
|
{
|
||||||
|
offsetx -= speed;
|
||||||
|
}
|
||||||
|
if (ply.getTile() != "1")
|
||||||
|
{
|
||||||
|
speed = 5;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
speed = 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void start()
|
||||||
|
{
|
||||||
|
main = new Thread(this);
|
||||||
|
main.start();
|
||||||
|
running = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
init();
|
||||||
|
long lastTime = System.nanoTime();
|
||||||
|
final double amountOfTicks = 60.0;
|
||||||
|
double ns = 1000000000 / amountOfTicks;
|
||||||
|
double delta = 0;
|
||||||
|
int updates = 0;
|
||||||
|
int frames = 0;
|
||||||
|
long timer = System.currentTimeMillis();
|
||||||
|
|
||||||
|
while (running)
|
||||||
|
{
|
||||||
|
long now = System.nanoTime();
|
||||||
|
delta += (now - lastTime) / ns;
|
||||||
|
lastTime = now;
|
||||||
|
if (delta >= 1)
|
||||||
|
{
|
||||||
|
tick();
|
||||||
|
updates++;
|
||||||
|
delta--;
|
||||||
|
}
|
||||||
|
render();
|
||||||
|
frames++;
|
||||||
|
|
||||||
|
if (System.currentTimeMillis() - timer > 1000)
|
||||||
|
{
|
||||||
|
timer += 1000;
|
||||||
|
updates = 0;
|
||||||
|
frames = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static player getPlayer()
|
||||||
|
{
|
||||||
|
return ply;
|
||||||
|
}
|
||||||
|
}
|
||||||
30
millennium-legacy/src/milleniumlegacy/Map.java
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
package milleniumlegacy;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class Map
|
||||||
|
{
|
||||||
|
static ImageLoader IL = MainGame.IL;
|
||||||
|
|
||||||
|
static MapLoader ml = new MapLoader();
|
||||||
|
public static Tile[][] readyMap()
|
||||||
|
{
|
||||||
|
Tile[][] mappp;
|
||||||
|
ArrayList<ArrayList<Tile>> tilesy = new ArrayList<ArrayList<Tile>>();
|
||||||
|
ArrayList<Tile> tilesx = new ArrayList<Tile>();
|
||||||
|
char[][] map = ml.LoadMap("milleniumWorld.txt");
|
||||||
|
mappp = new Tile[map.length][map[0].length];
|
||||||
|
int countery = 0, counterx = 0;
|
||||||
|
for (char[] chararr : map)
|
||||||
|
{
|
||||||
|
for (char c: chararr)
|
||||||
|
{
|
||||||
|
mappp[counterx][countery] = new Tile(counterx, countery, c, IL);
|
||||||
|
counterx++;
|
||||||
|
}
|
||||||
|
countery++;
|
||||||
|
counterx = 0;
|
||||||
|
}
|
||||||
|
return mappp;
|
||||||
|
}
|
||||||
|
}
|
||||||
62
millennium-legacy/src/milleniumlegacy/MapLoader.java
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
package milleniumlegacy;
|
||||||
|
|
||||||
|
import java.io.BufferedInputStream;
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class MapLoader {
|
||||||
|
|
||||||
|
public char[][] LoadMap(String path) {
|
||||||
|
ArrayList<String> lines = new ArrayList<String>();
|
||||||
|
BufferedReader br;
|
||||||
|
File map = new File(path);
|
||||||
|
|
||||||
|
try {
|
||||||
|
FileReader fr = new FileReader(map);
|
||||||
|
br = new BufferedReader(fr);
|
||||||
|
String line;
|
||||||
|
while ((line = br.readLine()) != null)
|
||||||
|
{
|
||||||
|
lines.add(line);
|
||||||
|
}
|
||||||
|
char[][] maparr = new char[lines.size()][lines.get(0).toCharArray().length];
|
||||||
|
for (int y = 0; y <= lines.size() - 1; y++)
|
||||||
|
{
|
||||||
|
for (int x = 0; x <= lines.get(0).toCharArray().length - 1; x++)
|
||||||
|
{
|
||||||
|
maparr[y][x] = lines.get(y).toCharArray()[x];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
br.close();
|
||||||
|
return maparr;
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
public static int countLines(String filename) throws IOException {
|
||||||
|
InputStream is = new BufferedInputStream(new FileInputStream(filename));
|
||||||
|
try {
|
||||||
|
byte[] c = new byte[1024];
|
||||||
|
int count = 0;
|
||||||
|
int readChars = 0;
|
||||||
|
boolean empty = true;
|
||||||
|
while ((readChars = is.read(c)) != -1) {
|
||||||
|
empty = false;
|
||||||
|
for (int i = 0; i < readChars; ++i) {
|
||||||
|
if (c[i] == '\n') {
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (count == 0 && !empty) ? 1 : count;
|
||||||
|
} finally {
|
||||||
|
is.close();
|
||||||
|
}
|
||||||
|
} // Thank you google
|
||||||
|
}
|
||||||
56
millennium-legacy/src/milleniumlegacy/MouseManager.java
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
package milleniumlegacy;
|
||||||
|
|
||||||
|
import java.awt.Rectangle;
|
||||||
|
import java.awt.event.MouseEvent;
|
||||||
|
import java.awt.event.MouseListener;
|
||||||
|
|
||||||
|
public class MouseManager implements MouseListener
|
||||||
|
{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseClicked(MouseEvent e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseEntered(MouseEvent e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseExited(MouseEvent e)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mousePressed(MouseEvent e)
|
||||||
|
{
|
||||||
|
Research.button.clicked(new Rectangle(e.getX(),e.getY(),1,1));
|
||||||
|
Research.button2.clicked(new Rectangle(e.getX(),e.getY(),1,1));
|
||||||
|
Research.button3.clicked(new Rectangle(e.getX(),e.getY(),1,1));
|
||||||
|
Research.button4.clicked(new Rectangle(e.getX(),e.getY(),1,1));
|
||||||
|
Research.button5.clicked(new Rectangle(e.getX(),e.getY(),1,1));
|
||||||
|
Research.button6.clicked(new Rectangle(e.getX(),e.getY(),1,1));
|
||||||
|
Research.button7.clicked(new Rectangle(e.getX(),e.getY(),1,1));
|
||||||
|
Research.button8.clicked(new Rectangle(e.getX(),e.getY(),1,1));
|
||||||
|
Research.button9.clicked(new Rectangle(e.getX(),e.getY(),1,1));
|
||||||
|
Research.button10.clicked(new Rectangle(e.getX(),e.getY(),1,1));
|
||||||
|
Research.rb.ResearchButton(new Rectangle(e.getX(),e.getY(),1,1));
|
||||||
|
if (Research.selected1 && !Research.button.getBounds().intersects(new Rectangle(e.getX(),e.getY(),1,1)) && !Research.button3.getBounds().intersects(new Rectangle(e.getX(),e.getY(),1,1)) && !Research.button4.getBounds().intersects(new Rectangle(e.getX(),e.getY(),1,1)) && !Research.button5.getBounds().intersects(new Rectangle(e.getX(),e.getY(),1,1)) && !Research.button6.getBounds().intersects(new Rectangle(e.getX(),e.getY(),1,1)) && !Research.button7.getBounds().intersects(new Rectangle(e.getX(),e.getY(),1,1)) && !Research.button8.getBounds().intersects(new Rectangle(e.getX(),e.getY(),1,1)) && !Research.button9.getBounds().intersects(new Rectangle(e.getX(),e.getY(),1,1)) && !Research.button2.getBounds().intersects(new Rectangle(e.getX(),e.getY(),1,1)) && !Research.button10.getBounds().intersects(new Rectangle(e.getX(),e.getY(),1,1)) )
|
||||||
|
{
|
||||||
|
Research.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseReleased(MouseEvent e)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
5
millennium-legacy/src/milleniumlegacy/OptionsPane.java
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package milleniumlegacy;
|
||||||
|
|
||||||
|
public class OptionsPane {
|
||||||
|
|
||||||
|
}
|
||||||
91
millennium-legacy/src/milleniumlegacy/Research.java
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
package milleniumlegacy;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Graphics;
|
||||||
|
|
||||||
|
public class Research
|
||||||
|
{
|
||||||
|
public static boolean shouldRender, selected1, selected2;
|
||||||
|
static int x = 80;
|
||||||
|
public static int squareOffset = 1;
|
||||||
|
static int selection1;
|
||||||
|
static int selection2;
|
||||||
|
String update = "";
|
||||||
|
static String SelectOne = "";
|
||||||
|
static String SelectTwo = "";
|
||||||
|
public static Button button = new Button(x,433,48,48, 1);
|
||||||
|
public static Button button2 = new Button(x += 69,433,48,48, 2);
|
||||||
|
public static Button button3 = new Button(x += 69,433,48,48, 3);
|
||||||
|
public static Button button4 = new Button(x += 70,433,48,48, 4);
|
||||||
|
public static Button button5 = new Button(x += 70,433,48,48, 5);
|
||||||
|
public static Button button6 = new Button(x += 70,433,48,48, 6);
|
||||||
|
public static Button button7 = new Button(x += 69,433,48,48, 7);
|
||||||
|
public static Button button8 = new Button(x += 69,433,48,48, 8);
|
||||||
|
public static Button button9 = new Button(x += 69,433,48,48, 9);
|
||||||
|
public static Button button10 = new Button(x += 70,433,48,48, 10);
|
||||||
|
public static Button rb = new Button(75, 120, 260,260, 11);
|
||||||
|
public void render(Graphics g)
|
||||||
|
{
|
||||||
|
if (shouldRender)
|
||||||
|
{
|
||||||
|
g.drawImage(ImageHandler.researchMenu, 25, 25, 775, 500, null);
|
||||||
|
int offset = 0;
|
||||||
|
button.render(g);
|
||||||
|
button2.render(g);
|
||||||
|
button3.render(g);
|
||||||
|
button4.render(g);
|
||||||
|
button5.render(g);
|
||||||
|
button6.render(g);
|
||||||
|
button7.render(g);
|
||||||
|
button8.render(g);
|
||||||
|
button9.render(g);
|
||||||
|
button10.render(g);
|
||||||
|
rb.render(g);
|
||||||
|
for (int i = 0; i <= 100; i++)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (Inventory.inventory.containsKey(i))
|
||||||
|
{
|
||||||
|
g.drawImage(ImageHandler.getImage(i - 1), 80 + offset, 433, 48, 48, null);
|
||||||
|
g.setColor(Color.WHITE);
|
||||||
|
g.drawString("Amount: " + Inventory.inventory.get(i), 80 + offset, 430);
|
||||||
|
if (offset == 0)
|
||||||
|
{
|
||||||
|
offset += 68;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
offset+=70;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
g.setColor(Color.WHITE);
|
||||||
|
g.drawString(SelectOne, 385, 180);
|
||||||
|
g.drawString(SelectTwo, 385, 300);
|
||||||
|
g.drawString("Research", 100,200);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static void selectionOne(int id)
|
||||||
|
{
|
||||||
|
selection1 = id;
|
||||||
|
selected1 = true;
|
||||||
|
SelectOne =Item.items.get(id)[1];
|
||||||
|
System.out.println(id);
|
||||||
|
}
|
||||||
|
public static void selectionTwo(int id)
|
||||||
|
{
|
||||||
|
selection2 = id;
|
||||||
|
selected2 = true;
|
||||||
|
SelectTwo =Item.items.get(id)[1];
|
||||||
|
//Algorithm.research(selection1, selection2);
|
||||||
|
}
|
||||||
|
public static void reset()
|
||||||
|
{
|
||||||
|
selected2 = false;
|
||||||
|
selected1 = false;
|
||||||
|
SelectTwo = "";
|
||||||
|
SelectOne = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
20
millennium-legacy/src/milleniumlegacy/SolidTile.java
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
package milleniumlegacy;
|
||||||
|
|
||||||
|
import java.awt.Rectangle;
|
||||||
|
|
||||||
|
public class SolidTile extends Tile
|
||||||
|
{
|
||||||
|
int x, y;
|
||||||
|
public SolidTile(int x, int y, char terrain, ImageLoader IL )
|
||||||
|
{
|
||||||
|
super(x, y, terrain, IL);
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
}
|
||||||
|
public Rectangle getBounds()
|
||||||
|
{
|
||||||
|
return new Rectangle(x * 42, y * 42, 42,42);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
65
millennium-legacy/src/milleniumlegacy/Tile.java
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
package milleniumlegacy;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
|
||||||
|
public class Tile
|
||||||
|
{
|
||||||
|
int x,y;
|
||||||
|
char terrain;
|
||||||
|
boolean up, down, left, right;
|
||||||
|
int offsetx;
|
||||||
|
int offsety;
|
||||||
|
BufferedImage TileImage;
|
||||||
|
String name;
|
||||||
|
Animation waterAnimation = new Animation(ImageHandler.waterArray);
|
||||||
|
public Tile(int x, int y, char terrain, ImageLoader IL)
|
||||||
|
{
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
this.terrain = terrain;
|
||||||
|
switch(terrain)
|
||||||
|
{
|
||||||
|
case '-':
|
||||||
|
this.name="1";
|
||||||
|
TileImage = ImageHandler.Grass;
|
||||||
|
break;
|
||||||
|
case 'w':
|
||||||
|
this.name="2"; //get water
|
||||||
|
TileImage = ImageHandler.Water;
|
||||||
|
break;
|
||||||
|
case 'r':
|
||||||
|
this.name="5";
|
||||||
|
TileImage = ImageHandler.Rock;
|
||||||
|
break;
|
||||||
|
case 'g':
|
||||||
|
this.name="4";
|
||||||
|
TileImage = ImageHandler.Gravel;
|
||||||
|
break;
|
||||||
|
case 'c':
|
||||||
|
this.name="3";
|
||||||
|
TileImage = ImageHandler.Clay;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void Render(Graphics g, int offsetx, int offsety)
|
||||||
|
{
|
||||||
|
if (name.equals("2"))
|
||||||
|
{
|
||||||
|
g.drawImage(waterAnimation.animate(), x*48 + offsetx- 48, y*48 + offsety - 48, 48,48, null);
|
||||||
|
}
|
||||||
|
else if (TileImage != null)
|
||||||
|
{
|
||||||
|
g.drawImage(TileImage, x*48 + offsetx- 48, y*48 + offsety - 48, 48,48, null);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g.setColor(Color.blue);
|
||||||
|
g.drawRect(x*48 + offsetx - 48, y*48 + offsety - 48, 48,48);
|
||||||
|
}
|
||||||
|
String draw = "x" + x + "y" + y;
|
||||||
|
g.setColor(Color.white);
|
||||||
|
//g.drawString(draw, x*48 + offsetx - 48, y*48 + 8 + offsety - 48);
|
||||||
|
}
|
||||||
|
}
|
||||||
43
millennium-legacy/src/milleniumlegacy/player.java
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package milleniumlegacy;
|
||||||
|
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import java.awt.Rectangle;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
|
||||||
|
public class player
|
||||||
|
{
|
||||||
|
int x, y;
|
||||||
|
int drawx, drawy;
|
||||||
|
BufferedImage player;
|
||||||
|
Rectangle bounds;
|
||||||
|
public player(int x, int y, ImageLoader IL)
|
||||||
|
{
|
||||||
|
this.drawx = x;
|
||||||
|
this.drawy = y;
|
||||||
|
player = IL.loadImage("resources/sprites/player.png");
|
||||||
|
}
|
||||||
|
public void tick()
|
||||||
|
{
|
||||||
|
x = ((MainGame.offsetx * -1)+ drawx);
|
||||||
|
y = ((MainGame.offsety * -1) + drawy);
|
||||||
|
bounds = new Rectangle(x - 27,y - 27, 54,54);
|
||||||
|
}
|
||||||
|
public void render(Graphics g)
|
||||||
|
{
|
||||||
|
g.drawImage(player, drawx, drawy, null);
|
||||||
|
}
|
||||||
|
public String getTile()
|
||||||
|
{
|
||||||
|
int x = ((MainGame.offsetx * -1)+ drawx + 16) / 48 + 1;
|
||||||
|
int y = ((MainGame.offsety * -1) + drawy + 16) / 48 + 1;
|
||||||
|
return MainGame.map[x][y].name;
|
||||||
|
}
|
||||||
|
public String Add()
|
||||||
|
{
|
||||||
|
int x = ((MainGame.offsetx * -1)+ drawx + 16) / 48 + 1;
|
||||||
|
int y = ((MainGame.offsety * -1) + drawy + 16) / 48 + 1;
|
||||||
|
Inventory.addItem(Integer.parseInt(MainGame.map[x][y].name), 1);
|
||||||
|
System.out.println(Inventory.inventory);
|
||||||
|
return MainGame.map[x][y].name;
|
||||||
|
}
|
||||||
|
}
|
||||||