diff --git a/millennium-legacy/.classpath b/millennium-legacy/.classpath old mode 100755 new mode 100644 index 91ee9a5..63b7e89 --- a/millennium-legacy/.classpath +++ b/millennium-legacy/.classpath @@ -1,6 +1,6 @@ - + diff --git a/millennium-legacy/.project b/millennium-legacy/.project old mode 100755 new mode 100644 index 9afda82..93f81b3 --- a/millennium-legacy/.project +++ b/millennium-legacy/.project @@ -1,6 +1,6 @@ - millennium-legacy + EYSnotBroken diff --git a/millennium-legacy/.settings/org.eclipse.jdt.core.prefs b/millennium-legacy/.settings/org.eclipse.jdt.core.prefs old mode 100755 new mode 100644 index 838bd9d..bb35fa0 --- a/millennium-legacy/.settings/org.eclipse.jdt.core.prefs +++ b/millennium-legacy/.settings/org.eclipse.jdt.core.prefs @@ -1,11 +1,11 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +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.7 +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/millennium-legacy/README.md b/millennium-legacy/README.md old mode 100755 new mode 100644 diff --git a/millennium-legacy/WorldGenerator.exe b/millennium-legacy/WorldGenerator.exe new file mode 100644 index 0000000..3b7645f Binary files /dev/null and b/millennium-legacy/WorldGenerator.exe differ diff --git a/millennium-legacy/bin/map.txt b/millennium-legacy/bin/map.txt new file mode 100644 index 0000000..ec336db --- /dev/null +++ b/millennium-legacy/bin/map.txt @@ -0,0 +1,16 @@ +ggggggggggggggggggggggg +wwwwwwwwwwwwwwwwwwwwwww +ggggggggggggggggggggggg +wwwwwwwwwwwwwwwwwwwwwww +ggggggggggggggggggggggg +wwwwwwwwwwwwwwwwwwwwwww +ggggggggggggggggggggggg +wwwwwwwwwwwwwwwwwwwwwww +ggggggggggggggggggggggg +wwwwwwwwwwwwwwwwwwwwwww +ggggggggggggggggggggggg +wwwwwwwwwwwwwwwwwwwwwww +ggggggggggggggggggggggg +wwwwwwwwwwwwwwwwwwwwwww +ggggggggggggggggggggggg +wwwwwwwwwwwwwwwwwwwwwww diff --git a/millennium-legacy/bin/milleniumlegacy/Algorithm.class b/millennium-legacy/bin/milleniumlegacy/Algorithm.class old mode 100755 new mode 100644 index f1fde3d..b1c7c3e Binary files a/millennium-legacy/bin/milleniumlegacy/Algorithm.class and b/millennium-legacy/bin/milleniumlegacy/Algorithm.class differ diff --git a/millennium-legacy/bin/milleniumlegacy/Animation.class b/millennium-legacy/bin/milleniumlegacy/Animation.class new file mode 100644 index 0000000..2987c62 Binary files /dev/null and b/millennium-legacy/bin/milleniumlegacy/Animation.class differ diff --git a/millennium-legacy/bin/milleniumlegacy/Button.class b/millennium-legacy/bin/milleniumlegacy/Button.class new file mode 100644 index 0000000..6d02747 Binary files /dev/null and b/millennium-legacy/bin/milleniumlegacy/Button.class differ diff --git a/millennium-legacy/bin/milleniumlegacy/ClanHandler.class b/millennium-legacy/bin/milleniumlegacy/ClanHandler.class new file mode 100644 index 0000000..878b807 Binary files /dev/null and b/millennium-legacy/bin/milleniumlegacy/ClanHandler.class differ diff --git a/millennium-legacy/bin/milleniumlegacy/GUI$1.class b/millennium-legacy/bin/milleniumlegacy/GUI$1.class old mode 100755 new mode 100644 index f10639b..9dcb9c2 Binary files a/millennium-legacy/bin/milleniumlegacy/GUI$1.class and b/millennium-legacy/bin/milleniumlegacy/GUI$1.class differ diff --git a/millennium-legacy/bin/milleniumlegacy/GUI.class b/millennium-legacy/bin/milleniumlegacy/GUI.class old mode 100755 new mode 100644 index a1d1acb..a910ac7 Binary files a/millennium-legacy/bin/milleniumlegacy/GUI.class and b/millennium-legacy/bin/milleniumlegacy/GUI.class differ diff --git a/millennium-legacy/bin/milleniumlegacy/ImageHandler.class b/millennium-legacy/bin/milleniumlegacy/ImageHandler.class new file mode 100644 index 0000000..5538cd0 Binary files /dev/null and b/millennium-legacy/bin/milleniumlegacy/ImageHandler.class differ diff --git a/millennium-legacy/bin/milleniumlegacy/ImageLoader.class b/millennium-legacy/bin/milleniumlegacy/ImageLoader.class old mode 100755 new mode 100644 index ac69542..60717b9 Binary files a/millennium-legacy/bin/milleniumlegacy/ImageLoader.class and b/millennium-legacy/bin/milleniumlegacy/ImageLoader.class differ diff --git a/millennium-legacy/bin/milleniumlegacy/Inventory.class b/millennium-legacy/bin/milleniumlegacy/Inventory.class new file mode 100644 index 0000000..752d8a4 Binary files /dev/null and b/millennium-legacy/bin/milleniumlegacy/Inventory.class differ diff --git a/millennium-legacy/bin/milleniumlegacy/Item.class b/millennium-legacy/bin/milleniumlegacy/Item.class old mode 100755 new mode 100644 index fc5ddb1..0673b34 Binary files a/millennium-legacy/bin/milleniumlegacy/Item.class and b/millennium-legacy/bin/milleniumlegacy/Item.class differ diff --git a/millennium-legacy/bin/milleniumlegacy/KeyManager.class b/millennium-legacy/bin/milleniumlegacy/KeyManager.class old mode 100755 new mode 100644 index 000f31b..4bb5852 Binary files a/millennium-legacy/bin/milleniumlegacy/KeyManager.class and b/millennium-legacy/bin/milleniumlegacy/KeyManager.class differ diff --git a/millennium-legacy/bin/milleniumlegacy/MainGame.class b/millennium-legacy/bin/milleniumlegacy/MainGame.class index 4957374..841e205 100644 Binary files a/millennium-legacy/bin/milleniumlegacy/MainGame.class and b/millennium-legacy/bin/milleniumlegacy/MainGame.class differ diff --git a/millennium-legacy/bin/milleniumlegacy/Map.class b/millennium-legacy/bin/milleniumlegacy/Map.class index 2d8e14c..8292fbc 100644 Binary files a/millennium-legacy/bin/milleniumlegacy/Map.class and b/millennium-legacy/bin/milleniumlegacy/Map.class differ diff --git a/millennium-legacy/bin/milleniumlegacy/MapLoader.class b/millennium-legacy/bin/milleniumlegacy/MapLoader.class old mode 100755 new mode 100644 index 4f394d2..e4e05c5 Binary files a/millennium-legacy/bin/milleniumlegacy/MapLoader.class and b/millennium-legacy/bin/milleniumlegacy/MapLoader.class differ diff --git a/millennium-legacy/bin/milleniumlegacy/MouseManager.class b/millennium-legacy/bin/milleniumlegacy/MouseManager.class new file mode 100644 index 0000000..74670f0 Binary files /dev/null and b/millennium-legacy/bin/milleniumlegacy/MouseManager.class differ diff --git a/millennium-legacy/bin/milleniumlegacy/OptionsPane.class b/millennium-legacy/bin/milleniumlegacy/OptionsPane.class old mode 100755 new mode 100644 index a0532c6..cab53bc Binary files a/millennium-legacy/bin/milleniumlegacy/OptionsPane.class and b/millennium-legacy/bin/milleniumlegacy/OptionsPane.class differ diff --git a/millennium-legacy/bin/milleniumlegacy/Research.class b/millennium-legacy/bin/milleniumlegacy/Research.class new file mode 100644 index 0000000..30ee42b Binary files /dev/null and b/millennium-legacy/bin/milleniumlegacy/Research.class differ diff --git a/millennium-legacy/bin/milleniumlegacy/SolidTile.class b/millennium-legacy/bin/milleniumlegacy/SolidTile.class new file mode 100644 index 0000000..14ff38a Binary files /dev/null and b/millennium-legacy/bin/milleniumlegacy/SolidTile.class differ diff --git a/millennium-legacy/bin/milleniumlegacy/Tile.class b/millennium-legacy/bin/milleniumlegacy/Tile.class index 6387dfe..509aaac 100644 Binary files a/millennium-legacy/bin/milleniumlegacy/Tile.class and b/millennium-legacy/bin/milleniumlegacy/Tile.class differ diff --git a/millennium-legacy/bin/milleniumlegacy/player.class b/millennium-legacy/bin/milleniumlegacy/player.class index e1d4af0..aa3f341 100644 Binary files a/millennium-legacy/bin/milleniumlegacy/player.class and b/millennium-legacy/bin/milleniumlegacy/player.class differ diff --git a/millennium-legacy/milleniumWorld.txt b/millennium-legacy/milleniumWorld.txt new file mode 100644 index 0000000..ff044b2 --- /dev/null +++ b/millennium-legacy/milleniumWorld.txt @@ -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-------------------------------------------------------------- diff --git a/millennium-legacy/resources/gui/hotbar.png b/millennium-legacy/resources/gui/hotbar.png new file mode 100644 index 0000000..8bda1af Binary files /dev/null and b/millennium-legacy/resources/gui/hotbar.png differ diff --git a/millennium-legacy/resources/gui/research.png b/millennium-legacy/resources/gui/research.png new file mode 100644 index 0000000..c5a5d94 Binary files /dev/null and b/millennium-legacy/resources/gui/research.png differ diff --git a/millennium-legacy/resources/sprites/arsenic.png b/millennium-legacy/resources/sprites/arsenic.png new file mode 100644 index 0000000..192212f Binary files /dev/null and b/millennium-legacy/resources/sprites/arsenic.png differ diff --git a/millennium-legacy/resources/sprites/city.png b/millennium-legacy/resources/sprites/city.png new file mode 100644 index 0000000..23a00f1 Binary files /dev/null and b/millennium-legacy/resources/sprites/city.png differ diff --git a/millennium-legacy/resources/sprites/clay.png b/millennium-legacy/resources/sprites/clay.png new file mode 100644 index 0000000..79b21ac Binary files /dev/null and b/millennium-legacy/resources/sprites/clay.png differ diff --git a/millennium-legacy/resources/sprites/dirt.png b/millennium-legacy/resources/sprites/dirt.png new file mode 100644 index 0000000..f7d08e9 Binary files /dev/null and b/millennium-legacy/resources/sprites/dirt.png differ diff --git a/millennium-legacy/resources/sprites/electricity.png b/millennium-legacy/resources/sprites/electricity.png new file mode 100644 index 0000000..87bc6e2 Binary files /dev/null and b/millennium-legacy/resources/sprites/electricity.png differ diff --git a/millennium-legacy/resources/sprites/fire.png b/millennium-legacy/resources/sprites/fire.png new file mode 100644 index 0000000..b49efbe Binary files /dev/null and b/millennium-legacy/resources/sprites/fire.png differ diff --git a/millennium-legacy/resources/sprites/flower.png b/millennium-legacy/resources/sprites/flower.png new file mode 100644 index 0000000..d7a9a9b Binary files /dev/null and b/millennium-legacy/resources/sprites/flower.png differ diff --git a/millennium-legacy/resources/sprites/food.png b/millennium-legacy/resources/sprites/food.png new file mode 100644 index 0000000..3ef1d8f Binary files /dev/null and b/millennium-legacy/resources/sprites/food.png differ diff --git a/millennium-legacy/resources/sprites/fridge.png b/millennium-legacy/resources/sprites/fridge.png new file mode 100644 index 0000000..dea18dc Binary files /dev/null and b/millennium-legacy/resources/sprites/fridge.png differ diff --git a/millennium-legacy/resources/sprites/garden.png b/millennium-legacy/resources/sprites/garden.png new file mode 100644 index 0000000..6df7037 Binary files /dev/null and b/millennium-legacy/resources/sprites/garden.png differ diff --git a/millennium-legacy/resources/sprites/house.png b/millennium-legacy/resources/sprites/house.png new file mode 100644 index 0000000..1ba31b8 Binary files /dev/null and b/millennium-legacy/resources/sprites/house.png differ diff --git a/millennium-legacy/resources/sprites/ice.png b/millennium-legacy/resources/sprites/ice.png new file mode 100644 index 0000000..8ce77cb Binary files /dev/null and b/millennium-legacy/resources/sprites/ice.png differ diff --git a/millennium-legacy/resources/sprites/iron.png b/millennium-legacy/resources/sprites/iron.png new file mode 100644 index 0000000..5f1dce0 Binary files /dev/null and b/millennium-legacy/resources/sprites/iron.png differ diff --git a/millennium-legacy/resources/sprites/metal.png b/millennium-legacy/resources/sprites/metal.png new file mode 100644 index 0000000..5f1dce0 Binary files /dev/null and b/millennium-legacy/resources/sprites/metal.png differ diff --git a/millennium-legacy/resources/sprites/plant.png b/millennium-legacy/resources/sprites/plant.png new file mode 100644 index 0000000..b35d83c Binary files /dev/null and b/millennium-legacy/resources/sprites/plant.png differ diff --git a/millennium-legacy/resources/sprites/plastic.png b/millennium-legacy/resources/sprites/plastic.png new file mode 100644 index 0000000..5d985c4 Binary files /dev/null and b/millennium-legacy/resources/sprites/plastic.png differ diff --git a/millennium-legacy/resources/sprites/player.png b/millennium-legacy/resources/sprites/player.png old mode 100755 new mode 100644 diff --git a/millennium-legacy/resources/sprites/quantumcomputer.png b/millennium-legacy/resources/sprites/quantumcomputer.png new file mode 100644 index 0000000..00901ef Binary files /dev/null and b/millennium-legacy/resources/sprites/quantumcomputer.png differ diff --git a/millennium-legacy/resources/sprites/suburb.png b/millennium-legacy/resources/sprites/suburb.png new file mode 100644 index 0000000..1ba31b8 Binary files /dev/null and b/millennium-legacy/resources/sprites/suburb.png differ diff --git a/millennium-legacy/resources/sprites/sugar.png b/millennium-legacy/resources/sprites/sugar.png new file mode 100644 index 0000000..832d9bb Binary files /dev/null and b/millennium-legacy/resources/sprites/sugar.png differ diff --git a/millennium-legacy/resources/sprites/supercomputer.png b/millennium-legacy/resources/sprites/supercomputer.png new file mode 100644 index 0000000..2427497 Binary files /dev/null and b/millennium-legacy/resources/sprites/supercomputer.png differ diff --git a/millennium-legacy/resources/sprites/timemachine.png b/millennium-legacy/resources/sprites/timemachine.png new file mode 100644 index 0000000..096e850 Binary files /dev/null and b/millennium-legacy/resources/sprites/timemachine.png differ diff --git a/millennium-legacy/resources/sprites/water.png b/millennium-legacy/resources/sprites/water.png new file mode 100644 index 0000000..9113f2b Binary files /dev/null and b/millennium-legacy/resources/sprites/water.png differ diff --git a/millennium-legacy/resources/textures/Water0.png b/millennium-legacy/resources/textures/Water0.png new file mode 100644 index 0000000..bc7e5ed Binary files /dev/null and b/millennium-legacy/resources/textures/Water0.png differ diff --git a/millennium-legacy/resources/textures/Water1.png b/millennium-legacy/resources/textures/Water1.png new file mode 100644 index 0000000..f425551 Binary files /dev/null and b/millennium-legacy/resources/textures/Water1.png differ diff --git a/millennium-legacy/resources/textures/Water2.png b/millennium-legacy/resources/textures/Water2.png new file mode 100644 index 0000000..ffeb77d Binary files /dev/null and b/millennium-legacy/resources/textures/Water2.png differ diff --git a/millennium-legacy/resources/textures/Water3.png b/millennium-legacy/resources/textures/Water3.png new file mode 100644 index 0000000..f6d0176 Binary files /dev/null and b/millennium-legacy/resources/textures/Water3.png differ diff --git a/millennium-legacy/resources/textures/Water4.png b/millennium-legacy/resources/textures/Water4.png new file mode 100644 index 0000000..5f3871b Binary files /dev/null and b/millennium-legacy/resources/textures/Water4.png differ diff --git a/millennium-legacy/resources/textures/Water5.png b/millennium-legacy/resources/textures/Water5.png new file mode 100644 index 0000000..d34df02 Binary files /dev/null and b/millennium-legacy/resources/textures/Water5.png differ diff --git a/millennium-legacy/resources/textures/Water6.png b/millennium-legacy/resources/textures/Water6.png new file mode 100644 index 0000000..b7b9b2c Binary files /dev/null and b/millennium-legacy/resources/textures/Water6.png differ diff --git a/millennium-legacy/resources/textures/Water7.png b/millennium-legacy/resources/textures/Water7.png new file mode 100644 index 0000000..ad4e476 Binary files /dev/null and b/millennium-legacy/resources/textures/Water7.png differ diff --git a/millennium-legacy/resources/textures/Water8.png b/millennium-legacy/resources/textures/Water8.png new file mode 100644 index 0000000..4d86a70 Binary files /dev/null and b/millennium-legacy/resources/textures/Water8.png differ diff --git a/millennium-legacy/resources/textures/Water9.png b/millennium-legacy/resources/textures/Water9.png new file mode 100644 index 0000000..853b3ab Binary files /dev/null and b/millennium-legacy/resources/textures/Water9.png differ diff --git a/millennium-legacy/resources/textures/clay.png b/millennium-legacy/resources/textures/clay.png index e195705..906b902 100644 Binary files a/millennium-legacy/resources/textures/clay.png and b/millennium-legacy/resources/textures/clay.png differ diff --git a/millennium-legacy/resources/textures/grass.png b/millennium-legacy/resources/textures/grass.png old mode 100755 new mode 100644 index ae1fab0..0cc019d Binary files a/millennium-legacy/resources/textures/grass.png and b/millennium-legacy/resources/textures/grass.png differ diff --git a/millennium-legacy/resources/textures/gravel.png b/millennium-legacy/resources/textures/gravel.png new file mode 100644 index 0000000..96cd75d Binary files /dev/null and b/millennium-legacy/resources/textures/gravel.png differ diff --git a/millennium-legacy/resources/textures/rock.png b/millennium-legacy/resources/textures/rock.png new file mode 100644 index 0000000..1bc95b9 Binary files /dev/null and b/millennium-legacy/resources/textures/rock.png differ diff --git a/millennium-legacy/resources/textures/water.gif b/millennium-legacy/resources/textures/water.gif new file mode 100644 index 0000000..75b4f01 Binary files /dev/null and b/millennium-legacy/resources/textures/water.gif differ diff --git a/millennium-legacy/src/map.txt b/millennium-legacy/src/map.txt new file mode 100644 index 0000000..ec336db --- /dev/null +++ b/millennium-legacy/src/map.txt @@ -0,0 +1,16 @@ +ggggggggggggggggggggggg +wwwwwwwwwwwwwwwwwwwwwww +ggggggggggggggggggggggg +wwwwwwwwwwwwwwwwwwwwwww +ggggggggggggggggggggggg +wwwwwwwwwwwwwwwwwwwwwww +ggggggggggggggggggggggg +wwwwwwwwwwwwwwwwwwwwwww +ggggggggggggggggggggggg +wwwwwwwwwwwwwwwwwwwwwww +ggggggggggggggggggggggg +wwwwwwwwwwwwwwwwwwwwwww +ggggggggggggggggggggggg +wwwwwwwwwwwwwwwwwwwwwww +ggggggggggggggggggggggg +wwwwwwwwwwwwwwwwwwwwwww diff --git a/millennium-legacy/src/milleniumlegacy/Algorithm.java b/millennium-legacy/src/milleniumlegacy/Algorithm.java old mode 100755 new mode 100644 index b5f58ea..8a7eda2 --- a/millennium-legacy/src/milleniumlegacy/Algorithm.java +++ b/millennium-legacy/src/milleniumlegacy/Algorithm.java @@ -1,35 +1,60 @@ package milleniumlegacy; +public class Algorithm +{ -public class Algorithm { - - public static String research() { - String[] pSelect1 = Item.items.get(1); //1 = player input - String[] pSelect2 = Item.items.get(2); //2 = second player input + public static void research(int pSelect1, int pSelect2) + { Object[] keyArray = Item.items.keySet().toArray(); - String Num1 = pSelect1[0]; - String Num2 = pSelect2[0]; - String Name1 = pSelect1[1]; - String Name2 = pSelect2[1]; - String TP1 = pSelect1[2]; - String TP2 = pSelect2[2]; - for(int i = 1; i <= keyArray.length;i++) { - String[] Craftable = Item.items.get(i); - String Craft1 = Craftable[4]; - String Craft2 = Craftable[5]; - /*if ((Craft1.equals(Name1) || Craft2.equals(Name2)) && - (Craft1.equals(Name2) || Craft2.equals(Name1))) { - String[] getNewItem = Item.items.get(i); - //TODO - - }*/ + 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; + } + + } } - int rand = (int)(Math.random() * (100)); - int Prob = rand; - - return Name2; - } - + } } diff --git a/millennium-legacy/src/milleniumlegacy/Animation.java b/millennium-legacy/src/milleniumlegacy/Animation.java new file mode 100644 index 0000000..803ab8e --- /dev/null +++ b/millennium-legacy/src/milleniumlegacy/Animation.java @@ -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; + } +} diff --git a/millennium-legacy/src/milleniumlegacy/Button.java b/millennium-legacy/src/milleniumlegacy/Button.java new file mode 100644 index 0000000..b1db116 --- /dev/null +++ b/millennium-legacy/src/milleniumlegacy/Button.java @@ -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); + } +} diff --git a/millennium-legacy/src/milleniumlegacy/ClanHandler.java b/millennium-legacy/src/milleniumlegacy/ClanHandler.java new file mode 100644 index 0000000..589be20 --- /dev/null +++ b/millennium-legacy/src/milleniumlegacy/ClanHandler.java @@ -0,0 +1,5 @@ +package milleniumlegacy; + +public class ClanHandler { + +} diff --git a/millennium-legacy/src/milleniumlegacy/GUI.java b/millennium-legacy/src/milleniumlegacy/GUI.java old mode 100755 new mode 100644 index 0f9af06..c69deb5 --- a/millennium-legacy/src/milleniumlegacy/GUI.java +++ b/millennium-legacy/src/milleniumlegacy/GUI.java @@ -1,19 +1,23 @@ package milleniumlegacy; -import java.awt.Component; -import java.awt.Graphics; -import java.util.HashMap; +import java.io.IOException; -import javax.imageio.ImageIO; -import javax.swing.*; +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) { - - Algorithm.research(); - + try + { + Process process = new ProcessBuilder("WorldGenerator.exe","","").start(); + } + catch (IOException e) + { + e.printStackTrace(); + } SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); @@ -23,7 +27,7 @@ public class GUI { } public static void createAndShowGUI() { - JFrame f = new JFrame("Millenium Legacy"); + f = new JFrame("Millenium Legacy"); MainGame draw = new MainGame(); f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); f.getContentPane().add(draw); diff --git a/millennium-legacy/src/milleniumlegacy/ImageHandler.java b/millennium-legacy/src/milleniumlegacy/ImageHandler.java new file mode 100644 index 0000000..b9639ab --- /dev/null +++ b/millennium-legacy/src/milleniumlegacy/ImageHandler.java @@ -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]; + } +} diff --git a/millennium-legacy/src/milleniumlegacy/ImageLoader.java b/millennium-legacy/src/milleniumlegacy/ImageLoader.java index 9940d2b..b1c0e9e 100644 --- a/millennium-legacy/src/milleniumlegacy/ImageLoader.java +++ b/millennium-legacy/src/milleniumlegacy/ImageLoader.java @@ -11,7 +11,7 @@ public class ImageLoader public BufferedImage loadImage (String path) { try { - BufferedImage bi = ImageIO.read(new FileInputStream("resources/sprites/player.png")); + BufferedImage bi = ImageIO.read(new FileInputStream(path)); return bi; } catch (IOException e) { System.out.println("Error loading Image"); diff --git a/millennium-legacy/src/milleniumlegacy/Inventory.java b/millennium-legacy/src/milleniumlegacy/Inventory.java index b374fb2..56a8e1e 100644 --- a/millennium-legacy/src/milleniumlegacy/Inventory.java +++ b/millennium-legacy/src/milleniumlegacy/Inventory.java @@ -1,16 +1,89 @@ package milleniumlegacy; -import java.util.HashMap; +import java.awt.Color; +import java.awt.Graphics; +import java.util.Hashtable; + public class Inventory { - public static final HashMap items; + + public static final Hashtable inventory; + public static boolean shouldRender = true; static { //Putting items - items = new HashMap(); - items.put(1, new String[] {"1","Dirt", "Universal",null,null,null}); - items.put(2, new String[] {"2","Water","Universal",null,null,null}); - items.put(3, new String[] {"3","Clay","Medieval", "99","Dirt","Water"}); + inventory = new Hashtable(); + } + 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); + } + } + } + } } diff --git a/millennium-legacy/src/milleniumlegacy/Item.java b/millennium-legacy/src/milleniumlegacy/Item.java old mode 100755 new mode 100644 index c3ebfac..112768a --- a/millennium-legacy/src/milleniumlegacy/Item.java +++ b/millennium-legacy/src/milleniumlegacy/Item.java @@ -8,9 +8,33 @@ public class Item { { //Putting items items = new HashMap(); - items.put(1, new String[] {"1","Dirt", "Universal",null,null,null}); - items.put(2, new String[] {"2","Water","Universal",null,null,null}); - items.put(3, new String[] {"3","Clay","Medieval", "99","Dirt","Water"}); + 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"}); } } diff --git a/millennium-legacy/src/milleniumlegacy/KeyManager.java b/millennium-legacy/src/milleniumlegacy/KeyManager.java index 2893467..abd13a6 100644 --- a/millennium-legacy/src/milleniumlegacy/KeyManager.java +++ b/millennium-legacy/src/milleniumlegacy/KeyManager.java @@ -27,7 +27,19 @@ public class KeyManager implements KeyListener } 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; + } } } diff --git a/millennium-legacy/src/milleniumlegacy/MainGame.java b/millennium-legacy/src/milleniumlegacy/MainGame.java index 3ace88b..76c5f76 100644 --- a/millennium-legacy/src/milleniumlegacy/MainGame.java +++ b/millennium-legacy/src/milleniumlegacy/MainGame.java @@ -5,24 +5,28 @@ import java.awt.Color; import java.awt.Graphics; import java.awt.Toolkit; import java.awt.image.BufferStrategy; -import java.awt.image.BufferedImage; -import java.util.ArrayList; public class MainGame extends Canvas implements Runnable { private static final long serialVersionUID = -1902119798739765822L; - ImageLoader IL = new ImageLoader(); - KeyManager km; - player ply = new player(375, 300, IL); - ArrayList map = Map.readyMap(); - Thread main; + public static Tile[][] map = Map.readyMap(); public static boolean up, down, left, right, running; - public static int offsetx, offsety; + 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() @@ -38,32 +42,46 @@ public class MainGame extends Canvas implements Runnable g.fillRect(0, 0, Toolkit.getDefaultToolkit().getScreenSize().width, Toolkit.getDefaultToolkit().getScreenSize().height); g.setColor(Color.BLACK); - for (Tile t : map) + for (Tile[] ta : map) { - t.Render(g, offsetx, offsety); + 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() { - if (up) + ply.tick(); + if (up && offsety <= 0) { - offsety += 3; + offsety += speed; } - if (down) + if (down && offsety >= 86*-48) { - offsety -= 3; + offsety -= speed; } - if (left) + if (left && offsetx <= 0) { - offsetx += 3; + offsetx += speed; } - if (right) + if (right && offsetx >= 81*-48) { - offsetx -= 3; + offsetx -= speed; + } + if (ply.getTile() != "1") + { + speed = 5; + } + else + { + speed = 10; } } @@ -103,8 +121,6 @@ public class MainGame extends Canvas implements Runnable if (System.currentTimeMillis() - timer > 1000) { timer += 1000; - System.out.println(updates + " Ticks, Fps " + frames); - ply.getPosition(); updates = 0; frames = 0; } @@ -112,4 +128,9 @@ public class MainGame extends Canvas implements Runnable } } + + public static player getPlayer() + { + return ply; + } } diff --git a/millennium-legacy/src/milleniumlegacy/Map.java b/millennium-legacy/src/milleniumlegacy/Map.java index 1cc06cb..ef64cd3 100644 --- a/millennium-legacy/src/milleniumlegacy/Map.java +++ b/millennium-legacy/src/milleniumlegacy/Map.java @@ -4,23 +4,27 @@ import java.util.ArrayList; public class Map { + static ImageLoader IL = MainGame.IL; + static MapLoader ml = new MapLoader(); - public static ArrayList readyMap() + public static Tile[][] readyMap() { - ArrayList tiles = new ArrayList(); - char[][] map = ml.LoadMap("resources/maps/map.txt"); + Tile[][] mappp; + ArrayList> tilesy = new ArrayList>(); + ArrayList tilesx = new ArrayList(); + char[][] map = ml.LoadMap("milleniumWorld.txt"); + mappp = new Tile[map.length][map[0].length]; int countery = 0, counterx = 0; for (char[] chararr : map) { - countery++; for (char c: chararr) { + mappp[counterx][countery] = new Tile(counterx, countery, c, IL); counterx++; - System.out.println(counterx); - tiles.add(new Tile(counterx, countery, c)); } + countery++; counterx = 0; } - return tiles; + return mappp; } } diff --git a/millennium-legacy/src/milleniumlegacy/MapLoader.java b/millennium-legacy/src/milleniumlegacy/MapLoader.java old mode 100755 new mode 100644 index 9ee45d0..51ab346 --- a/millennium-legacy/src/milleniumlegacy/MapLoader.java +++ b/millennium-legacy/src/milleniumlegacy/MapLoader.java @@ -27,10 +27,8 @@ public class MapLoader { char[][] maparr = new char[lines.size()][lines.get(0).toCharArray().length]; for (int y = 0; y <= lines.size() - 1; y++) { - char[] chararr = lines.get(y).toCharArray(); for (int x = 0; x <= lines.get(0).toCharArray().length - 1; x++) { - System.out.println("X: " + x + "Y: " + y); maparr[y][x] = lines.get(y).toCharArray()[x]; } } diff --git a/millennium-legacy/src/milleniumlegacy/MouseManager.java b/millennium-legacy/src/milleniumlegacy/MouseManager.java new file mode 100644 index 0000000..d2acda4 --- /dev/null +++ b/millennium-legacy/src/milleniumlegacy/MouseManager.java @@ -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) + { + + + } + +} diff --git a/millennium-legacy/src/milleniumlegacy/OptionsPane.java b/millennium-legacy/src/milleniumlegacy/OptionsPane.java old mode 100755 new mode 100644 diff --git a/millennium-legacy/src/milleniumlegacy/Research.java b/millennium-legacy/src/milleniumlegacy/Research.java new file mode 100644 index 0000000..f7a7373 --- /dev/null +++ b/millennium-legacy/src/milleniumlegacy/Research.java @@ -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 = ""; + } + +} diff --git a/millennium-legacy/src/milleniumlegacy/SolidTile.java b/millennium-legacy/src/milleniumlegacy/SolidTile.java new file mode 100644 index 0000000..5587e37 --- /dev/null +++ b/millennium-legacy/src/milleniumlegacy/SolidTile.java @@ -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); + } + + +} diff --git a/millennium-legacy/src/milleniumlegacy/Tile.java b/millennium-legacy/src/milleniumlegacy/Tile.java index a714861..262f8c2 100644 --- a/millennium-legacy/src/milleniumlegacy/Tile.java +++ b/millennium-legacy/src/milleniumlegacy/Tile.java @@ -2,6 +2,7 @@ package milleniumlegacy; import java.awt.Color; import java.awt.Graphics; +import java.awt.image.BufferedImage; public class Tile { @@ -10,33 +11,55 @@ public class Tile boolean up, down, left, right; int offsetx; int offsety; - public Tile(int x, int y, char terrain) + 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 (terrain == 'd') + if (name.equals("2")) + { + g.drawImage(waterAnimation.animate(), x*48 + offsetx- 48, y*48 + offsety - 48, 48,48, null); + } + else if (TileImage != null) { - g.setColor(Color.GREEN); - } - else if (terrain == 'r') - { - g.setColor(Color.DARK_GRAY); - } - else if (terrain == 'c') - { - g.setColor(Color.gray); + 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); } - g.fillRect(x*32 + offsetx - 32, y*32 + offsety - 32, 32,32); String draw = "x" + x + "y" + y; - g.setColor(Color.black); - g.drawString(draw, x*32 + offsetx - 32, y*32 + 8 + offsety - 32); + g.setColor(Color.white); + //g.drawString(draw, x*48 + offsetx - 48, y*48 + 8 + offsety - 48); } } diff --git a/millennium-legacy/src/milleniumlegacy/player.java b/millennium-legacy/src/milleniumlegacy/player.java index 2b02db4..387334e 100644 --- a/millennium-legacy/src/milleniumlegacy/player.java +++ b/millennium-legacy/src/milleniumlegacy/player.java @@ -1,6 +1,7 @@ package milleniumlegacy; import java.awt.Graphics; +import java.awt.Rectangle; import java.awt.image.BufferedImage; public class player @@ -8,24 +9,35 @@ 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"); + 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 void getPosition() + public String getTile() { - int x = ((MainGame.offsetx * -1)+ drawx + 16) / 32 + 1; - int y = ((MainGame.offsety * -1) + drawy + 16) / 32 + 1; - System.out.println("X: " + x + "Y: " + y); + 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; } }