├── .gitignore ├── .project ├── README.md ├── doc └── screenshots │ ├── bug_report.png │ ├── minesweeper1.png │ ├── minesweeper_winning.jpg │ ├── zelda.png │ ├── zelda10.png │ ├── zelda11.png │ ├── zelda12.png │ ├── zelda13.png │ ├── zelda2.png │ ├── zelda3.png │ ├── zelda5.png │ ├── zelda6.png │ ├── zelda7.png │ ├── zelda8.png │ └── zelda9.png ├── lib ├── jsoup-1.7.1.jar ├── log4j-1.2.17.jar └── opengl │ ├── x86 │ ├── README.md │ ├── gluegen-rt-natives-linux-i586.jar │ ├── gluegen-rt.jar │ ├── gluegen.jar │ ├── joal-natives-linux-i586.jar │ ├── joal.jar │ ├── jogl-all-natives-linux-i586.jar │ └── jogl-all.jar │ └── x8664 │ ├── README.md │ ├── gluegen-rt-natives-linux-amd64.jar │ ├── gluegen-rt.jar │ ├── gluegen.jar │ ├── joal-natives-linux-amd64.jar │ ├── joal.jar │ ├── jogl-all-natives-linux-amd64.jar │ └── jogl-all.jar ├── resources ├── config │ └── default.config ├── il8n │ ├── texts.properties │ ├── texts_cn.properties │ └── texts_fr.properties ├── maps │ ├── large_xml.tmx │ ├── old │ │ ├── large_base64.tmx │ │ ├── large_csv.tmx │ │ ├── start.tmx │ │ └── start2.tmx │ ├── real.tmx │ ├── real_small.tmx │ ├── simple.tmx │ ├── small.tmx │ ├── small2.tmx │ └── tiled-0.7.2 │ │ ├── CHANGES │ │ ├── COPYING │ │ ├── INSTALL │ │ ├── README │ │ ├── TODO │ │ ├── examples │ │ ├── desert.tmx │ │ ├── hexmap.tmx │ │ ├── iso-test.tmx │ │ ├── iso-test2.tmx │ │ ├── iso-test3.tmx │ │ ├── iso-test4.tmx │ │ ├── sewer_tileset.png │ │ ├── snowy_trees.tmx │ │ ├── tilebmp-test.tmx │ │ ├── tilespacing-test.tmx │ │ ├── tmw_desert_spacing.png │ │ └── water.tsx │ │ ├── plugins │ │ ├── json.jar │ │ ├── lua.jar │ │ ├── mappy.jar │ │ └── tmw.jar │ │ └── tiled.jar ├── sounds │ ├── ReadMe.md │ ├── bg │ │ ├── LoZ Oracle of Seasons Cavern.WAV │ │ ├── LoZ Oracle of Seasons Essence Obtained!.WAV │ │ ├── LoZ Oracle of Seasons GAME OVER.WAV │ │ ├── LoZ Oracle of Seasons Horon Village.WAV │ │ ├── LoZ Oracle of Seasons Intro + Title Screen.WAV │ │ ├── LoZ Oracle of Seasons Lvl 1 Gnarled Root Dungeon.WAV │ │ ├── LoZ Oracle of Seasons Lvl 2 Snake's Remains.WAV │ │ ├── LoZ Oracle of Seasons Lvl 7 Explorer's crypt.WAV │ │ ├── LoZ Oracle of Seasons Main Theme.WAV │ │ ├── LoZ Oracle of Seasons Maku Tree's theme.WAV │ │ ├── LoZ Oracle of Seasons Sacred Place.WAV │ │ └── LoZ Oracle of Seasons Tarm Ruins.WAV │ └── effects │ │ ├── OOA_Boss_Shoot.wav │ │ ├── OOA_Harp_TuneOfAges.wav │ │ ├── OOA_Harp_TuneOfCurrents.wav │ │ ├── OOA_Harp_TuneOfEchoes.wav │ │ ├── OOA_Link_Baby.wav │ │ ├── OOA_Link_BabyCrawl.wav │ │ ├── OOA_MakuTree_Weird.wav │ │ ├── OOA_MakuTree_Wisps.wav │ │ ├── OOA_Nayru_Land.wav │ │ ├── OOA_Plasmarine_Shock.wav │ │ ├── OOA_SeedShooter.wav │ │ ├── OOA_SwitchHook_Full.wav │ │ ├── OOA_SwitchHook_Loop.wav │ │ ├── OOA_SwitchHook_Switch.wav │ │ ├── OOA_TimeWarp_Begin.wav │ │ ├── OOA_TimeWarp_Finish.wav │ │ ├── OOA_Tingle_KoolooLimpah.wav │ │ ├── OOA_Tokay.wav │ │ ├── OOA_VeranBee_Swarm.wav │ │ ├── OOA_VeranTurtle_Jump.wav │ │ ├── OOA_VeranTurtle_Land.wav │ │ ├── OOA_Veran_Shapeshift.wav │ │ ├── OOA_WingDungeon_Collapse1.wav │ │ ├── OOA_WingDungeon_Collapse2.wav │ │ ├── OOA_WingDungeon_Collapse_Full.wav │ │ ├── OOS_Aquamentus_Walk.wav │ │ ├── OOS_BlueRoller.wav │ │ ├── OOS_Dodongo_Roar.wav │ │ ├── OOS_Frypolar_Move.wav │ │ ├── OOS_Ghini_Appear.wav │ │ ├── OOS_Gohma_DropLarva.wav │ │ ├── OOS_MagneticGloves1.wav │ │ ├── OOS_MagneticGloves2.wav │ │ ├── OOS_MagneticGloves_HalfSecond.wav │ │ ├── OOS_MagneticGloves_OneSecond.wav │ │ ├── OOS_MakuTree_Snore1.wav │ │ ├── OOS_MakuTree_Snore2.wav │ │ ├── OOS_Medelock_Lasers.wav │ │ ├── OOS_OnoxDragon_Fly.wav │ │ ├── OOS_OnoxDragon_Fly_Longer.wav │ │ ├── OOS_OnoxDragon_Swipe.wav │ │ ├── OOS_Onox_Tornado.wav │ │ ├── OOS_PirateSkull_Bounce.wav │ │ ├── OOS_Syger_Roar.wav │ │ ├── Oracle_AltarShake.wav │ │ ├── Oracle_AppearVanish.wav │ │ ├── Oracle_Barrier.wav │ │ ├── Oracle_BeginQuest.wav │ │ ├── Oracle_BiggoronsSword.wav │ │ ├── Oracle_Block_Fall.wav │ │ ├── Oracle_Block_Push.wav │ │ ├── Oracle_Bomb_Blow.wav │ │ ├── Oracle_Bomb_Drop.wav │ │ ├── Oracle_Boomerang.wav │ │ ├── Oracle_Boss_BigBoom.wav │ │ ├── Oracle_Boss_Die.wav │ │ ├── Oracle_Boss_Explode.wav │ │ ├── Oracle_Boss_Hit.wav │ │ ├── Oracle_Bush_Cut.wav │ │ ├── Oracle_Chest.wav │ │ ├── Oracle_Cucco.wav │ │ ├── Oracle_DekuScrub.wav │ │ ├── Oracle_Dimitri.wav │ │ ├── Oracle_Dungeon_Door.wav │ │ ├── Oracle_Dungeon_Signal.wav │ │ ├── Oracle_Dungeon_Spinner.wav │ │ ├── Oracle_Dungeon_Teleport.wav │ │ ├── Oracle_EmberSeed.wav │ │ ├── Oracle_Enemy_Die.wav │ │ ├── Oracle_Enemy_Hit.wav │ │ ├── Oracle_Enemy_Jump.wav │ │ ├── Oracle_Enemy_Spit.wav │ │ ├── Oracle_Error.wav │ │ ├── Oracle_Essence_Glow.wav │ │ ├── Oracle_Essence_Spin1.wav │ │ ├── Oracle_Essence_Spin2.wav │ │ ├── Oracle_Fanfare_Essence.wav │ │ ├── Oracle_Fanfare_Item.wav │ │ ├── Oracle_FloorCrumble.wav │ │ ├── Oracle_Flute_Dimitri.wav │ │ ├── Oracle_Flute_Moosh.wav │ │ ├── Oracle_Flute_Ricky.wav │ │ ├── Oracle_FunnyJoke1.wav │ │ ├── Oracle_FunnyJoke2.wav │ │ ├── Oracle_FunnyJoke3.wav │ │ ├── Oracle_GaleSeed.wav │ │ ├── Oracle_Game_Prepare.wav │ │ ├── Oracle_Game_Whistle.wav │ │ ├── Oracle_Ganon_StaffShoot.wav │ │ ├── Oracle_GashaTree_Wither.wav │ │ ├── Oracle_Get_Heart.wav │ │ ├── Oracle_Get_Item.wav │ │ ├── Oracle_Get_Rupee.wav │ │ ├── Oracle_Get_Rupee5.wav │ │ ├── Oracle_Goron.wav │ │ ├── Oracle_HealthRefill.wav │ │ ├── Oracle_HeartContainer.wav │ │ ├── Oracle_Key_Bounce.wav │ │ ├── Oracle_Laser.wav │ │ ├── Oracle_Lightning.wav │ │ ├── Oracle_Lightning_Long.wav │ │ ├── Oracle_Link_Dying.wav │ │ ├── Oracle_Link_Fall.wav │ │ ├── Oracle_Link_GoronDance1.wav │ │ ├── Oracle_Link_GoronDance2.wav │ │ ├── Oracle_Link_Hurt.wav │ │ ├── Oracle_Link_Jump.wav │ │ ├── Oracle_Link_LandRun.wav │ │ ├── Oracle_Link_PickUp.wav │ │ ├── Oracle_Link_Shock.wav │ │ ├── Oracle_Link_Swim.wav │ │ ├── Oracle_Link_Throw.wav │ │ ├── Oracle_Link_Wade.wav │ │ ├── Oracle_LowHealth.wav │ │ ├── Oracle_MakuSeed_Glow.wav │ │ ├── Oracle_MakuTree_Leaves.wav │ │ ├── Oracle_Menu_Cursor.wav │ │ ├── Oracle_Menu_Select.wav │ │ ├── Oracle_MineCart.wav │ │ ├── Oracle_MineCart_Track.wav │ │ ├── Oracle_MiniBoss_Charge.wav │ │ ├── Oracle_Moosh.wav │ │ ├── Oracle_MysterySeed.wav │ │ ├── Oracle_PauseMenu_Close.wav │ │ ├── Oracle_PauseMenu_Open.wav │ │ ├── Oracle_ReturnToNormal.wav │ │ ├── Oracle_Ricky.wav │ │ ├── Oracle_Rock_Shatter.wav │ │ ├── Oracle_Rumble1.wav │ │ ├── Oracle_Rumble2a.wav │ │ ├── Oracle_Rumble2b.wav │ │ ├── Oracle_ScentSeed.wav │ │ ├── Oracle_ScentSeed_Shot.wav │ │ ├── Oracle_SeaWave.wav │ │ ├── Oracle_Secret.wav │ │ ├── Oracle_Shield.wav │ │ ├── Oracle_Shield_Deflect.wav │ │ ├── Oracle_Shovel.wav │ │ ├── Oracle_Stairs.wav │ │ ├── Oracle_Switch.wav │ │ ├── Oracle_SwordShimmer.wav │ │ ├── Oracle_Sword_Charge.wav │ │ ├── Oracle_Sword_Shoot.wav │ │ ├── Oracle_Sword_Slash1.wav │ │ ├── Oracle_Sword_Slash2.wav │ │ ├── Oracle_Sword_Slash3.wav │ │ ├── Oracle_Sword_Spin.wav │ │ ├── Oracle_Sword_Tap.wav │ │ ├── Oracle_Text_Done.wav │ │ ├── Oracle_Text_Letter.wav │ │ ├── Oracle_TwinrovaCombined_Move.wav │ │ ├── Oracle_Twinrova_AppearFly.wav │ │ ├── Oracle_Twinrova_Combine.wav │ │ ├── Oracle_Twinrova_Laugh.wav │ │ ├── Oracle_WaterFlow1.wav │ │ ├── Oracle_WaterFlow2.wav │ │ ├── Oracle_Woosh1.wav │ │ ├── Oracle_Woosh2.wav │ │ └── Oracle_Woosh3.wav └── sprites │ ├── entity │ └── zelda │ │ ├── Ambis-Castle.png │ │ ├── Biggoron.png │ │ ├── LegendOfZelda-OracleOfAges-Labrynna(Past).png │ │ ├── LegendOfZelda-OracleOfSeasons-Holodrum(Default).png │ │ ├── Oracle_of_Ages_logo.png │ │ ├── Temple-of-Seasons.png │ │ ├── animals.png │ │ ├── entities.png │ │ ├── gorons.png │ │ ├── link.png │ │ ├── link2.png │ │ ├── links_awakening_bosses.png │ │ ├── links_awakening_items.png │ │ ├── links_awakening_objects.png │ │ ├── maku-tree.png │ │ ├── ooa_enemies.png │ │ ├── oracleofseasons-sprites-sheet-1.png │ │ ├── oracleofseasons-sprites-sheet-3.png │ │ ├── oracleofseasons-sprites-sheet-4.png │ │ ├── sword.png │ │ ├── tingle.png │ │ └── zoras.png │ └── map │ ├── DezertZone.png │ ├── meta.png │ └── zelda │ ├── map2.png │ ├── map_med.png │ ├── map_small.png │ └── map_small2.png ├── src ├── engine │ ├── AbstractGameLoop.java │ ├── FaceDirection.java │ ├── Game.java │ ├── GameFactory.java │ ├── GameStateEnum.java │ ├── ai │ │ ├── AggressiveAIStrategy.java │ │ ├── IAIStrategy.java │ │ ├── RandomAIStrategy.java │ │ └── ShortestGridPathFinderAIStrategy.java │ ├── clock │ │ └── Clock.java │ ├── config │ │ └── ConfigBank.java │ ├── dialog │ │ ├── AbstractDialog.java │ │ └── BasicDialog.java │ ├── entity │ │ ├── AbstractCollidable.java │ │ ├── AbstractEntity.java │ │ ├── AbstractLivingEntity.java │ │ ├── AbstractSimpleEntity.java │ │ ├── IEntity.java │ │ ├── enemy │ │ │ └── AbstractEnemy.java │ │ ├── item │ │ │ └── AbstractItem.java │ │ └── usable │ │ │ ├── AbstractUsableEntity.java │ │ │ ├── AbstractWeapon.java │ │ │ └── UsableBank.java │ ├── event │ │ ├── AbstractEnemiesDeadEvent.java │ │ ├── AbstractEvent.java │ │ ├── AbstractTimedDeployableEvent.java │ │ ├── ConsumeItemEvent.java │ │ ├── EnemiesDeadItemAppearEvent.java │ │ ├── EnemyDeployEvent.java │ │ ├── EventQueue.java │ │ ├── IEnemyEvent.java │ │ ├── IEvent.java │ │ ├── TimedDialogDeployEvent.java │ │ └── TimedEnemyDeployEvent.java │ ├── font │ │ └── FontBank.java │ ├── graphics │ │ ├── shape │ │ │ ├── AbstractShape.java │ │ │ ├── Circle.java │ │ │ ├── Cube.java │ │ │ ├── EmptyCircle.java │ │ │ ├── EmptyHalfCircle.java │ │ │ ├── GradientCircle.java │ │ │ ├── Polygon.java │ │ │ ├── Square.java │ │ │ └── Triangle.java │ │ └── sprite │ │ │ ├── AbstractSprite.java │ │ │ ├── AnimatedSprite.java │ │ │ ├── ISprite.java │ │ │ ├── ISpriteBankResource.java │ │ │ ├── SimpleSprite.java │ │ │ ├── SpriteBank.java │ │ │ ├── SpriteSheet.java │ │ │ └── SpriteUtils.java │ ├── il8n │ │ ├── StringBank.java │ │ └── Utf8Control.java │ ├── keyboard │ │ ├── DefaultKeyEventDispatcher.java │ │ └── KeyBoard.java │ ├── map │ │ └── tiled │ │ │ ├── AbstractTile.java │ │ │ ├── CollisionTile.java │ │ │ ├── ITile.java │ │ │ ├── Map.java │ │ │ ├── MetaTile.java │ │ │ ├── MetaTilesNumber.java │ │ │ ├── RenderTile.java │ │ │ ├── TiledMapLoader.java │ │ │ └── TiledSpriteSheet.java │ ├── math │ │ ├── PositionVector.java │ │ ├── Transform2D.java │ │ ├── Vector2D.java │ │ └── Vector3D.java │ ├── mouse │ │ └── Mouse.java │ ├── sound │ │ ├── AbstractSound.java │ │ ├── LoopingSound.java │ │ ├── SoundBank.java │ │ ├── SoundChannels.java │ │ └── SoundEffect.java │ └── utils │ │ ├── Base64Coder.java │ │ └── ZLibUtils.java ├── game │ ├── cubes │ │ ├── Cubes.java │ │ ├── GLScreen.java │ │ └── gamestates │ │ │ └── MainGameLoop.java │ ├── minesweeper │ │ ├── MineSweeper.java │ │ └── gamestates │ │ │ └── MainGameLoop.java │ └── zelda │ │ ├── Buttons.java │ │ ├── LegendOfZelda.java │ │ ├── TopMenu.java │ │ ├── dialog │ │ └── ZeldaDialog.java │ │ ├── enemy │ │ ├── BabyWorm.java │ │ ├── LikeLike.java │ │ ├── Octorok.java │ │ └── RedTurtle.java │ │ ├── gamestates │ │ ├── ItemScreenGameLoop.java │ │ ├── MainGameLoop.java │ │ ├── PausedScreenGameLoop.java │ │ └── TitleScreenGameLoop.java │ │ ├── item │ │ ├── AbstractRupee.java │ │ ├── BossKey.java │ │ ├── EntityItemSpriteResourceNumber.java │ │ ├── FullHeart.java │ │ ├── Heart.java │ │ ├── HeartPiece.java │ │ ├── RupeeBlue.java │ │ ├── RupeeGold.java │ │ ├── RupeeGreen.java │ │ ├── RupeePurple.java │ │ ├── RupeeRed.java │ │ ├── SmallKey.java │ │ └── TreasureChest.java │ │ ├── map │ │ └── meta │ │ │ └── LinkFallingMetaEvent.java │ │ ├── player │ │ └── Link.java │ │ └── usables │ │ ├── AbstractSword.java │ │ ├── Boomerang.java │ │ ├── BowAndArrow.java │ │ ├── Bracelet.java │ │ ├── MegatonHammer.java │ │ ├── Ocarina.java │ │ ├── SwordLevel1.java │ │ ├── SwordLevel2.java │ │ └── SwordLevel3.java └── log4j.xml └── test └── engine ├── clock └── ClockTest.java └── opengl ├── Draw3DCubesTest.java ├── OpenGLTest.java └── Screen.java /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | 3 | # Package Files # 4 | #*.jar 5 | *.war 6 | *.ear 7 | 8 | .classpath 9 | .settings 10 | *.prefs 11 | lib/opengl/x86/*.jar 12 | lib/opengl/x86-64/*.jar 13 | bin/ 14 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | JGame 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Java Game Engine 2 | 3 | ## I highly recommend just using LibGDX https://libgdx.badlogicgames.com/ 4 | 5 | I'm sure of the logic can transfer over, but this was a pretty hacked project. :) 6 | 7 | Legend of Zelda 8 | ============= 9 | By: Kenny Cason
10 | Zelda Game written in Java - Still a new project so it's definitely a work in progress. But should demonstrate much of hte functionality
11 | 12 | 13 | 16 | 19 | 20 | 21 | 24 | 27 | 28 | 29 | 32 | 35 | 36 | 37 | 40 | 43 | 44 |
14 | 15 | 17 | 18 |
22 | 23 | 25 | 26 |
30 | 31 | 33 | 34 |
38 | 39 | 41 | 42 |
45 | 46 | MineSweeper 47 | ============ 48 | 49 | 50 | 53 | 56 | 57 |
51 | 52 | 54 | 55 |
58 | 59 | 60 | **Required Libraries**
61 | Java 1.7
62 | jsoup-1.7.1.jar
63 | log4j-1.2.17.jar
64 | Maps written using Tiled
65 | -------------------------------------------------------------------------------- /doc/screenshots/bug_report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/doc/screenshots/bug_report.png -------------------------------------------------------------------------------- /doc/screenshots/minesweeper1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/doc/screenshots/minesweeper1.png -------------------------------------------------------------------------------- /doc/screenshots/minesweeper_winning.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/doc/screenshots/minesweeper_winning.jpg -------------------------------------------------------------------------------- /doc/screenshots/zelda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/doc/screenshots/zelda.png -------------------------------------------------------------------------------- /doc/screenshots/zelda10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/doc/screenshots/zelda10.png -------------------------------------------------------------------------------- /doc/screenshots/zelda11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/doc/screenshots/zelda11.png -------------------------------------------------------------------------------- /doc/screenshots/zelda12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/doc/screenshots/zelda12.png -------------------------------------------------------------------------------- /doc/screenshots/zelda13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/doc/screenshots/zelda13.png -------------------------------------------------------------------------------- /doc/screenshots/zelda2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/doc/screenshots/zelda2.png -------------------------------------------------------------------------------- /doc/screenshots/zelda3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/doc/screenshots/zelda3.png -------------------------------------------------------------------------------- /doc/screenshots/zelda5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/doc/screenshots/zelda5.png -------------------------------------------------------------------------------- /doc/screenshots/zelda6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/doc/screenshots/zelda6.png -------------------------------------------------------------------------------- /doc/screenshots/zelda7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/doc/screenshots/zelda7.png -------------------------------------------------------------------------------- /doc/screenshots/zelda8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/doc/screenshots/zelda8.png -------------------------------------------------------------------------------- /doc/screenshots/zelda9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/doc/screenshots/zelda9.png -------------------------------------------------------------------------------- /lib/jsoup-1.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/lib/jsoup-1.7.1.jar -------------------------------------------------------------------------------- /lib/log4j-1.2.17.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/lib/log4j-1.2.17.jar -------------------------------------------------------------------------------- /lib/opengl/x86/README.md: -------------------------------------------------------------------------------- 1 | Download Jar Files from: http://jogamp.org/deployment/autobuilds/master/ -------------------------------------------------------------------------------- /lib/opengl/x86/gluegen-rt-natives-linux-i586.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/lib/opengl/x86/gluegen-rt-natives-linux-i586.jar -------------------------------------------------------------------------------- /lib/opengl/x86/gluegen-rt.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/lib/opengl/x86/gluegen-rt.jar -------------------------------------------------------------------------------- /lib/opengl/x86/gluegen.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/lib/opengl/x86/gluegen.jar -------------------------------------------------------------------------------- /lib/opengl/x86/joal-natives-linux-i586.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/lib/opengl/x86/joal-natives-linux-i586.jar -------------------------------------------------------------------------------- /lib/opengl/x86/joal.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/lib/opengl/x86/joal.jar -------------------------------------------------------------------------------- /lib/opengl/x86/jogl-all-natives-linux-i586.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/lib/opengl/x86/jogl-all-natives-linux-i586.jar -------------------------------------------------------------------------------- /lib/opengl/x86/jogl-all.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/lib/opengl/x86/jogl-all.jar -------------------------------------------------------------------------------- /lib/opengl/x8664/README.md: -------------------------------------------------------------------------------- 1 | Download Jar Files from: http://jogamp.org/deployment/autobuilds/master/ -------------------------------------------------------------------------------- /lib/opengl/x8664/gluegen-rt-natives-linux-amd64.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/lib/opengl/x8664/gluegen-rt-natives-linux-amd64.jar -------------------------------------------------------------------------------- /lib/opengl/x8664/gluegen-rt.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/lib/opengl/x8664/gluegen-rt.jar -------------------------------------------------------------------------------- /lib/opengl/x8664/gluegen.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/lib/opengl/x8664/gluegen.jar -------------------------------------------------------------------------------- /lib/opengl/x8664/joal-natives-linux-amd64.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/lib/opengl/x8664/joal-natives-linux-amd64.jar -------------------------------------------------------------------------------- /lib/opengl/x8664/joal.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/lib/opengl/x8664/joal.jar -------------------------------------------------------------------------------- /lib/opengl/x8664/jogl-all-natives-linux-amd64.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/lib/opengl/x8664/jogl-all-natives-linux-amd64.jar -------------------------------------------------------------------------------- /lib/opengl/x8664/jogl-all.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/lib/opengl/x8664/jogl-all.jar -------------------------------------------------------------------------------- /resources/config/default.config: -------------------------------------------------------------------------------- 1 | volume = 50 2 | locale = en 3 | keys.left = 37 4 | keys.up = 38 5 | keys.right = 39 6 | keys.down = 40 7 | keys.item_b = 65 8 | keys.item_a = 83 9 | keys.start = 32 10 | keys.pause = 80 11 | keys.reset = 82 12 | keys.escape = 27 -------------------------------------------------------------------------------- /resources/il8n/texts.properties: -------------------------------------------------------------------------------- 1 | sword = sword 2 | sword_found = You found a level {0} sword! 3 | title = The Legend of Zelda 4 | life = Life -------------------------------------------------------------------------------- /resources/il8n/texts_cn.properties: -------------------------------------------------------------------------------- 1 | aryll = 雅丽儿 2 | attack = 攻击 3 | boss = 头目 4 | boss_gohma = 巨型铁甲蜈蚣 5 | dungeon = 迷宫 6 | dungeon_forsaken_fortress = 恶魔要塞 7 | dungeon_dragon_roost_cavern = 龙岩熔洞 8 | dungeon_forbidden_woods = 禁断之森 9 | dungeon_tower_of_the_gods = 神之塔 10 | dungeon_earth_temple = 地之神殿 11 | dungeon_wind_temple = 风之神殿 12 | dungeon_ganons_tower = 加农城 13 | fairy = 精灵 14 | ganondorf = 加农 15 | hero_of_time = 時之勇者 16 | holy_sword = 圣剑 17 | hylia = 海拉尔大陆 18 | hylian_shield = 海拉尔盾 19 | king_hyrule = 海拉尔国王 20 | king_of_red_lions = 红狮王号 21 | kokiri = 科克里 22 | life = Life 23 | link = 林克 24 | master_sword = 大师剑 25 | nintendo = 任天堂 26 | ocarina_of_ime = 时光之笛 27 | princess_zelda = 塞尔达公主 28 | shield = 盾 29 | skyward_sword = 天空之剑 30 | sword = 剑 31 | tetra = 泰特拉 32 | tingle = 汀格尔 33 | sword_found = You found a level {0} sword! 34 | title = 塞尔达传说 35 | triforce = 三角神力 36 | 37 | -------------------------------------------------------------------------------- /resources/il8n/texts_fr.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/il8n/texts_fr.properties -------------------------------------------------------------------------------- /resources/maps/simple.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53, 12 | 53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53, 13 | 53,53,0,0,0,0,0,0,0,0,0,0,0,0,53,53, 14 | 53,53,0,0,0,0,0,0,0,0,0,0,0,0,53,53, 15 | 53,53,0,0,53,53,0,0,0,0,0,0,0,0,53,53, 16 | 53,53,0,0,53,53,0,0,0,0,0,0,0,0,53,53, 17 | 53,53,0,0,0,0,0,0,0,0,0,0,0,0,53,53, 18 | 53,53,0,0,0,0,0,0,0,0,0,0,0,0,53,53, 19 | 53,53,0,0,0,0,0,0,0,0,0,0,0,0,53,53, 20 | 53,53,0,0,0,0,0,0,0,0,0,0,0,0,53,53, 21 | 53,53,0,0,0,0,0,0,0,0,0,0,0,0,53,53, 22 | 53,53,0,0,0,0,0,0,0,0,0,0,0,0,53,53, 23 | 53,53,0,0,53,53,0,0,0,0,0,0,0,0,53,53, 24 | 53,53,0,0,53,53,0,0,0,0,0,0,0,0,53,53, 25 | 53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53, 26 | 53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53 27 | 28 | 29 | 30 | 31 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 32 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 33 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 34 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 35 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 36 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 37 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 38 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 39 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 40 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 41 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 42 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 43 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 44 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 45 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 46 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 47 | 48 | 49 | 50 | 51 | 545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, 52 | 545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, 53 | 545,545,0,0,0,0,0,0,0,0,0,0,0,0,545,545, 54 | 545,545,0,0,0,0,0,0,0,0,0,0,0,0,545,545, 55 | 545,545,0,0,545,545,0,0,0,0,0,0,0,0,545,545, 56 | 545,545,0,0,545,545,0,0,0,0,0,0,0,0,545,545, 57 | 545,545,0,0,0,0,0,0,0,0,0,0,0,0,545,545, 58 | 545,545,0,0,0,0,0,0,0,0,0,0,0,0,545,545, 59 | 545,545,0,0,0,0,0,0,0,0,0,0,0,0,545,545, 60 | 545,545,0,0,0,0,0,0,0,0,0,0,0,0,545,545, 61 | 545,545,0,0,0,0,0,0,0,0,0,0,0,0,545,545, 62 | 545,545,0,0,0,0,0,0,0,0,0,0,0,0,545,545, 63 | 545,545,0,0,545,545,0,0,0,0,0,0,0,0,545,545, 64 | 545,545,0,0,545,545,0,0,0,0,0,0,0,0,545,545, 65 | 545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545, 66 | 545,545,545,545,545,545,545,545,545,545,545,545,545,545,545,545 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /resources/maps/tiled-0.7.2/INSTALL: -------------------------------------------------------------------------------- 1 | ---------------- 2 | BUILDING TILED 3 | ---------------- 4 | 5 | NOTE: If you have downloaded the binary archive (bin), then you can skip this 6 | as you will already have the tiled.jar file. Continue to "Running Tiled" below. 7 | 8 | Take the following steps to build Tiled from source: 9 | 10 | - Install the JDK (http://java.sun.com/) 11 | - Install apache-ant (http://ant.apache.org/) 12 | - Run ant in the directory where you placed Tiled 13 | 14 | --------------- 15 | RUNNING TILED 16 | --------------- 17 | 18 | - Install the Java Runtime Environment (JRE) (http://java.sun.com/) 19 | 20 | - From the command line, you can run the following from the directory where you 21 | placed Tiled: 22 | 23 | cd dist (if you have compiled Tiled yourself) 24 | java -jar tiled.jar 25 | 26 | - You can also use the Java webstart link on the website, see "Start Now!" 27 | 28 | - Windows users that have the JRE installed should be able to double click the 29 | tiled.jar file to run it. 30 | -------------------------------------------------------------------------------- /resources/maps/tiled-0.7.2/README: -------------------------------------------------------------------------------- 1 | ------------------------ 2 | TILED MAP EDITOR 0.7.x 3 | ------------------------ 4 | 5 | This is Tiled, a general purpose tiled map editor. Although this release is 6 | pretty capable and flexible, we don't expect it to be able to do enough for 7 | most people at the moment. We need your feedback! 8 | 9 | 10 | Website: http://mapeditor.org/ 11 | Bugtracker: http://bugs.mapeditor.org/ 12 | Mercurial: http://hg.mapeditor.org/ 13 | 14 | ----------------- 15 | CURRENT FEATURES 16 | ----------------- 17 | 18 | - Multilayer, layers can be changed around dynamically 19 | - Multiple orientations (orthographic and isometric at the moment) 20 | - Objects can be placed anywhere on the map 21 | - Arbitrary custom properties can be set on the maps, layers, objects and tiles 22 | - Tiles can be taller than the default tile height 23 | - Easy to use drawing operations 24 | - Universal XML-based map and tileset file formats 25 | - Can embed tiles in the map or tileset file 26 | - Highly portable and free software 27 | - Maps may include tiles from multiple tilesets 28 | - Ability to write custom Map reader/writer plugins 29 | 30 | --------- 31 | AUTHORS 32 | --------- 33 | 34 | - Adam Turk 35 | - Bjorn Lindeijer 36 | 37 | ----------- 38 | TRANSLATORS 39 | ----------- 40 | 41 | - Nader Akhres (French) 42 | - Bjorn Lindeijer (Dutch) 43 | - ElvenProgrammer (Italian) 44 | - Matthias Hartmann (German) 45 | - Alexandra Puente (Spanish) 46 | 47 | ----------- 48 | THANKS TO 49 | ----------- 50 | 51 | (In no particular order) 52 | - Frode Lindeijer for the design of the logo 53 | - Eean Cook for various contributions 54 | - Andreas Mross for Hexagonal map implementation 55 | - Ahmed Mohombe for many good suggestions and notes on implementation 56 | - Rickard Isaksson for an improved image loader 57 | - Kevin Kelley for the base64 encoder/decoder we use 58 | - GNOME and GIMP for their magnificent icons 59 | - Nephilim for suggesting layer opacity 60 | - Rainer Deyke for useful suggestions and many code contributions 61 | - Jerome Blouin for some meticulous performance testing 62 | - Hendrik Brummermann for improving error reporting on map loading 63 | - Nader Akhres for the JSON map writer plugin 64 | - William C. Bubel for the Lua map writer plugin 65 | - Matthias Kievernagel for a nice HexMapView 66 | - Olivier Beaton for the DTD and Schema files describing the TMX format 67 | -------------------------------------------------------------------------------- /resources/maps/tiled-0.7.2/TODO: -------------------------------------------------------------------------------- 1 | ROADMAP TO FUTURE RELEASES 2 | 3 | 0.7.3 4 | * Check that tile palette panel doesn't keep listening after being replaced 5 | * Update translations for dialog.saveas.confirm.mismatch 6 | * Make continuous layout and tiles per row behaviour configurable 7 | * Fix default tabbed tilesets panel height 8 | * Fix redraw issue on empty area in tile palette panel 9 | * Do not reset brush when switching tools (but do show a small tile highlight 10 | while other tools than stamp brush are selected) 11 | + Add Shift-Ctrl-C deep copy (Copies all layers into a new one) 12 | * Add custom brush from selection (via Ctrl-B) 13 | 14 | 0.8.0 15 | * Add support for animated tiles 16 | * Set up a layer->map->mapview changes event trail to automatically handle 17 | repainting changes in all views on the map. 18 | * Add minimap above layer table 19 | * Pretty brush preview 20 | 21 | 0.9.0 22 | * Introduce concept of a project 23 | * Add concept of 'textures' and automatic texture transitions using smart brush 24 | * Store stamp brushes and texture transition definitions to project 25 | 26 | 1.0.0 27 | * Tool plugins 28 | * Fix all remaining issues. 29 | 30 | GENERAL TODO ITEMS 31 | 32 | * Add a brush preview widget 33 | * Add support for tile instance properties (by Christian Henz) (WIP) 34 | - Implement an effective way of displaying the presence of these properties 35 | * Fix memory problems when loading several maps with many tilesets in a row 36 | * Add ability to select multiple layers from layer table 37 | * Add preview of new tileset when creating a tileset 38 | * Add the Shifted view, which emulates several tiling configurations 39 | * Add additional "tile cutters" 40 | * Rewrite main mapeditor code 41 | * Move actions out of MapEditor, and created a package for them 42 | * Reintroduce usage counts in tileset manager without performance issues 43 | * Add convenient map resizing preview widget 44 | * Turning on/off layer visibility shouldn't select them 45 | * Allow mapviews to have parameters 46 | * Start open image in new tileset dialog at map location when possible. 47 | * Add offset settings to New Tileset dialog and tileset xml tag 48 | * Look into making selections more efficient by not using a tile layer 49 | * See about using real numbers for tile positioning with isometric 50 | * Look into color button on New Tileset dialog 51 | * Try to generalize color button for setting grid and background color 52 | settings. Change Grid to Display tab with Grid and Colors groups. 53 | -------------------------------------------------------------------------------- /resources/maps/tiled-0.7.2/examples/hexmap.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | iVBORw0KGgoAAAANSUhEUgAAADEAAAAsCAYAAADM1FBZAAADjUlEQVR42s1ZsYHbMAxk4SLFFyl+hB8gRYovU36RIk3KFCldagQPoBFSaAUP4AG8lPOECOgAgRJli5LdSBZECCQOwBEMYeHv5ePr7cfb4Xbowi3ex+uhTfencPv57fN6Cf3zJtw+h4gs3qOM9Jz7MSTr+meh9i9+PBpEhiVDyPBjkMnR/6Z/h54d07NkJI8TudFZfQJkzLk34vXXsOrxf/vne28UGIQyGmtkPFn2SNRZbQIMHVw9gsAprW4L0LkGDbl2WPmRLHkOPcSwrDEP+RB5oOuv9OwCRiYD4j0bl5PhgqDOGhMYgjVBgDH/7+/7AI02KMzL/cWX0TjQybKokzycdK42CVqlRjKHhhV4hFeTZTguJ2OP5HSuMoGosPl4E+XKG5gqkxGC7zSO34sygWRGJ3/P6nxoAvxRdi8r5rRJ16sOXsw4Ah8jkxhpgqoPkoqNzsdjwXyY06SaEKRehISqIxmZPDsN2QoXLRpy90Q4GFUAXgbIYIpUE2oBbjZwPZnRqQpmp9L38h/mbvsBSa3XAW74LlZzmWwD9KIZG2t1vv7+onQu9obAxeE5CAmBRjsUKW9cTubBDHViMV3sBQ/vludwrZCVP/pxwrIS7mRX3tNZPAGZiMNzaHUc7hTfi/yIV8/jTjmd6JESPlYU0LKC1zByM66eylRT/MjotDE2pdPaUhzQlucwseOgnONOmI4td+J71ulxJ86IGVtm4mCOAzncie95nPAehzvJu7kUnHTO2cLbgjGMCjnQFM+Z4kdr6xxBSwVYZ7JRhufYyosfYj04zpMhI7A6S23xNz4t7J0bvWFRldrhOZamINRQhrHABhEMHT42Z4vyhFJ61m7GnK92cxADvMW046TYTXCnHB8rsIUKc5jjQCqoM9zJ8hwvcOk/Br/RifuUpbb0nki5O/IVLijocqsYeQ4VKOA5HlRG3Y8ZPlZiCyYjRTOQA9kekcdzavWdltiiWjGCu6OPTSx2tftOhbbka4XlK1igtuo75XRaW1z6zcGHHAgL0dZ9pylbZukH4huhtGXfydOJUCraliJf2bPv5NlStJ+Y4Sub9p28ccV9V0x7e/ed2Ja7tqdq9XfsOxlblnc89u47cTq/q8n8bH0nxVgXw+pJ+k6PnQ49Qd9ptSOuPftO6x027tR3Wu/AEfj71n2naieoW/Sd6p5hV+47YVbc7ii4Qt+p7mH8Bn2ne+z6D4sUaiE8Ubh4AAAAAElFTkSuQmCC 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | H4sIAAAAAAAAAO3DAQkAAAwEofv+pddjKLhqqqqq6usHHB1pSAAQAAA= 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /resources/maps/tiled-0.7.2/examples/iso-test2.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | iVBORw0KGgoAAAANSUhEUgAAAEAAAAAgCAYAAACinX6EAAAB3klEQVR42u2Z7StEQRjFT3a9RlgRkkTyBykRSYiiSHbb9Zo2Wfa/IUmSFCXJZyWJvP4Zzpn5ZPbDtu377jx12tvcmec5v9m9d+feAYoTNdQYEHyy0rFpq/gQ5AShn4G2R2A0aaVjtelcZU5EgJrixwsQeuAXfggcLf2X2nROfdTXjCn7CFIzZHkFOu6B8YNUcFfqo74ao7EmR9lFLTVPiDeg8w6Y3E8P7kpjNFY5lMvkLPmooxZp+h3ougWm45mDu1IO5VJO5TY1Si7qKZoNfADdN8DsXvbgrpRTuVVDtUzNokcDtUJTn0DPNTC3m3twV6qhWqqp2sZDwaORWqOJL6D3CljYyT+4K9VUbXmQF+Mp79FERVj0G+i75C9xq/DgruRBXuRJ3ozHnEcz1ycbtkj/BbC8WXxwV/Ikb/Ior/KcfbQw2TaT/gAD58BqrPTAXcmjvMqzvIsh82jlYN51A7/A4BmTRksfPGUiota7GMQipvTRzs5xO2joFAhHyg/clRjEYiYibhlTI8STCfuzGT7hvSRc/uCuxCQ2c2kkLLNdridt48gxEFuvPHBXYhSrmMXuJ6DqLwF/E/R/g34h5JfC/mHIPw77FyL+lZh/Kepfi/uNEb815jdHq257/A8rj91mixMZJgAAAABJRU5ErkJggg== 9 | 10 | 11 | 12 | 13 | 14 | 15 | iVBORw0KGgoAAAANSUhEUgAAAEAAAAAlCAYAAADyUO83AAAD9ElEQVR42t2aWU8TURTHDxZ9xWA0GnHXGD+CPqhPGlETlbKFHSMY4wNSlMV9gbaDIPAF9AlFvoEvIFiQAvrovsbER5cvgOd/79RlOjN3GEtnpic5mcn0nnP+v39vpwsQeRN5nGGi/BcycS6u5XwAsoyhXxKtfEZUosnEOa7hsdw0YhlnOUO+Yth5CR0/828KI+blGqwVNTkBXsFQr4kK53inx9LBjYk1WIsa1AbTCIiu1MFn+QmNqsGNiRrUCiMqg2IERFYRhd6w+KQavLdFptKIpOyJ3v40IsRZzYe3RKtmeOd2q8HjfUTasEycq4xAT/TGDMwSM30BXsOHdyzuKT9Bt9TgWr8O/sCQw/IxlRGYgVmYidneGIGhdXx4T7R6Wg2unbMBtzACNSojMBsaoCU7RuRzNvCsDzx8ip+Am87A4/cdgBtS1DgwAhqgBZqgTWhcEvBGHTxBVHtDsdVb+XjHHbiZEegletrMhCZoE0Y0ZsoINDnJTT8SrXnCBl/PHrhbI6ARWqEZ2t0ZsZzzFDf5RLR2kg295h24WyOgGdrBABbB5Ai8SQefcAauDWQH3PQeMeDQiAndiCYrI3CxWQd/zDvniuKTWoRz0Btw0x0xqGuy0QwmsAkjmv824jRf/Ey0bjxY4P9jBFjBDHYKjRKt+Eq05y5R9Kw1uDbkT3DTl8aQtRFgBCuYwS5jF98sYQS7svveHyO0tuCAWxkBhhQ42MAIVjCnx05+aYwQFXwhKn1E1DMSPHBjggEsYAIbGC2jv5CLDhC1XCU6xN/J93/ju+hMMI2AZmgHA1jABDYwmoLHDqa/Xlr5LaQ4KZvUc7PoQ/+DQ2O9Dg7trSZv5WD9bUSsgAsr7e+cEb5zFnPTfdy0IelPI6AJ2qARWiOKdzQwg13EQh5f2LEII76zyzysxwdGQAO0QJNTcLAumP346tSItstER6bl0LpZb4zATMyGBmiBJtfgZkZEt/PHzAr7pucvER2e0o2Yy44RAnxOzsRsaLD9uF4hWRbc/tyubeMsd2BEQoqqhRGjSwA+KnsL8IQaHJqhPWOBZr1l9kMvXOTtqBtRN58ZI9ADvcRWT8gZts94WYbBjRHdqjaivYvFTkrRNSy+24URqKlJgU/KnipwaMta9G5hoaUOjOCvont/ODciBY4a1KrAoQFaPIvoZrURHZ1ER8clVPVzcyNwDY9hDdaiRgWO2b6J25tYWNhedGcHw41JyCrdCGRVCnxMrrH9Sh6Ws3wbTozoateN+CkT57gWaHBjxDbyNi1RG6ECRw/0Cmz0bWCQE4v/4yhqUJszES/iu/VxNbhYU5TD/yRiZUTOg6f9BrGegY/JxLk38Quqva98Bot+bAAAAABJRU5ErkJggg== 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | H4sIAAAAAAAAAO3DwQkAAAwDoSP7D90x+lFw1VRVVVVVVVVVVVVVVVVVVdXXB2sNXEYAQAAA 24 | 25 | 26 | 27 | 28 | H4sIAAAAAAAAAO3WQQrAIBAEQWH//+ccIxIfELoKFs/jOuBawGxTc2au3cF8DB1zOSvk139e9f3X8ut/m/9v+/3X919X37f+AwAAAAAAAAAAAMA/PMMCaKAAQAAA 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /resources/maps/tiled-0.7.2/examples/iso-test4.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | H4sIAAAAAAAAAO3DQQ0AAAwDoat/05OxDySsmqqqqqqqqqqqqqqqqqqqqvr6AFA+aDAAQAAA 9 | 10 | 11 | 12 | 13 | H4sIAAAAAAAAAO3SMQqAMAxAUYeiZxC8/znVoeAiFhVKmvcgW4b+0GkCAAAAgPdK7wd0UG5mZHfNGW7Q2j7iHd60j3SDL/3Rb/C1XX9sT23zMVvDXlRPXcsxa8NeVH/8f/2xZe8/Ze+vMrdfZe+vsnYDAAAAAAAA9LAD/njXxQBAAAA= 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /resources/maps/tiled-0.7.2/examples/sewer_tileset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/maps/tiled-0.7.2/examples/sewer_tileset.png -------------------------------------------------------------------------------- /resources/maps/tiled-0.7.2/examples/tilebmp-test.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | H4sIAAAAAAAAAO3POwoCMRiF0cHOJ/jAahpHLNT9788r5IfgCiSc4kBuIJBvnqZp7txiF/s4xNLturv/vBnJt/8Sq7i2/tp1N3r/Ojaxbf21y+j9xzjFufXXLiP3P+PVPLpz7/0H/wQAAAAAAAAAAAAAAAAAgBF9AJgOlPoAQAAA 22 | 23 | 24 | 25 | 26 | H4sIAAAAAAAAAO3PsQ0AMAgDQaZKE7H/WpmBKhK+k+go/FUzZ/i/jf5s+rPpz6Z/lzu8/jMTAAAAAAAAAAAAAAAAgDAPGg5TPgBAAAA= 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /resources/maps/tiled-0.7.2/examples/tilespacing-test.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | H4sIAAAAAAAAAO3TTQ+CMAwG4KIn8aSelIRE4IIf/P+fZ5dsoTQlqXPlYHp4krFA361sAwA8lJ6oLSzUnAzq5qrQTrA3ymvY8wHVgqNRfp+Zf0W3uP40pvi+SuffURe/T2OK19Xmn9BZcGHvjTDfiTTOuSvadXK0/5r5Nbl3mvZfM1/aWg79L1bZocfvmP+C5Zn/tv+/7F0681v0P2QMIJ/5Lfo/Gtd3zjnnnPtnH/8uAvwAEAAA 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /resources/maps/tiled-0.7.2/examples/tmw_desert_spacing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/maps/tiled-0.7.2/examples/tmw_desert_spacing.png -------------------------------------------------------------------------------- /resources/maps/tiled-0.7.2/plugins/json.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/maps/tiled-0.7.2/plugins/json.jar -------------------------------------------------------------------------------- /resources/maps/tiled-0.7.2/plugins/lua.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/maps/tiled-0.7.2/plugins/lua.jar -------------------------------------------------------------------------------- /resources/maps/tiled-0.7.2/plugins/mappy.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/maps/tiled-0.7.2/plugins/mappy.jar -------------------------------------------------------------------------------- /resources/maps/tiled-0.7.2/plugins/tmw.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/maps/tiled-0.7.2/plugins/tmw.jar -------------------------------------------------------------------------------- /resources/maps/tiled-0.7.2/tiled.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/maps/tiled-0.7.2/tiled.jar -------------------------------------------------------------------------------- /resources/sounds/ReadMe.md: -------------------------------------------------------------------------------- 1 | Sounds effects from: http://noproblo.dayjo.org/ZeldaSounds/ -------------------------------------------------------------------------------- /resources/sounds/bg/LoZ Oracle of Seasons Cavern.WAV: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/bg/LoZ Oracle of Seasons Cavern.WAV -------------------------------------------------------------------------------- /resources/sounds/bg/LoZ Oracle of Seasons Essence Obtained!.WAV: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/bg/LoZ Oracle of Seasons Essence Obtained!.WAV -------------------------------------------------------------------------------- /resources/sounds/bg/LoZ Oracle of Seasons GAME OVER.WAV: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/bg/LoZ Oracle of Seasons GAME OVER.WAV -------------------------------------------------------------------------------- /resources/sounds/bg/LoZ Oracle of Seasons Horon Village.WAV: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/bg/LoZ Oracle of Seasons Horon Village.WAV -------------------------------------------------------------------------------- /resources/sounds/bg/LoZ Oracle of Seasons Intro + Title Screen.WAV: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/bg/LoZ Oracle of Seasons Intro + Title Screen.WAV -------------------------------------------------------------------------------- /resources/sounds/bg/LoZ Oracle of Seasons Lvl 1 Gnarled Root Dungeon.WAV: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/bg/LoZ Oracle of Seasons Lvl 1 Gnarled Root Dungeon.WAV -------------------------------------------------------------------------------- /resources/sounds/bg/LoZ Oracle of Seasons Lvl 2 Snake's Remains.WAV: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/bg/LoZ Oracle of Seasons Lvl 2 Snake's Remains.WAV -------------------------------------------------------------------------------- /resources/sounds/bg/LoZ Oracle of Seasons Lvl 7 Explorer's crypt.WAV: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/bg/LoZ Oracle of Seasons Lvl 7 Explorer's crypt.WAV -------------------------------------------------------------------------------- /resources/sounds/bg/LoZ Oracle of Seasons Main Theme.WAV: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/bg/LoZ Oracle of Seasons Main Theme.WAV -------------------------------------------------------------------------------- /resources/sounds/bg/LoZ Oracle of Seasons Maku Tree's theme.WAV: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/bg/LoZ Oracle of Seasons Maku Tree's theme.WAV -------------------------------------------------------------------------------- /resources/sounds/bg/LoZ Oracle of Seasons Sacred Place.WAV: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/bg/LoZ Oracle of Seasons Sacred Place.WAV -------------------------------------------------------------------------------- /resources/sounds/bg/LoZ Oracle of Seasons Tarm Ruins.WAV: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/bg/LoZ Oracle of Seasons Tarm Ruins.WAV -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_Boss_Shoot.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_Boss_Shoot.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_Harp_TuneOfAges.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_Harp_TuneOfAges.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_Harp_TuneOfCurrents.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_Harp_TuneOfCurrents.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_Harp_TuneOfEchoes.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_Harp_TuneOfEchoes.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_Link_Baby.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_Link_Baby.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_Link_BabyCrawl.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_Link_BabyCrawl.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_MakuTree_Weird.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_MakuTree_Weird.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_MakuTree_Wisps.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_MakuTree_Wisps.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_Nayru_Land.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_Nayru_Land.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_Plasmarine_Shock.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_Plasmarine_Shock.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_SeedShooter.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_SeedShooter.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_SwitchHook_Full.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_SwitchHook_Full.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_SwitchHook_Loop.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_SwitchHook_Loop.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_SwitchHook_Switch.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_SwitchHook_Switch.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_TimeWarp_Begin.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_TimeWarp_Begin.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_TimeWarp_Finish.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_TimeWarp_Finish.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_Tingle_KoolooLimpah.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_Tingle_KoolooLimpah.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_Tokay.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_Tokay.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_VeranBee_Swarm.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_VeranBee_Swarm.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_VeranTurtle_Jump.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_VeranTurtle_Jump.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_VeranTurtle_Land.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_VeranTurtle_Land.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_Veran_Shapeshift.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_Veran_Shapeshift.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_WingDungeon_Collapse1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_WingDungeon_Collapse1.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_WingDungeon_Collapse2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_WingDungeon_Collapse2.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOA_WingDungeon_Collapse_Full.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOA_WingDungeon_Collapse_Full.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOS_Aquamentus_Walk.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOS_Aquamentus_Walk.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOS_BlueRoller.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOS_BlueRoller.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOS_Dodongo_Roar.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOS_Dodongo_Roar.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOS_Frypolar_Move.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOS_Frypolar_Move.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOS_Ghini_Appear.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOS_Ghini_Appear.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOS_Gohma_DropLarva.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOS_Gohma_DropLarva.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOS_MagneticGloves1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOS_MagneticGloves1.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOS_MagneticGloves2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOS_MagneticGloves2.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOS_MagneticGloves_HalfSecond.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOS_MagneticGloves_HalfSecond.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOS_MagneticGloves_OneSecond.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOS_MagneticGloves_OneSecond.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOS_MakuTree_Snore1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOS_MakuTree_Snore1.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOS_MakuTree_Snore2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOS_MakuTree_Snore2.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOS_Medelock_Lasers.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOS_Medelock_Lasers.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOS_OnoxDragon_Fly.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOS_OnoxDragon_Fly.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOS_OnoxDragon_Fly_Longer.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOS_OnoxDragon_Fly_Longer.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOS_OnoxDragon_Swipe.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOS_OnoxDragon_Swipe.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOS_Onox_Tornado.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOS_Onox_Tornado.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOS_PirateSkull_Bounce.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOS_PirateSkull_Bounce.wav -------------------------------------------------------------------------------- /resources/sounds/effects/OOS_Syger_Roar.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/OOS_Syger_Roar.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_AltarShake.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_AltarShake.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_AppearVanish.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_AppearVanish.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Barrier.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Barrier.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_BeginQuest.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_BeginQuest.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_BiggoronsSword.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_BiggoronsSword.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Block_Fall.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Block_Fall.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Block_Push.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Block_Push.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Bomb_Blow.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Bomb_Blow.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Bomb_Drop.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Bomb_Drop.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Boomerang.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Boomerang.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Boss_BigBoom.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Boss_BigBoom.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Boss_Die.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Boss_Die.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Boss_Explode.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Boss_Explode.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Boss_Hit.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Boss_Hit.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Bush_Cut.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Bush_Cut.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Chest.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Chest.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Cucco.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Cucco.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_DekuScrub.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_DekuScrub.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Dimitri.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Dimitri.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Dungeon_Door.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Dungeon_Door.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Dungeon_Signal.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Dungeon_Signal.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Dungeon_Spinner.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Dungeon_Spinner.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Dungeon_Teleport.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Dungeon_Teleport.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_EmberSeed.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_EmberSeed.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Enemy_Die.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Enemy_Die.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Enemy_Hit.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Enemy_Hit.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Enemy_Jump.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Enemy_Jump.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Enemy_Spit.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Enemy_Spit.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Error.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Error.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Essence_Glow.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Essence_Glow.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Essence_Spin1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Essence_Spin1.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Essence_Spin2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Essence_Spin2.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Fanfare_Essence.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Fanfare_Essence.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Fanfare_Item.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Fanfare_Item.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_FloorCrumble.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_FloorCrumble.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Flute_Dimitri.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Flute_Dimitri.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Flute_Moosh.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Flute_Moosh.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Flute_Ricky.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Flute_Ricky.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_FunnyJoke1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_FunnyJoke1.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_FunnyJoke2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_FunnyJoke2.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_FunnyJoke3.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_FunnyJoke3.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_GaleSeed.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_GaleSeed.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Game_Prepare.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Game_Prepare.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Game_Whistle.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Game_Whistle.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Ganon_StaffShoot.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Ganon_StaffShoot.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_GashaTree_Wither.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_GashaTree_Wither.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Get_Heart.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Get_Heart.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Get_Item.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Get_Item.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Get_Rupee.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Get_Rupee.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Get_Rupee5.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Get_Rupee5.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Goron.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Goron.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_HealthRefill.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_HealthRefill.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_HeartContainer.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_HeartContainer.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Key_Bounce.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Key_Bounce.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Laser.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Laser.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Lightning.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Lightning.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Lightning_Long.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Lightning_Long.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Link_Dying.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Link_Dying.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Link_Fall.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Link_Fall.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Link_GoronDance1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Link_GoronDance1.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Link_GoronDance2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Link_GoronDance2.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Link_Hurt.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Link_Hurt.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Link_Jump.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Link_Jump.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Link_LandRun.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Link_LandRun.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Link_PickUp.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Link_PickUp.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Link_Shock.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Link_Shock.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Link_Swim.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Link_Swim.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Link_Throw.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Link_Throw.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Link_Wade.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Link_Wade.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_LowHealth.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_LowHealth.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_MakuSeed_Glow.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_MakuSeed_Glow.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_MakuTree_Leaves.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_MakuTree_Leaves.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Menu_Cursor.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Menu_Cursor.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Menu_Select.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Menu_Select.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_MineCart.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_MineCart.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_MineCart_Track.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_MineCart_Track.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_MiniBoss_Charge.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_MiniBoss_Charge.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Moosh.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Moosh.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_MysterySeed.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_MysterySeed.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_PauseMenu_Close.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_PauseMenu_Close.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_PauseMenu_Open.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_PauseMenu_Open.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_ReturnToNormal.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_ReturnToNormal.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Ricky.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Ricky.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Rock_Shatter.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Rock_Shatter.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Rumble1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Rumble1.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Rumble2a.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Rumble2a.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Rumble2b.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Rumble2b.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_ScentSeed.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_ScentSeed.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_ScentSeed_Shot.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_ScentSeed_Shot.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_SeaWave.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_SeaWave.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Secret.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Secret.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Shield.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Shield.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Shield_Deflect.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Shield_Deflect.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Shovel.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Shovel.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Stairs.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Stairs.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Switch.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Switch.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_SwordShimmer.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_SwordShimmer.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Sword_Charge.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Sword_Charge.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Sword_Shoot.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Sword_Shoot.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Sword_Slash1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Sword_Slash1.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Sword_Slash2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Sword_Slash2.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Sword_Slash3.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Sword_Slash3.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Sword_Spin.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Sword_Spin.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Sword_Tap.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Sword_Tap.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Text_Done.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Text_Done.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Text_Letter.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Text_Letter.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_TwinrovaCombined_Move.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_TwinrovaCombined_Move.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Twinrova_AppearFly.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Twinrova_AppearFly.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Twinrova_Combine.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Twinrova_Combine.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Twinrova_Laugh.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Twinrova_Laugh.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_WaterFlow1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_WaterFlow1.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_WaterFlow2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_WaterFlow2.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Woosh1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Woosh1.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Woosh2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Woosh2.wav -------------------------------------------------------------------------------- /resources/sounds/effects/Oracle_Woosh3.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sounds/effects/Oracle_Woosh3.wav -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/Ambis-Castle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/Ambis-Castle.png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/Biggoron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/Biggoron.png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/LegendOfZelda-OracleOfAges-Labrynna(Past).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/LegendOfZelda-OracleOfAges-Labrynna(Past).png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/LegendOfZelda-OracleOfSeasons-Holodrum(Default).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/LegendOfZelda-OracleOfSeasons-Holodrum(Default).png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/Oracle_of_Ages_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/Oracle_of_Ages_logo.png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/Temple-of-Seasons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/Temple-of-Seasons.png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/animals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/animals.png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/entities.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/entities.png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/gorons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/gorons.png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/link.png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/link2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/link2.png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/links_awakening_bosses.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/links_awakening_bosses.png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/links_awakening_items.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/links_awakening_items.png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/links_awakening_objects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/links_awakening_objects.png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/maku-tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/maku-tree.png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/ooa_enemies.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/ooa_enemies.png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/oracleofseasons-sprites-sheet-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/oracleofseasons-sprites-sheet-1.png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/oracleofseasons-sprites-sheet-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/oracleofseasons-sprites-sheet-3.png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/oracleofseasons-sprites-sheet-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/oracleofseasons-sprites-sheet-4.png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/sword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/sword.png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/tingle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/tingle.png -------------------------------------------------------------------------------- /resources/sprites/entity/zelda/zoras.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/entity/zelda/zoras.png -------------------------------------------------------------------------------- /resources/sprites/map/DezertZone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/map/DezertZone.png -------------------------------------------------------------------------------- /resources/sprites/map/meta.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/map/meta.png -------------------------------------------------------------------------------- /resources/sprites/map/zelda/map2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/map/zelda/map2.png -------------------------------------------------------------------------------- /resources/sprites/map/zelda/map_med.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/map/zelda/map_med.png -------------------------------------------------------------------------------- /resources/sprites/map/zelda/map_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/map/zelda/map_small.png -------------------------------------------------------------------------------- /resources/sprites/map/zelda/map_small2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennycason/java_games/ee4344deeac2caa52860ba6c7c3d16d15b6c87c0/resources/sprites/map/zelda/map_small2.png -------------------------------------------------------------------------------- /src/engine/AbstractGameLoop.java: -------------------------------------------------------------------------------- 1 | package engine; 2 | 3 | import java.awt.image.BufferedImage; 4 | 5 | public abstract class AbstractGameLoop { 6 | 7 | protected Game game; 8 | 9 | protected long transitionTime; 10 | 11 | protected long lastRefresh; 12 | 13 | protected final long refreshInterval = 30; 14 | 15 | protected AbstractGameLoop() { 16 | game = GameFactory.get(); 17 | } 18 | 19 | public abstract void start(); 20 | 21 | public abstract void run(); 22 | 23 | public abstract void end(); 24 | 25 | public abstract void draw(BufferedImage bi); 26 | 27 | public long transitionTime() { 28 | return transitionTime; 29 | } 30 | 31 | public void transitionTime(long transitionTime) { 32 | this.transitionTime = transitionTime; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/engine/FaceDirection.java: -------------------------------------------------------------------------------- 1 | package engine; 2 | 3 | public enum FaceDirection { 4 | 5 | NORTH, 6 | NORTH_EAST, 7 | EAST, 8 | SOUTH_EAST, 9 | SOUTH, 10 | SOUTH_WEST, 11 | WEST, 12 | NORTH_WEST 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/engine/GameFactory.java: -------------------------------------------------------------------------------- 1 | package engine; 2 | 3 | public class GameFactory { 4 | 5 | private static Game game; 6 | 7 | public static void set(Game g) { 8 | game = g; 9 | } 10 | 11 | public static Game get() { 12 | return game; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/engine/GameStateEnum.java: -------------------------------------------------------------------------------- 1 | package engine; 2 | 3 | public enum GameStateEnum { 4 | TITLE_SCREEN, 5 | MAIN, 6 | PAUSED, 7 | ITEM_SCREEN, 8 | DEAD, 9 | END 10 | } 11 | -------------------------------------------------------------------------------- /src/engine/ai/IAIStrategy.java: -------------------------------------------------------------------------------- 1 | package engine.ai; 2 | 3 | 4 | public interface IAIStrategy { 5 | 6 | void handle(); 7 | } 8 | -------------------------------------------------------------------------------- /src/engine/clock/Clock.java: -------------------------------------------------------------------------------- 1 | package engine.clock; 2 | 3 | public class Clock { 4 | 5 | private static Clock INSTANCE; 6 | 7 | private long milliseconds; 8 | 9 | private boolean running; 10 | 11 | private long startTime; 12 | 13 | private long stopTime; 14 | 15 | public static Clock getInstance() { 16 | if(INSTANCE == null) { 17 | INSTANCE = new Clock(); 18 | } 19 | return INSTANCE; 20 | } 21 | 22 | public Clock() { 23 | milliseconds = 0; 24 | stopTime = System.currentTimeMillis(); 25 | running = false; 26 | } 27 | 28 | public void start() { 29 | running = true; 30 | startTime = System.currentTimeMillis(); 31 | } 32 | 33 | public void stop() { 34 | milliseconds = 0; 35 | running = false; 36 | stopTime = System.currentTimeMillis(); 37 | } 38 | 39 | public void pause() { 40 | running = false; 41 | stopTime = System.currentTimeMillis(); 42 | milliseconds += stopTime - startTime; 43 | } 44 | 45 | public void reset() { 46 | stop(); 47 | start(); 48 | } 49 | 50 | public long elapsedMillis() { 51 | if(running) { 52 | return milliseconds + System.currentTimeMillis() - startTime; 53 | } else { 54 | return milliseconds; 55 | } 56 | } 57 | 58 | public long systemElapsedMillis() { 59 | return System.currentTimeMillis(); 60 | } 61 | 62 | public long elapsedSeconds() { 63 | return elapsedMillis() / 1000; 64 | } 65 | 66 | public boolean running() { 67 | return running; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/engine/config/ConfigBank.java: -------------------------------------------------------------------------------- 1 | package engine.config; 2 | 3 | import java.io.FileInputStream; 4 | import java.io.IOException; 5 | import java.io.InputStream; 6 | import java.util.Properties; 7 | 8 | import org.apache.log4j.Logger; 9 | 10 | public class ConfigBank extends Properties { 11 | 12 | private static final long serialVersionUID = 1L; 13 | 14 | private final static Logger LOGGER = Logger.getLogger(ConfigBank.class); 15 | 16 | public ConfigBank() { 17 | super(); 18 | load(); 19 | } 20 | 21 | public void load() { 22 | // first local for file 23 | try { 24 | InputStream is = new FileInputStream("game.config"); 25 | super.load(is); 26 | LOGGER.trace("Loaded user config"); 27 | } catch (Exception e) { // pokemon error handling 28 | // else load default config in resources 29 | try { 30 | super.load(getClass().getClassLoader().getResourceAsStream("config/default.config")); 31 | LOGGER.trace("Loaded default config"); 32 | } catch (IOException e1) { 33 | LOGGER.error("Default Config file failed to load"); 34 | e1.printStackTrace(); 35 | } 36 | } 37 | } 38 | 39 | /** 40 | * must override because super.contains(Object o) returns false when passing strings 41 | * @param key 42 | * @return 43 | */ 44 | public boolean contains(String key) { 45 | if(key == null) { 46 | return false; 47 | } 48 | for(Object k : super.keySet()) { 49 | if(key.equals(k)) { 50 | return true; 51 | } 52 | } 53 | return false; 54 | } 55 | 56 | public String getString(String key) { 57 | return (String)super.get(key); 58 | } 59 | 60 | public int getInt(String key) { 61 | return Integer.parseInt((String)super.get(key)); 62 | } 63 | 64 | public long getLong(String key) { 65 | return Long.parseLong((String)super.get(key)); 66 | } 67 | 68 | public float getFloat(String key) { 69 | return Float.parseFloat((String)super.get(key)); 70 | } 71 | 72 | public double getDouble(String key) { 73 | return Double.parseDouble((String)super.get(key)); 74 | } 75 | 76 | } -------------------------------------------------------------------------------- /src/engine/dialog/AbstractDialog.java: -------------------------------------------------------------------------------- 1 | package engine.dialog; 2 | 3 | import engine.sound.LoopingSound; 4 | import engine.Game; 5 | import engine.GameFactory; 6 | import engine.event.AbstractEvent; 7 | import engine.sound.AbstractSound; 8 | 9 | public abstract class AbstractDialog extends AbstractEvent { 10 | 11 | protected Game game; 12 | 13 | protected int textSpeed; 14 | 15 | protected boolean finished; 16 | 17 | protected long lastDraw; 18 | 19 | protected int x; 20 | 21 | protected int y; 22 | 23 | protected int width; 24 | 25 | protected int height; 26 | 27 | protected int currentChar; 28 | 29 | //protected int yOffs 30 | 31 | protected int page; 32 | 33 | protected int phase; 34 | 35 | protected String[] pages; 36 | 37 | protected LoopingSound textTyped; 38 | 39 | protected AbstractSound pageFinished; 40 | 41 | /** 42 | * Create a Single Paged Dialog 43 | * @param text 44 | * @param x 45 | * @param y 46 | */ 47 | public AbstractDialog(String text, int x, int y, int width, int height, int textSpeed) { 48 | this(new String[] {text}, x, y, width, height, textSpeed); 49 | } 50 | 51 | public AbstractDialog(String[] text, int x, int y, int width, int height, int textSpeed) { 52 | game = GameFactory.get(); 53 | pages = text; 54 | finished = false; 55 | this.x = x; 56 | this.y = y; 57 | this.width = width; 58 | this.height = height; 59 | this.textSpeed = textSpeed; 60 | currentChar = 1; 61 | page = 0; 62 | phase = 1; // 1 draw text, 2, wait for user to press enter 63 | textTyped = (LoopingSound) Game.sounds.get("dialog_typing"); 64 | pageFinished = Game.sounds.get("dialog_finished"); 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/engine/dialog/BasicDialog.java: -------------------------------------------------------------------------------- 1 | package engine.dialog; 2 | 3 | import java.awt.Color; 4 | import java.awt.Graphics2D; 5 | 6 | import engine.Game; 7 | import game.zelda.Buttons; 8 | 9 | public class BasicDialog extends AbstractDialog { 10 | 11 | public BasicDialog(String text, int x, int y, int width, int height, int textSpeed) { 12 | super(text, x, y, width, height, textSpeed); 13 | } 14 | 15 | public BasicDialog(String[] text, int x, int y, int width, int height, int textSpeed) { 16 | super(text, x, y, width, height, textSpeed); 17 | } 18 | 19 | 20 | private void drawString(Graphics2D g, String text, int x, int y) { 21 | int i = 0; 22 | for (String line : text.split("\n")) { 23 | if(i > 0) { 24 | y += g.getFontMetrics().getHeight(); 25 | } 26 | g.drawString(line, x, y); 27 | i++; 28 | } 29 | } 30 | 31 | @Override 32 | public void trigger() { 33 | happened = true; 34 | Game.clock.pause(); 35 | int originalTextSpeed = textSpeed; 36 | while(!finished) { 37 | if(phase == 1) { 38 | if(!textTyped.playing()) { 39 | textTyped.play(); 40 | } 41 | if(Game.clock.systemElapsedMillis() - lastDraw > textSpeed) { 42 | lastDraw = Game.clock.systemElapsedMillis(); 43 | Graphics2D g = game.screen().bufferedImage().createGraphics(); 44 | game.screen().draw(g, 0, 0); 45 | if(game.zoom() > 1) { 46 | g.scale(game.zoom(), game.zoom()); 47 | } 48 | g.setColor(Color.GRAY); 49 | g.fillRect(x, y, width, height); 50 | g.setColor(Color.BLACK); 51 | g.fillRect(x + 2, y + 2, width - 4, height - 4); 52 | 53 | g.setFont(Game.fonts.get("menu_small")); 54 | g.setColor(Color.WHITE); 55 | 56 | drawString(g, pages[page].substring(0, currentChar), x + 5, y + 15); 57 | 58 | g.dispose(); 59 | game.screenPanel().repaint(); 60 | 61 | if(currentChar >= pages[page].length()) { 62 | textTyped.stop(); 63 | phase = 2; 64 | game.sleep(200); 65 | pageFinished.play(); 66 | } 67 | currentChar++; 68 | } 69 | if(Game.keyboard.isKeyPressed(Buttons.ITEM_A)) { 70 | textSpeed = originalTextSpeed / 2; 71 | } else { 72 | textSpeed = originalTextSpeed; 73 | } 74 | } else if(phase == 2) { 75 | while(!Game.keyboard.isKeyPressed(Buttons.ITEM_A) && 76 | !Game.keyboard.isKeyPressed(Buttons.ITEM_B) && 77 | !Game.keyboard.isKeyPressed(Buttons.START)) { 78 | if(page >= pages.length) { 79 | finished = true; 80 | game.sleep(150); 81 | } else { 82 | page++; 83 | currentChar = 0; 84 | phase = 1; 85 | } 86 | } 87 | } 88 | } 89 | Game.clock.start(); 90 | } 91 | 92 | @Override 93 | public boolean ready() { 94 | return true; 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /src/engine/entity/AbstractCollidable.java: -------------------------------------------------------------------------------- 1 | package engine.entity; 2 | 3 | 4 | public abstract class AbstractCollidable { 5 | 6 | /** 7 | * represents last position drew to screen 8 | */ 9 | public int x; 10 | 11 | public int y; 12 | 13 | /** 14 | * used to make the "rectangle" in rectangle collision a bit smaller or larger 15 | */ 16 | protected int collisionOffset = 0; 17 | 18 | public int x() { 19 | return x; 20 | } 21 | 22 | public int y() { 23 | return y; 24 | } 25 | 26 | public void x(int x) { 27 | this.x = x; 28 | } 29 | 30 | public void y(int y) { 31 | this.y = y; 32 | } 33 | 34 | public void locate(int x, int y) { 35 | this.x = x; 36 | this.y = y; 37 | } 38 | 39 | /** 40 | * x position in tiled map array 41 | * @return 42 | */ 43 | public abstract int mapX(); 44 | 45 | /** 46 | * y position in tiled map array 47 | * @return 48 | */ 49 | public abstract int mapY(); 50 | 51 | public abstract int width(); 52 | 53 | public abstract int height(); 54 | 55 | public int collisionOffset() { 56 | return collisionOffset; 57 | } 58 | 59 | public void collisionOffset(int collisionOffset) { 60 | this.collisionOffset = collisionOffset; 61 | } 62 | 63 | public boolean rectangleCollide(AbstractCollidable entity) { 64 | if(entity.x() + entity.width() - entity.collisionOffset() < x() + collisionOffset() || 65 | x() + width() - collisionOffset() < entity.x() + entity.collisionOffset()) { 66 | return false; 67 | } 68 | if(entity.y() + entity.height() - entity.collisionOffset() < y() + collisionOffset() || 69 | y() + height() - collisionOffset() < entity.y() + entity.collisionOffset()) { 70 | return false; 71 | } 72 | return true; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/engine/entity/AbstractEntity.java: -------------------------------------------------------------------------------- 1 | package engine.entity; 2 | 3 | import engine.FaceDirection; 4 | import engine.Game; 5 | import engine.GameFactory; 6 | 7 | import java.awt.Graphics2D; 8 | 9 | public abstract class AbstractEntity extends AbstractCollidable { 10 | 11 | protected Game game; 12 | 13 | protected FaceDirection face; 14 | 15 | /** 16 | * used to make the "rectangle" in rectangle collision a bit smaller or larger 17 | */ 18 | 19 | public AbstractEntity() { 20 | game = GameFactory.get(); 21 | } 22 | 23 | public abstract void draw(Graphics2D g); 24 | 25 | public abstract void handle(); 26 | 27 | public void reset() { 28 | 29 | } 30 | 31 | public FaceDirection face() { 32 | return face; 33 | } 34 | 35 | public abstract void face(FaceDirection face); 36 | 37 | public int mapX() { 38 | return (x + width() / 2) / game.map().tileWidth(); 39 | } 40 | 41 | public int mapY() { 42 | return (y + height() / 2) / game.map().tileHeight(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/engine/entity/AbstractSimpleEntity.java: -------------------------------------------------------------------------------- 1 | package engine.entity; 2 | 3 | import engine.FaceDirection; 4 | import engine.graphics.sprite.AnimatedSprite; 5 | 6 | public abstract class AbstractSimpleEntity extends AbstractEntity { 7 | 8 | protected AnimatedSprite sprite; 9 | 10 | public AbstractSimpleEntity() { 11 | super(); 12 | } 13 | 14 | @Override 15 | public void handle() { 16 | 17 | } 18 | 19 | @Override 20 | public int width() { 21 | return sprite.width(); 22 | } 23 | 24 | @Override 25 | public int height() { 26 | return sprite.height(); 27 | } 28 | 29 | @Override 30 | public void face(FaceDirection face) { 31 | this.face = face; 32 | } 33 | 34 | public AnimatedSprite sprite() { 35 | return sprite; 36 | } 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /src/engine/entity/IEntity.java: -------------------------------------------------------------------------------- 1 | package engine.entity; 2 | 3 | public interface IEntity { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/engine/entity/enemy/AbstractEnemy.java: -------------------------------------------------------------------------------- 1 | package engine.entity.enemy; 2 | 3 | import java.util.LinkedList; 4 | import java.util.List; 5 | import java.util.Random; 6 | 7 | import engine.entity.item.AbstractItem; 8 | import engine.Game; 9 | import engine.entity.AbstractLivingEntity; 10 | 11 | public abstract class AbstractEnemy extends AbstractLivingEntity { 12 | 13 | protected List dropItems; 14 | 15 | protected int dropItemProbability = 100; 16 | 17 | private static Random random = new Random(); 18 | 19 | public AbstractEnemy() { 20 | super(); 21 | hitSound = Game.sounds.get("enemy_hit"); 22 | deadSound = Game.sounds.get("enemy_die"); 23 | dropItems = new LinkedList(); 24 | invincibleTime = 400; 25 | } 26 | 27 | @Override 28 | public void handle() { 29 | if(invincible) { 30 | if(Game.clock.elapsedMillis() - lastTimeHit > invincibleTime) { 31 | invincible = false; 32 | flickerCount = 0; 33 | } 34 | } 35 | } 36 | 37 | @Override 38 | public void hit(double damage) { 39 | super.hit(damage); 40 | if(dead()) { 41 | deadSound.play(); 42 | if(dropItems()) { 43 | for(AbstractItem item : dropItems) { 44 | item.locate(x() + -width() / 2 + random.nextInt(width()), y() + -height() / 2 + random.nextInt(height())); 45 | item.justDropped(); 46 | } 47 | game.map().items().addAll(dropItems); 48 | } 49 | } 50 | } 51 | 52 | public boolean dropItems() { 53 | int num = random.nextInt(100) + 1; 54 | if(num <= dropItemProbability) { 55 | return true; 56 | } 57 | return false; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/engine/entity/item/AbstractItem.java: -------------------------------------------------------------------------------- 1 | package engine.entity.item; 2 | 3 | import java.awt.Graphics2D; 4 | 5 | import engine.entity.AbstractLivingEntity; 6 | import engine.Game; 7 | import engine.entity.AbstractEntity; 8 | import engine.entity.AbstractSimpleEntity; 9 | 10 | public abstract class AbstractItem extends AbstractSimpleEntity { 11 | 12 | protected boolean consumed; 13 | 14 | protected boolean mustTouch; // if true link must physically touch the item to obtain. i.e. can't use boomerang/sword 15 | 16 | protected boolean disappearAfterConsume; 17 | 18 | protected boolean walkable; 19 | 20 | protected boolean justDropped; 21 | 22 | protected long droppedTime; 23 | 24 | protected AbstractEntity owner; 25 | 26 | public AbstractItem(AbstractEntity owner) { 27 | super(); 28 | this.owner = owner; 29 | consumed = false; 30 | mustTouch = false; 31 | walkable = true; 32 | disappearAfterConsume = true; 33 | justDropped = false; 34 | locate(0, 0); 35 | } 36 | 37 | @Override 38 | public void handle() { 39 | if(justDropped) { 40 | if(Game.clock.elapsedMillis() - droppedTime > 250) { 41 | justDropped = false; 42 | } 43 | } 44 | if(walkable) { 45 | if(rectangleCollide(owner)) { 46 | consume(); 47 | } 48 | } 49 | } 50 | 51 | @Override 52 | public void draw(Graphics2D g) { 53 | sprite.draw(g, x() + game.map().offset().x(), y() + game.map().offset().y()); 54 | } 55 | 56 | public abstract void consume(); 57 | 58 | public boolean consumed() { 59 | return consumed; 60 | } 61 | 62 | public boolean disappearAfterConsume() { 63 | return disappearAfterConsume; 64 | } 65 | 66 | public boolean walkable() { 67 | return walkable; 68 | } 69 | 70 | public boolean mustTouch() { 71 | return mustTouch; 72 | } 73 | 74 | public void justDropped() { 75 | justDropped = true; 76 | droppedTime = Game.clock.elapsedMillis(); 77 | } 78 | 79 | public boolean isJustDropped() { 80 | return justDropped; 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /src/engine/entity/usable/AbstractUsableEntity.java: -------------------------------------------------------------------------------- 1 | package engine.entity.usable; 2 | 3 | import java.awt.Graphics2D; 4 | 5 | import engine.entity.AbstractLivingEntity; 6 | import engine.FaceDirection; 7 | import engine.entity.AbstractEntity; 8 | 9 | public abstract class AbstractUsableEntity extends AbstractEntity { 10 | 11 | protected boolean using; 12 | 13 | protected AbstractLivingEntity user; 14 | 15 | public AbstractUsableEntity(AbstractLivingEntity user) { 16 | super(); 17 | this.user = user; 18 | } 19 | 20 | public abstract void draw(Graphics2D g); 21 | 22 | public abstract void use(); 23 | 24 | public abstract boolean using(); 25 | 26 | public abstract void handle(); 27 | 28 | public abstract void menuDraw(Graphics2D g, int x, int y); 29 | 30 | public abstract String menuDisplayName(); 31 | 32 | public void face(FaceDirection face) { 33 | 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/engine/entity/usable/AbstractWeapon.java: -------------------------------------------------------------------------------- 1 | package engine.entity.usable; 2 | 3 | import engine.entity.AbstractLivingEntity; 4 | 5 | 6 | public abstract class AbstractWeapon extends AbstractUsableEntity { 7 | 8 | protected double damage; 9 | 10 | public AbstractWeapon(AbstractLivingEntity user) { 11 | super(user); 12 | } 13 | 14 | public double damage() { 15 | return damage; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/engine/entity/usable/UsableBank.java: -------------------------------------------------------------------------------- 1 | package engine.entity.usable; 2 | 3 | import java.util.HashMap; 4 | 5 | public class UsableBank { 6 | 7 | private HashMap resources = new HashMap(); 8 | 9 | public UsableBank() { 10 | } 11 | 12 | public void set(String key, AbstractUsableEntity sprite) { 13 | resources.put(key, sprite); 14 | } 15 | 16 | public AbstractUsableEntity get(String resource) { 17 | return resources.get(resource); 18 | } 19 | 20 | public HashMap all() { 21 | return resources; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/engine/event/AbstractEnemiesDeadEvent.java: -------------------------------------------------------------------------------- 1 | package engine.event; 2 | 3 | public abstract class AbstractEnemiesDeadEvent extends AbstractEvent { 4 | 5 | public AbstractEnemiesDeadEvent() { 6 | super(); 7 | } 8 | 9 | @Override 10 | public boolean ready() { 11 | // still more enemies to come! 12 | for(IEvent event : game.map().events().all()) { 13 | if(event instanceof IEnemyEvent) { 14 | return false; 15 | } 16 | } 17 | return game.map().enemies().size() == 0; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/engine/event/AbstractEvent.java: -------------------------------------------------------------------------------- 1 | package engine.event; 2 | 3 | import engine.Game; 4 | import engine.GameFactory; 5 | 6 | public abstract class AbstractEvent implements IEvent { 7 | 8 | protected Game game; 9 | 10 | protected boolean happened; 11 | 12 | public AbstractEvent() { 13 | happened = false; 14 | game = GameFactory.get(); 15 | } 16 | 17 | public boolean happened() { 18 | return happened; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/engine/event/AbstractTimedDeployableEvent.java: -------------------------------------------------------------------------------- 1 | package engine.event; 2 | 3 | import engine.Game; 4 | 5 | 6 | public abstract class AbstractTimedDeployableEvent extends AbstractEvent { 7 | 8 | protected long createdTime; 9 | 10 | protected long deployTime; 11 | 12 | public AbstractTimedDeployableEvent(long deployTime) { 13 | this.deployTime = deployTime; 14 | createdTime = Game.clock.elapsedMillis(); 15 | } 16 | 17 | @Override 18 | public boolean ready() { 19 | return Game.clock.elapsedMillis() - createdTime > deployTime; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/engine/event/ConsumeItemEvent.java: -------------------------------------------------------------------------------- 1 | package engine.event; 2 | 3 | import engine.entity.item.AbstractItem; 4 | 5 | public class ConsumeItemEvent extends AbstractEvent { 6 | 7 | private AbstractItem item; 8 | 9 | public ConsumeItemEvent(AbstractItem item) { 10 | super(); 11 | this.item = item; 12 | } 13 | 14 | @Override 15 | public void trigger() { 16 | happened = true; 17 | if(item != null) { 18 | item.consume(); 19 | } 20 | } 21 | 22 | @Override 23 | public boolean ready() { 24 | return true; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/engine/event/EnemiesDeadItemAppearEvent.java: -------------------------------------------------------------------------------- 1 | package engine.event; 2 | 3 | import engine.Game; 4 | import engine.entity.item.AbstractItem; 5 | import engine.sound.AbstractSound; 6 | 7 | 8 | public class EnemiesDeadItemAppearEvent extends AbstractEnemiesDeadEvent { 9 | 10 | private AbstractItem item; 11 | 12 | private AbstractSound sound; 13 | 14 | public EnemiesDeadItemAppearEvent(AbstractItem item) { 15 | super(); 16 | this.item = item; 17 | sound = Game.sounds.get("secret"); 18 | } 19 | 20 | @Override 21 | public void trigger() { 22 | sound.play(); 23 | game.map().items().add(item); 24 | happened = true; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/engine/event/EnemyDeployEvent.java: -------------------------------------------------------------------------------- 1 | package engine.event; 2 | 3 | import engine.entity.enemy.AbstractEnemy; 4 | 5 | public class EnemyDeployEvent extends AbstractEvent implements IEnemyEvent { 6 | 7 | protected AbstractEnemy enemy; 8 | 9 | public EnemyDeployEvent(AbstractEnemy enemy) { 10 | super(); 11 | this.enemy = enemy; 12 | } 13 | 14 | @Override 15 | public void trigger() { 16 | game.map().enemies().add(enemy); 17 | } 18 | 19 | @Override 20 | public boolean ready() { 21 | return true; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/engine/event/EventQueue.java: -------------------------------------------------------------------------------- 1 | package engine.event; 2 | 3 | import java.util.Iterator; 4 | import java.util.LinkedList; 5 | import java.util.List; 6 | 7 | 8 | public class EventQueue { 9 | 10 | private List events; 11 | 12 | public EventQueue() { 13 | events = new LinkedList(); 14 | } 15 | 16 | public void add(IEvent event) { 17 | events.add(event); 18 | } 19 | 20 | public void add(List events) { 21 | this.events.addAll(events); 22 | } 23 | 24 | public List all() { 25 | return events; 26 | } 27 | 28 | public void handle() { 29 | // handle all events 30 | Iterator iter = events.iterator(); 31 | while(iter.hasNext()) { 32 | IEvent event = iter.next(); 33 | if(event.ready()) { 34 | event.trigger(); 35 | iter.remove(); 36 | } 37 | } 38 | } 39 | 40 | public int size() { 41 | return events.size(); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/engine/event/IEnemyEvent.java: -------------------------------------------------------------------------------- 1 | package engine.event; 2 | 3 | public interface IEnemyEvent extends IEvent { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/engine/event/IEvent.java: -------------------------------------------------------------------------------- 1 | package engine.event; 2 | 3 | public interface IEvent { 4 | 5 | void trigger(); 6 | 7 | boolean happened(); 8 | 9 | boolean ready(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/engine/event/TimedDialogDeployEvent.java: -------------------------------------------------------------------------------- 1 | package engine.event; 2 | 3 | import engine.dialog.AbstractDialog; 4 | 5 | public class TimedDialogDeployEvent extends AbstractTimedDeployableEvent { 6 | 7 | protected AbstractDialog dialog; 8 | 9 | public TimedDialogDeployEvent(AbstractDialog dialog, long deployTime) { 10 | super(deployTime); 11 | this.dialog = dialog; 12 | } 13 | 14 | @Override 15 | public void trigger() { 16 | dialog.trigger(); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/engine/event/TimedEnemyDeployEvent.java: -------------------------------------------------------------------------------- 1 | package engine.event; 2 | 3 | import engine.entity.enemy.AbstractEnemy; 4 | 5 | public class TimedEnemyDeployEvent extends AbstractTimedDeployableEvent { 6 | 7 | protected AbstractEnemy enemy; 8 | 9 | public TimedEnemyDeployEvent(AbstractEnemy enemy, long deployTime) { 10 | super(deployTime); 11 | this.enemy = enemy; 12 | } 13 | 14 | @Override 15 | public void trigger() { 16 | game.map().enemies().add(enemy); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/engine/font/FontBank.java: -------------------------------------------------------------------------------- 1 | package engine.font; 2 | 3 | import java.awt.Font; 4 | import java.util.HashMap; 5 | 6 | import org.apache.log4j.Logger; 7 | 8 | public class FontBank { 9 | 10 | private HashMap resources = new HashMap(); 11 | 12 | private final static Logger LOGGER = Logger.getLogger(FontBank.class.getName()); 13 | 14 | public FontBank() { 15 | } 16 | 17 | public void set(String key, Font font) { 18 | LOGGER.debug("loading new font: " + key + " - " + font.toString()); 19 | resources.put(key, font); 20 | } 21 | 22 | public Font get(String key) { 23 | return resources.get(key); 24 | } 25 | 26 | public int size() { 27 | return resources.size(); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/engine/graphics/shape/AbstractShape.java: -------------------------------------------------------------------------------- 1 | package engine.graphics.shape; 2 | 3 | import java.awt.Color; 4 | 5 | import javax.media.opengl.GL2; 6 | 7 | import engine.math.Vector3D; 8 | import engine.entity.AbstractCollidable; 9 | 10 | public abstract class AbstractShape extends AbstractCollidable { 11 | 12 | protected Color color; 13 | 14 | protected Vector3D rot; 15 | 16 | protected AbstractShape() { 17 | super(); 18 | rot = new Vector3D(); 19 | color = Color.WHITE; 20 | } 21 | 22 | public abstract void draw(final GL2 gl); 23 | 24 | public void rotate(double x, double y, double z) { 25 | rot.x(x); 26 | rot.y(y); 27 | rot.z(z); 28 | } 29 | 30 | public Color color() { 31 | return color; 32 | } 33 | 34 | public void color(int rgb) { 35 | color = new Color(rgb); 36 | } 37 | 38 | public void color(Color color) { 39 | this.color = color; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/engine/graphics/shape/Circle.java: -------------------------------------------------------------------------------- 1 | package engine.graphics.shape; 2 | 3 | import javax.media.opengl.GL2; 4 | 5 | public class Circle extends AbstractShape { 6 | 7 | private static double increment = 2 * Math.PI / 50; 8 | 9 | private int radius; 10 | 11 | public Circle(int radius) { 12 | this.radius = radius; 13 | } 14 | 15 | @Override 16 | public void draw(GL2 gl) { 17 | gl.glLoadIdentity(); 18 | gl.glTranslated(x() + radius, y() + radius, 0); 19 | gl.glRotated(rot.x(), 1.0, 0, 0); 20 | gl.glRotated(rot.y(), 0, 1.0, 0); 21 | gl.glRotated(rot.z(), 0, 0, 1.0); 22 | gl.glColor3f(color.getRed(), color.getGreen(), color.getBlue()); 23 | 24 | // Starting loop for drawing triangles 25 | for (double angle = 0; angle < 2 * Math.PI; angle += increment) { 26 | gl.glBegin(GL2.GL_POLYGON); 27 | // One vertex of each triangle is at center of circle 28 | gl.glVertex2d(0, 0); 29 | // Other two vertices form the periphery of the circle 30 | gl.glVertex2d(Math.cos(angle) * radius, Math.sin(angle) * radius); 31 | gl.glVertex2d(Math.cos(angle + increment) * radius, Math.sin(angle + increment) * radius); 32 | gl.glEnd(); 33 | } 34 | } 35 | 36 | @Override 37 | public int mapX() { 38 | return 0; 39 | } 40 | 41 | @Override 42 | public int mapY() { 43 | return 0; 44 | } 45 | 46 | @Override 47 | public int width() { 48 | return radius * 2; 49 | } 50 | 51 | @Override 52 | public int height() { 53 | return radius * 2; 54 | } 55 | 56 | public int radius() { 57 | return radius; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/engine/graphics/shape/Cube.java: -------------------------------------------------------------------------------- 1 | package engine.graphics.shape; 2 | 3 | import javax.media.opengl.GL2; 4 | 5 | public class Cube extends AbstractShape { 6 | 7 | private int dim; 8 | 9 | public Cube(int dim) { 10 | this.dim = dim; 11 | } 12 | 13 | @Override 14 | public void draw(GL2 gl) { 15 | gl.glLoadIdentity(); 16 | gl.glTranslated(x(), y(), 0); 17 | gl.glRotated(rot.x(), 1.0, 0, 0); 18 | gl.glRotated(rot.y(), 0, 1.0, 0); 19 | gl.glRotated(rot.z(), 0, 0, 1.0); 20 | gl.glColor3f(color.getRed(), color.getGreen(), color.getBlue()); 21 | 22 | gl.glBegin(GL2.GL_POLYGON);/* f1: front */ 23 | gl.glNormal3f(-dim, 0.0f, 0.0f); 24 | gl.glVertex3f(0.0f, 0.0f, 0.0f); 25 | gl.glVertex3f(0.0f, 0.0f, dim); 26 | gl.glVertex3f(dim, 0.0f, dim); 27 | gl.glVertex3f(dim, 0.0f, 0.0f); 28 | gl.glEnd(); 29 | 30 | gl.glBegin(GL2.GL_POLYGON);/* f2: bottom */ 31 | gl.glNormal3f(0.0f, 0.0f, -dim); 32 | gl.glVertex3f(0.0f, 0.0f, 0.0f); 33 | gl.glVertex3f(dim, 0.0f, 0.0f); 34 | gl.glVertex3f(dim, dim, 0.0f); 35 | gl.glVertex3f(0.0f, dim, 0.0f); 36 | gl.glEnd(); 37 | 38 | gl.glBegin(GL2.GL_POLYGON);/* f3:back */ 39 | gl.glNormal3f(dim, 0.0f, 0.0f); 40 | gl.glVertex3f(dim, dim, 0.0f); 41 | gl.glVertex3f(dim, dim, dim); 42 | gl.glVertex3f(0.0f, dim, dim); 43 | gl.glVertex3f(0.0f, dim, 0.0f); 44 | gl.glEnd(); 45 | 46 | gl.glBegin(GL2.GL_POLYGON);/* f4: top */ 47 | gl.glNormal3f(0.0f, 0.0f, dim); 48 | gl.glVertex3f(dim, dim, dim); 49 | gl.glVertex3f(dim, 0.0f, dim); 50 | gl.glVertex3f(0.0f, 0.0f, dim); 51 | gl.glVertex3f(0.0f, dim, dim); 52 | gl.glEnd(); 53 | 54 | gl.glBegin(GL2.GL_POLYGON);/* f5: left */ 55 | gl.glNormal3f(0.0f, dim, 0.0f); 56 | gl.glVertex3f(0.0f, 0.0f, 0.0f); 57 | gl.glVertex3f(0.0f, dim, 0.0f); 58 | gl.glVertex3f(0.0f, dim, dim); 59 | gl.glVertex3f(0.0f, 0.0f, dim); 60 | gl.glEnd(); 61 | 62 | gl.glBegin(GL2.GL_POLYGON);/* f6: right */ 63 | gl.glNormal3f(0.0f, -dim, 0.0f); 64 | gl.glVertex3f(dim, 0.0f, 0.0f); 65 | gl.glVertex3f(dim, 0.0f, dim); 66 | gl.glVertex3f(dim, dim, dim); 67 | gl.glVertex3f(dim, dim, 0.0f); 68 | gl.glEnd(); 69 | 70 | } 71 | 72 | @Override 73 | public int mapX() { 74 | return 0; 75 | } 76 | 77 | @Override 78 | public int mapY() { 79 | return 0; 80 | } 81 | 82 | @Override 83 | public int width() { 84 | return dim; 85 | } 86 | 87 | @Override 88 | public int height() { 89 | return dim; 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /src/engine/graphics/shape/EmptyCircle.java: -------------------------------------------------------------------------------- 1 | package engine.graphics.shape; 2 | 3 | import javax.media.opengl.GL2; 4 | 5 | public class EmptyCircle extends AbstractShape { 6 | 7 | private final static float DEG2RAD = (float) (Math.PI / 180); 8 | 9 | private int radius; 10 | 11 | public EmptyCircle(int radius) { 12 | this.radius = radius; 13 | } 14 | 15 | @Override 16 | public void draw(GL2 gl) { 17 | gl.glLoadIdentity(); 18 | gl.glTranslated(x() + radius, y() + radius, 0); 19 | gl.glRotated(rot.x(), 1.0, 0, 0); 20 | gl.glRotated(rot.y(), 0, 1.0, 0); 21 | gl.glRotated(rot.z(), 0, 0, 1.0); 22 | gl.glColor3f(color.getRed(), color.getGreen(), color.getBlue()); 23 | 24 | gl.glLineWidth(1f); 25 | gl.glBegin(GL2.GL_LINE_LOOP); 26 | for (int i = 0; i <= 360; i++) { 27 | float degInRad = i * DEG2RAD; 28 | gl.glVertex2d(Math.cos(degInRad) * radius, Math.sin(degInRad) * radius); 29 | } 30 | 31 | gl.glEnd(); 32 | } 33 | 34 | @Override 35 | public int mapX() { 36 | return 0; 37 | } 38 | 39 | @Override 40 | public int mapY() { 41 | return 0; 42 | } 43 | 44 | @Override 45 | public int width() { 46 | return radius * 2; 47 | } 48 | 49 | @Override 50 | public int height() { 51 | return radius * 2; 52 | } 53 | 54 | public int radius() { 55 | return radius; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/engine/graphics/shape/EmptyHalfCircle.java: -------------------------------------------------------------------------------- 1 | package engine.graphics.shape; 2 | 3 | import javax.media.opengl.GL2; 4 | 5 | public class EmptyHalfCircle extends AbstractShape { 6 | 7 | private int radius; 8 | 9 | public EmptyHalfCircle(int radius) { 10 | this.radius = radius; 11 | } 12 | 13 | @Override 14 | public void draw(GL2 gl) { 15 | gl.glLoadIdentity(); 16 | gl.glTranslated(x() + radius, y() + radius, 0); 17 | gl.glRotated(rot.x(), 1.0, 0, 0); 18 | gl.glRotated(rot.y(), 0, 1.0, 0); 19 | gl.glRotated(rot.z(), 0, 0, 1.0); 20 | gl.glColor3f(color.getRed(), color.getGreen(), color.getBlue()); 21 | 22 | gl.glBegin(GL2.GL_LINE_LOOP); 23 | for (int i = 0; i <= 100; i++) { 24 | float angle = (float) (i * Math.PI / 100.0); 25 | gl.glVertex2d((Math.cos(angle) * radius), y() + (Math.sin(angle) * radius)); 26 | } 27 | gl.glEnd(); 28 | } 29 | 30 | @Override 31 | public int mapX() { 32 | return 0; 33 | } 34 | 35 | @Override 36 | public int mapY() { 37 | return 0; 38 | } 39 | 40 | @Override 41 | public int width() { 42 | return radius * 2; 43 | } 44 | 45 | @Override 46 | public int height() { 47 | return radius * 2; 48 | } 49 | 50 | public int radius() { 51 | return radius; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/engine/graphics/shape/GradientCircle.java: -------------------------------------------------------------------------------- 1 | package engine.graphics.shape; 2 | 3 | import java.awt.Color; 4 | 5 | import javax.media.opengl.GL2; 6 | 7 | public class GradientCircle extends AbstractShape { 8 | 9 | private static double increment = 2 * Math.PI / 50; 10 | 11 | private int radius; 12 | 13 | private Color innerColor; 14 | 15 | public GradientCircle(int radius, Color outerColor, Color innerColor) { 16 | this.radius = radius; 17 | color = outerColor; 18 | this.innerColor = innerColor; 19 | } 20 | 21 | @Override 22 | public void draw(GL2 gl) { 23 | gl.glLoadIdentity(); 24 | gl.glTranslated(x() + radius, y() + radius, 0); 25 | gl.glRotated(rot.x(), 1.0, 0, 0); 26 | gl.glRotated(rot.y(), 0, 1.0, 0); 27 | gl.glRotated(rot.z(), 0, 0, 1.0); 28 | gl.glColor3f(color.getRed(), color.getGreen(), color.getBlue()); 29 | 30 | 31 | // Starting loop for drawing triangles 32 | for (double angle = 0; angle < 2 * Math.PI; angle += increment) { 33 | gl.glBegin(GL2.GL_POLYGON); 34 | // One vertex of each triangle is at center of circle 35 | gl.glColor3f(innerColor.getRed(), innerColor.getGreen(), innerColor.getBlue()); 36 | gl.glVertex2d(0, 0); 37 | gl.glColor3f(color.getRed(), color.getGreen(), color.getBlue()); 38 | // Other two vertices form the periphery of the circle 39 | gl.glVertex2d(Math.cos(angle) * radius, Math.sin(angle) * radius); 40 | gl.glVertex2d(Math.cos(angle + increment) * radius, Math.sin(angle + increment) * radius); 41 | gl.glEnd(); 42 | } 43 | } 44 | 45 | @Override 46 | public int mapX() { 47 | return 0; 48 | } 49 | 50 | @Override 51 | public int mapY() { 52 | return 0; 53 | } 54 | 55 | @Override 56 | public int width() { 57 | return radius * 2; 58 | } 59 | 60 | @Override 61 | public int height() { 62 | return radius * 2; 63 | } 64 | 65 | public int radius() { 66 | return radius; 67 | } 68 | 69 | public void innerColor(Color color) { 70 | innerColor = color; 71 | } 72 | 73 | public void outerColor(Color color) { 74 | this.color = color; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/engine/graphics/shape/Polygon.java: -------------------------------------------------------------------------------- 1 | package engine.graphics.shape; 2 | 3 | import javax.media.opengl.GL2; 4 | 5 | import engine.math.Vector2D; 6 | 7 | public class Polygon extends AbstractShape { 8 | 9 | private int size; 10 | 11 | private double smallestX = Integer.MAX_VALUE; 12 | 13 | private double largestX = Integer.MIN_VALUE; 14 | 15 | private double smallestY = Integer.MAX_VALUE; 16 | 17 | private double largestY = Integer.MIN_VALUE; 18 | 19 | private Vector2D[] vectors; 20 | 21 | public Polygon(Vector2D ... vectors) { 22 | size = vectors.length; 23 | this.vectors = new Vector2D[size]; 24 | for(int i = 0; i < size; i++) { 25 | this.vectors[i] = vectors[i].clone(); 26 | if(vectors[i].x() < smallestX) { 27 | smallestX = vectors[i].x(); 28 | } 29 | if(vectors[i].x() < largestX) { 30 | largestX = vectors[i].x(); 31 | } 32 | if(vectors[i].y() < smallestY) { 33 | smallestY = vectors[i].y(); 34 | } 35 | if(vectors[i].y() < largestY) { 36 | largestY = vectors[i].y(); 37 | } 38 | } 39 | } 40 | 41 | @Override 42 | public void draw(GL2 gl) { 43 | gl.glLoadIdentity(); 44 | gl.glTranslated(x(), y(), 0); 45 | gl.glRotated(rot.x(), 1.0, 0, 0); 46 | gl.glRotated(rot.y(), 0, 1.0, 0); 47 | gl.glRotated(rot.z(), 0, 0, 1.0); 48 | gl.glColor3f(color.getRed(), color.getGreen(), color.getBlue()); 49 | 50 | gl.glBegin(GL2.GL_POLYGON); 51 | for (Vector2D v : vectors) { 52 | gl.glVertex3d(v.x(), v.y(), 0); 53 | } 54 | gl.glEnd(); 55 | } 56 | 57 | @Override 58 | public int mapX() { 59 | return 0; 60 | } 61 | 62 | @Override 63 | public int mapY() { 64 | return 0; 65 | } 66 | 67 | @Override 68 | public int width() { 69 | return (int)(largestX - smallestX); 70 | } 71 | 72 | @Override 73 | public int height() { 74 | return (int)(largestY - smallestY); 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/engine/graphics/shape/Square.java: -------------------------------------------------------------------------------- 1 | package engine.graphics.shape; 2 | 3 | import javax.media.opengl.GL2; 4 | 5 | public class Square extends AbstractShape { 6 | 7 | private int dim; 8 | 9 | public Square(int dim) { 10 | this.dim = dim; 11 | } 12 | 13 | @Override 14 | public void draw(GL2 gl) { 15 | gl.glLoadIdentity(); 16 | gl.glTranslated(x(), y(), 0); 17 | gl.glRotated(rot.x(), 1.0, 0, 0); 18 | gl.glRotated(rot.y(), 0, 1.0, 0); 19 | gl.glRotated(rot.z(), 0, 0, 1.0); 20 | gl.glColor3f(color.getRed(), color.getGreen(), color.getBlue()); 21 | 22 | gl.glBegin(GL2.GL_QUADS); 23 | gl.glVertex3f(0, 0, 0); 24 | gl.glVertex3f(dim, 0, 0); 25 | gl.glVertex3f(dim, dim, 0); 26 | gl.glVertex3f(0, dim, 0); 27 | gl.glEnd(); 28 | } 29 | 30 | @Override 31 | public int mapX() { 32 | return 0; 33 | } 34 | 35 | @Override 36 | public int mapY() { 37 | return 0; 38 | } 39 | 40 | @Override 41 | public int width() { 42 | return dim; 43 | } 44 | 45 | @Override 46 | public int height() { 47 | return dim; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/engine/graphics/shape/Triangle.java: -------------------------------------------------------------------------------- 1 | package engine.graphics.shape; 2 | 3 | import javax.media.opengl.GL2; 4 | 5 | public class Triangle extends AbstractShape { 6 | 7 | private int width; 8 | 9 | private int height; 10 | 11 | public Triangle(int width, int height) { 12 | this.width = width; 13 | this.height = height; 14 | } 15 | 16 | @Override 17 | public void draw(GL2 gl) { 18 | gl.glLoadIdentity(); 19 | gl.glTranslated(x(), y(), 0); 20 | gl.glRotated(rot.x(), 1.0, 0, 0); 21 | gl.glRotated(rot.y(), 0, 1.0, 0); 22 | gl.glRotated(rot.z(), 0, 0, 1.0); 23 | gl.glColor3f(color.getRed(), color.getGreen(), color.getBlue()); 24 | 25 | gl.glBegin(GL2.GL_TRIANGLES); 26 | gl.glVertex3f(0, height, 0.0f); 27 | gl.glVertex3f(width / 2.0f, 0, 0.0f); 28 | gl.glVertex3f(width, height, 0.0f); 29 | gl.glEnd(); 30 | } 31 | 32 | @Override 33 | public int mapX() { 34 | return 0; 35 | } 36 | 37 | @Override 38 | public int mapY() { 39 | return 0; 40 | } 41 | 42 | @Override 43 | public int width() { 44 | return width; 45 | } 46 | 47 | @Override 48 | public int height() { 49 | return height; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/engine/graphics/sprite/AbstractSprite.java: -------------------------------------------------------------------------------- 1 | package engine.graphics.sprite; 2 | 3 | import engine.entity.AbstractCollidable; 4 | 5 | public abstract class AbstractSprite extends AbstractCollidable implements ISprite, ISpriteBankResource { 6 | 7 | protected int spriteWidth; 8 | 9 | protected int spriteHeight; 10 | 11 | @Override 12 | public int width() { 13 | return spriteWidth; 14 | } 15 | 16 | @Override 17 | public int height() { 18 | return spriteHeight; 19 | } 20 | 21 | @Override 22 | public int mapX() { 23 | return 0; 24 | } 25 | 26 | @Override 27 | public int mapY() { 28 | return 0; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/engine/graphics/sprite/ISprite.java: -------------------------------------------------------------------------------- 1 | package engine.graphics.sprite; 2 | 3 | import java.awt.Graphics; 4 | 5 | public interface ISprite { 6 | 7 | void draw(Graphics g, int x, int y); 8 | 9 | int width(); 10 | 11 | int height(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/engine/graphics/sprite/ISpriteBankResource.java: -------------------------------------------------------------------------------- 1 | package engine.graphics.sprite; 2 | 3 | public interface ISpriteBankResource { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/engine/graphics/sprite/SpriteBank.java: -------------------------------------------------------------------------------- 1 | package engine.graphics.sprite; 2 | 3 | import java.util.HashMap; 4 | 5 | import org.apache.log4j.Logger; 6 | 7 | public class SpriteBank { 8 | 9 | private HashMap resources = new HashMap(); 10 | 11 | private final static Logger LOGGER = Logger.getLogger(SpriteBank.class.getName()); 12 | 13 | public SpriteBank() { 14 | } 15 | 16 | public void set(String key, ISpriteBankResource sprite) { 17 | LOGGER.debug("loading new sprite: " + key); 18 | resources.put(key, sprite); 19 | } 20 | 21 | public ISpriteBankResource get(String key) { 22 | return resources.get(key); 23 | } 24 | 25 | public int size() { 26 | return resources.size(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/engine/graphics/sprite/SpriteSheet.java: -------------------------------------------------------------------------------- 1 | package engine.graphics.sprite; 2 | 3 | import java.awt.Graphics2D; 4 | import java.awt.image.BufferedImage; 5 | 6 | public class SpriteSheet implements ISpriteBankResource { 7 | 8 | private SimpleSprite[] sprites; 9 | 10 | private int tileWidth; 11 | 12 | private int tileHeight; 13 | 14 | private int numTiles; 15 | 16 | public SpriteSheet(int numTiles, int width, int height) { 17 | sprites = new SimpleSprite[numTiles]; 18 | this.numTiles = numTiles; 19 | this.tileWidth = width; 20 | this.tileHeight = height; 21 | } 22 | 23 | public SpriteSheet(String filename, int width, int height) { 24 | this(new SimpleSprite(filename), width, height); 25 | } 26 | 27 | public SpriteSheet(SimpleSprite sprite, int width, int height) { 28 | this.tileWidth = width; 29 | this.tileHeight = height; 30 | int numTilesX = sprite.width() / width; 31 | int numTilesY = sprite.height() / height; 32 | numTiles = numTilesX * numTilesY; 33 | sprites = new SimpleSprite[numTiles]; 34 | for(int y = 0; y < numTilesY; y++) { 35 | for(int x = 0; x < numTilesX; x++) { 36 | BufferedImage dest = new BufferedImage(width, height, 37 | BufferedImage.TYPE_INT_ARGB); 38 | Graphics2D g2 = dest.createGraphics(); 39 | int startX = x * width; 40 | int startY = y * height; 41 | g2.drawImage(sprite.bufferedImage(), 42 | 0, 0, width, height, 43 | startX, startY, startX + width, startY + height, 44 | null); 45 | g2.dispose(); 46 | sprites[y * numTilesX + x] = new SimpleSprite(dest); 47 | } 48 | } 49 | } 50 | 51 | public SpriteSheet range(int start, int end) { 52 | int num = end - start + 1; 53 | SpriteSheet sheet = new SpriteSheet(num, tileWidth(), tileHeight()); 54 | for(int i = 0; i < num; i++) { 55 | sheet.set(i, this.get(start + i)); 56 | } 57 | return sheet; 58 | } 59 | 60 | public SpriteSheet range(int index) { 61 | int num = 1; 62 | SpriteSheet sheet = new SpriteSheet(num, tileWidth(), tileHeight()); 63 | for(int i = 0; i < num; i++) { 64 | sheet.set(i, this.get(index + i)); 65 | } 66 | return sheet; 67 | } 68 | 69 | public SpriteSheet getRange(int[] indexes) { 70 | SpriteSheet sheet = new SpriteSheet(indexes.length, tileWidth(), tileHeight()); 71 | for(int i = 0; i < numTiles; i++) { 72 | sheet.set(i, this.get(indexes[i])); 73 | } 74 | return sheet; 75 | } 76 | 77 | public SimpleSprite get(int i) { 78 | return sprites[i]; 79 | } 80 | 81 | public void set(int i, SimpleSprite sprite) { 82 | sprites[i] = sprite; 83 | } 84 | 85 | public int numTiles() { 86 | return numTiles; 87 | } 88 | 89 | public int tileWidth() { 90 | return tileWidth; 91 | } 92 | 93 | public int tileHeight() { 94 | return tileHeight; 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /src/engine/il8n/StringBank.java: -------------------------------------------------------------------------------- 1 | package engine.il8n; 2 | 3 | import java.util.Locale; 4 | import java.util.ResourceBundle; 5 | 6 | public class StringBank { 7 | 8 | private final ResourceBundle texts; 9 | 10 | public StringBank(Locale locale) { 11 | texts = ResourceBundle.getBundle("il8n/texts", locale, new Utf8Control()); 12 | } 13 | 14 | //Overloading to allow default parameter 15 | public String get(String key){ 16 | return get(key, (Object[])null); 17 | } 18 | 19 | public String get(String key, Object ... o){ 20 | if(o == null){ 21 | return texts.getString(key); 22 | } else { 23 | String str = texts.getString(key); 24 | for(int i = 0; i < o.length; i++) { 25 | str = str.replace("{" + i + "}", o[i].toString()); 26 | } 27 | return str; 28 | } 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /src/engine/il8n/Utf8Control.java: -------------------------------------------------------------------------------- 1 | package engine.il8n; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | import java.io.InputStreamReader; 6 | import java.net.URL; 7 | import java.net.URLConnection; 8 | import java.util.Locale; 9 | import java.util.PropertyResourceBundle; 10 | import java.util.ResourceBundle; 11 | import java.util.ResourceBundle.Control; 12 | 13 | public class Utf8Control extends Control { 14 | 15 | /** 16 | * http://stackoverflow.com/questions/4659929/how-to-use-utf-8-in-resource-properties-with-resourcebundle 17 | */ 18 | public ResourceBundle newBundle(String baseName, Locale locale, 19 | String format, ClassLoader loader, boolean reload) 20 | throws IllegalAccessException, InstantiationException, IOException { 21 | // The below is a copy of the default implementation. 22 | String bundleName = toBundleName(baseName, locale); 23 | String resourceName = toResourceName(bundleName, "properties"); 24 | ResourceBundle bundle = null; 25 | InputStream stream = null; 26 | if (reload) { 27 | URL url = loader.getResource(resourceName); 28 | if (url != null) { 29 | URLConnection connection = url.openConnection(); 30 | if (connection != null) { 31 | connection.setUseCaches(false); 32 | stream = connection.getInputStream(); 33 | } 34 | } 35 | } else { 36 | stream = loader.getResourceAsStream(resourceName); 37 | } 38 | if (stream != null) { 39 | try { 40 | // Only this line is changed to make it to read properties files 41 | // as UTF-8. 42 | bundle = new PropertyResourceBundle(new InputStreamReader( 43 | stream, "UTF-8")); 44 | } finally { 45 | stream.close(); 46 | } 47 | } 48 | return bundle; 49 | } 50 | } -------------------------------------------------------------------------------- /src/engine/keyboard/DefaultKeyEventDispatcher.java: -------------------------------------------------------------------------------- 1 | package engine.keyboard; 2 | 3 | import java.awt.KeyEventDispatcher; 4 | import java.awt.event.KeyEvent; 5 | 6 | public class DefaultKeyEventDispatcher implements KeyEventDispatcher { 7 | 8 | private KeyBoard keyboard; 9 | 10 | public DefaultKeyEventDispatcher(KeyBoard keyboard) { 11 | this.keyboard = keyboard; 12 | } 13 | 14 | @Override 15 | public boolean dispatchKeyEvent(KeyEvent e) { 16 | if (e.getID() == KeyEvent.KEY_PRESSED) { 17 | keyboard.keyPressed(e); 18 | } else if (e.getID() == KeyEvent.KEY_RELEASED) { 19 | keyboard.keyReleased(e); 20 | } else if (e.getID() == KeyEvent.KEY_TYPED) { 21 | keyboard.keyTyped(e); 22 | } 23 | return false; 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /src/engine/keyboard/KeyBoard.java: -------------------------------------------------------------------------------- 1 | package engine.keyboard; 2 | 3 | import java.awt.event.KeyEvent; 4 | import java.awt.event.KeyListener; 5 | 6 | import engine.Game; 7 | 8 | public class KeyBoard implements KeyListener { 9 | 10 | private boolean[] keys; 11 | 12 | private long[] keyPressedTime; 13 | 14 | public KeyBoard() { 15 | keys = new boolean[KeyEvent.KEY_LAST]; 16 | keyPressedTime = new long[KeyEvent.KEY_LAST]; 17 | for(int i = 0; i < keys.length; i++) { 18 | keyPressedTime[i] = -1; 19 | } 20 | } 21 | 22 | @Override 23 | public void keyTyped(KeyEvent e) { 24 | } 25 | 26 | @Override 27 | public void keyPressed(KeyEvent e) { 28 | if(keyPressedTime(e.getKeyCode()) == -1) { // only want to store the time when the key is first pressed 29 | keyPressedTime[e.getKeyCode()] = Game.clock.elapsedMillis(); 30 | } 31 | keys[e.getKeyCode()] = true; 32 | } 33 | 34 | @Override 35 | public void keyReleased(KeyEvent e) { 36 | keys[e.getKeyCode()] = false; 37 | keyPressedTime[e.getKeyCode()] = -1; 38 | } 39 | 40 | public long keyPressedTime(int k) { 41 | return keyPressedTime[k]; 42 | } 43 | 44 | public boolean isKeyPressed(int k) { 45 | return keys[k]; 46 | } 47 | 48 | public boolean isKeyCombo(int[] k) { 49 | boolean ret = true; 50 | for(int i = 0;i < k.length; i++) { 51 | ret &= keys[k[i]]; 52 | } 53 | return ret; 54 | } 55 | 56 | public String toString() { 57 | StringBuffer sb = new StringBuffer(); 58 | for(int i = 0; i < keys.length; i++) { 59 | if(isKeyPressed(i)) { 60 | sb.append("[" + i + "]\t = " + keyPressedTime(i) + "\n"); 61 | } 62 | } 63 | return sb.toString(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/engine/map/tiled/AbstractTile.java: -------------------------------------------------------------------------------- 1 | package engine.map.tiled; 2 | 3 | import java.awt.Graphics2D; 4 | 5 | import engine.entity.AbstractCollidable; 6 | 7 | public abstract class AbstractTile extends AbstractCollidable implements ITile { 8 | 9 | protected int value; 10 | 11 | protected AbstractTile(int value) { 12 | this.value = value; 13 | collisionOffset = 0; 14 | } 15 | 16 | @Override 17 | public int value() { 18 | return value; 19 | } 20 | 21 | @Override 22 | public void value(int value) { 23 | this.value = value; 24 | } 25 | 26 | @Override 27 | public int mapX() { 28 | return 0; 29 | } 30 | 31 | @Override 32 | public int mapY() { 33 | return 0; 34 | } 35 | 36 | public abstract void draw(Graphics2D g, int x, int y); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/engine/map/tiled/CollisionTile.java: -------------------------------------------------------------------------------- 1 | package engine.map.tiled; 2 | 3 | import java.awt.Graphics2D; 4 | 5 | public class CollisionTile extends AbstractTile { 6 | 7 | public CollisionTile(int value) { 8 | super(value); 9 | locate(-1, -1); 10 | } 11 | 12 | @Override 13 | public int width() { 14 | return 16; 15 | } 16 | 17 | @Override 18 | public int height() { 19 | return 16; 20 | } 21 | 22 | @Override 23 | public void draw(Graphics2D g, int x, int y) { 24 | locate(x, y); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/engine/map/tiled/ITile.java: -------------------------------------------------------------------------------- 1 | package engine.map.tiled; 2 | 3 | public interface ITile { 4 | 5 | int value(); 6 | 7 | void value(int value); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/engine/map/tiled/MetaTile.java: -------------------------------------------------------------------------------- 1 | package engine.map.tiled; 2 | 3 | import java.awt.Graphics2D; 4 | 5 | 6 | public class MetaTile extends AbstractTile { 7 | 8 | public MetaTile(int value) { 9 | super(value); 10 | collisionOffset = 0; 11 | } 12 | 13 | @Override 14 | public int width() { 15 | return 16; 16 | } 17 | 18 | @Override 19 | public int height() { 20 | return 16; 21 | } 22 | 23 | @Override 24 | public void draw(Graphics2D g, int x, int y) { 25 | locate(x, y); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/engine/map/tiled/MetaTilesNumber.java: -------------------------------------------------------------------------------- 1 | package engine.map.tiled; 2 | 3 | public class MetaTilesNumber { 4 | 5 | private MetaTilesNumber() { 6 | 7 | } 8 | 9 | public static final int COLLISION = 1; 10 | 11 | public static final int CUTTABLE = 2; 12 | 13 | public static final int HOLE = 3; 14 | 15 | public static final int DOOR = 4; 16 | 17 | public static final int BOMBABLE = 5; 18 | 19 | public static final int WARP = 6; 20 | 21 | public static final int STAIR = 7; 22 | 23 | public static final int ROCK = 8; 24 | 25 | public static final int WATER = 9; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/engine/map/tiled/RenderTile.java: -------------------------------------------------------------------------------- 1 | package engine.map.tiled; 2 | 3 | import java.awt.Graphics2D; 4 | 5 | import engine.graphics.sprite.SimpleSprite; 6 | 7 | public class RenderTile extends AbstractTile { 8 | 9 | private SimpleSprite sprite; 10 | 11 | public RenderTile(SimpleSprite sprite, int value) { 12 | super(value); 13 | this.sprite = sprite; 14 | } 15 | 16 | @Override 17 | public int width() { 18 | return sprite.width(); 19 | } 20 | 21 | @Override 22 | public int height() { 23 | return sprite.height(); 24 | } 25 | 26 | @Override 27 | public void draw(Graphics2D g, int x, int y) { 28 | locate(x, y); 29 | sprite.draw(g, x, y); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/engine/map/tiled/TiledSpriteSheet.java: -------------------------------------------------------------------------------- 1 | package engine.map.tiled; 2 | 3 | import engine.graphics.sprite.SimpleSprite; 4 | 5 | import java.awt.Graphics2D; 6 | import java.awt.image.BufferedImage; 7 | 8 | public class TiledSpriteSheet { 9 | 10 | private SimpleSprite[] sprites; 11 | 12 | private int tileWidth; 13 | 14 | private int tileHeight; 15 | 16 | private int numTiles; 17 | 18 | public TiledSpriteSheet(int numTiles, int width, int height) { 19 | sprites = new SimpleSprite[numTiles]; 20 | this.numTiles = numTiles; 21 | this.tileWidth = width; 22 | this.tileHeight = height; 23 | } 24 | 25 | public TiledSpriteSheet(String filename, int width, int height) { 26 | this.tileWidth = width; 27 | this.tileHeight = height; 28 | SimpleSprite sprite = new SimpleSprite(filename); 29 | int numTilesX = sprite.width() / width; 30 | int numTilesY = sprite.height() / height; 31 | numTiles = numTilesX * numTilesY + 1; 32 | sprites = new SimpleSprite[numTiles]; 33 | for(int y = 0; y < numTilesY; y++) { 34 | for(int x = 0; x < numTilesX; x++) { 35 | BufferedImage dest = new BufferedImage(width, height, 36 | BufferedImage.TYPE_INT_ARGB); 37 | Graphics2D g2 = dest.createGraphics(); 38 | int startX = x * width; 39 | int startY = y * height; 40 | g2.drawImage(sprite.bufferedImage(), 41 | 0, 0, width, height, 42 | startX, startY, startX + width, startY + height, 43 | null); 44 | g2.dispose(); 45 | sprites[y * numTilesX + x + 1] = new SimpleSprite(dest); 46 | } 47 | } 48 | } 49 | 50 | public SimpleSprite get(int i) { 51 | return sprites[i]; 52 | } 53 | 54 | public void set(int i, SimpleSprite sprite) { 55 | sprites[i] = sprite; 56 | } 57 | 58 | public int numTiles() { 59 | return numTiles; 60 | } 61 | 62 | public int tileWidth() { 63 | return tileWidth; 64 | } 65 | 66 | public int tileHeight() { 67 | return tileHeight; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/engine/math/PositionVector.java: -------------------------------------------------------------------------------- 1 | package engine.math; 2 | 3 | public class PositionVector { 4 | 5 | private int x; 6 | 7 | private int y; 8 | 9 | public PositionVector() { 10 | this(0, 0); 11 | } 12 | 13 | public PositionVector(int x, int y) { 14 | set(x, y); 15 | } 16 | 17 | public PositionVector(PositionVector pv) { 18 | if(pv != null) { 19 | set(pv.x(), pv.y()); 20 | } 21 | } 22 | 23 | public void set(int x, int y) { 24 | this.x = x; 25 | this.y = y; 26 | } 27 | 28 | public int x() { 29 | return x; 30 | } 31 | 32 | public int y() { 33 | return y; 34 | } 35 | 36 | public void x(int x) { 37 | this.x = x; 38 | } 39 | 40 | public void y(int y) { 41 | this.y = y; 42 | } 43 | 44 | public double length() { 45 | return Math.sqrt(x*x + y*y); 46 | } 47 | 48 | public PositionVector unit() { 49 | double d = length(); 50 | int newX = (int) (x / d); 51 | int newY = (int) (y / d); 52 | return new PositionVector(newX, newY); 53 | } 54 | 55 | public PositionVector add(PositionVector v2) { 56 | x += v2.x(); 57 | y += v2.y(); 58 | return this; 59 | } 60 | 61 | public PositionVector add(int x, int y) { 62 | this.x += x; 63 | this.y += y; 64 | return this; 65 | } 66 | 67 | public PositionVector subtract(PositionVector v2) { 68 | x -= v2.x(); 69 | y -= v2.y(); 70 | return this; 71 | } 72 | 73 | public PositionVector subtract(int x, int y) { 74 | this.x -= x; 75 | this.y -= y; 76 | return this; 77 | } 78 | 79 | public PositionVector multiply(int scalar) { 80 | x *= scalar; 81 | y *= scalar; 82 | return this; 83 | } 84 | 85 | public PositionVector divide(int scalar) { 86 | x /= scalar; 87 | y /= scalar; 88 | return this; 89 | } 90 | 91 | public PositionVector scaleToLength(int length) { 92 | double d = length(); 93 | x /= d; 94 | y /= d; 95 | x *= length; 96 | y *= length; 97 | return this; 98 | } 99 | 100 | public PositionVector copy() { 101 | return new PositionVector(x, y); 102 | } 103 | 104 | public String toString() { 105 | return "(" + x() + ", " + y() + ")"; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /src/engine/math/Transform2D.java: -------------------------------------------------------------------------------- 1 | package engine.math; 2 | /** 3 | * this class contains transformation functions for a 2D vector 4 | * @author kenny cason 5 | * http://www.ken-soft.com 6 | * 2008 December 7 | */ 8 | public class Transform2D { 9 | 10 | public Transform2D() { 11 | } 12 | 13 | /** 14 | * [(cos(a),-sin(a)), 15 | * (sin(a),cos(a))] 16 | * @param point 17 | * @param theta 18 | * @return 19 | */ 20 | public Vector2D rotate(Vector2D point, double theta) { 21 | theta = Math.toRadians(theta); 22 | double x = point.x() * Math.cos(theta) + point.y() * -Math.sin(theta); 23 | double y = point.x() * Math.sin(theta) + point.y() * Math.cos(theta); 24 | return new Vector2D(x, y); 25 | } 26 | 27 | 28 | public Vector2D unit(Vector2D point) { 29 | double d = Math.sqrt(point.x()*point.x() + point.y()*point.y()); 30 | double x = point.x() / d; 31 | double y = point.y() / d; 32 | return new Vector2D(x, y); 33 | } 34 | 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/engine/math/Vector2D.java: -------------------------------------------------------------------------------- 1 | package engine.math; 2 | 3 | public class Vector2D { 4 | 5 | private double x; 6 | 7 | private double y; 8 | 9 | public Vector2D() { 10 | this(0, 0); 11 | } 12 | public Vector2D(double x, double y) { 13 | set(x, y); 14 | } 15 | 16 | public void set(double x, double y) { 17 | this.x = x; 18 | this.y = y; 19 | } 20 | 21 | public double x() { 22 | return x; 23 | } 24 | 25 | public double y() { 26 | return y; 27 | } 28 | 29 | public void x(double x) { 30 | this.x = x; 31 | } 32 | 33 | public void y(double y) { 34 | this.y = y; 35 | } 36 | 37 | public double length() { 38 | return Math.sqrt(x*x + y*y); 39 | } 40 | 41 | public Vector2D unit() { 42 | double d = length(); 43 | double newX = x / d; 44 | double newY = y / d; 45 | return new Vector2D(newX, newY); 46 | } 47 | 48 | public Vector2D add(Vector2D v2) { 49 | x += v2.x(); 50 | y += v2.y(); 51 | return this; 52 | } 53 | 54 | public Vector2D add(double x, double y) { 55 | this.x += x; 56 | this.y += y; 57 | return this; 58 | } 59 | 60 | public Vector2D subtract(Vector2D v2) { 61 | x -= v2.x(); 62 | y -= v2.y(); 63 | return this; 64 | } 65 | 66 | public Vector2D subtract(double x, double y) { 67 | this.x -= x; 68 | this.y -= y; 69 | return this; 70 | } 71 | 72 | public Vector2D multiply(double scalar) { 73 | x *= scalar; 74 | y *= scalar; 75 | return this; 76 | } 77 | 78 | public Vector2D divide(double scalar) { 79 | x /= scalar; 80 | y /= scalar; 81 | return this; 82 | } 83 | 84 | public Vector2D scaleToLength(double length) { 85 | double d = length(); 86 | x /= d; 87 | y /= d; 88 | x *= length; 89 | y *= length; 90 | return this; 91 | } 92 | 93 | public Vector2D clone() { 94 | return new Vector2D(x, y); 95 | } 96 | 97 | public String toString() { 98 | return "(" + x + ", " + y + ")"; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/engine/math/Vector3D.java: -------------------------------------------------------------------------------- 1 | package engine.math; 2 | 3 | public class Vector3D { 4 | 5 | private double x; 6 | 7 | private double y; 8 | 9 | private double z; 10 | 11 | public Vector3D() { 12 | this(0, 0, 0); 13 | } 14 | public Vector3D(double x, double y, double z) { 15 | set(x, y, z); 16 | } 17 | 18 | public void set(double x, double y, double z) { 19 | this.x = x; 20 | this.y = y; 21 | this.z = z; 22 | } 23 | 24 | public double x() { 25 | return x; 26 | } 27 | 28 | public double y() { 29 | return y; 30 | } 31 | 32 | public double z() { 33 | return z; 34 | } 35 | 36 | public void x(double x) { 37 | this.x = x; 38 | } 39 | 40 | public void y(double y) { 41 | this.y = y; 42 | } 43 | 44 | public void z(double z) { 45 | this.z = z; 46 | } 47 | 48 | public double length() { 49 | return Math.sqrt(x*x + y*y + z*z); 50 | } 51 | 52 | public Vector3D unit() { 53 | double d = length(); 54 | double newX = x / d; 55 | double newY = y / d; 56 | double newZ = z / d; 57 | return new Vector3D(newX, newY, newZ); 58 | } 59 | 60 | public Vector3D add(Vector3D v2) { 61 | x += v2.x(); 62 | y += v2.y(); 63 | return this; 64 | } 65 | 66 | public Vector3D add(double x, double y, double z) { 67 | this.x += x; 68 | this.y += y; 69 | this.z += z; 70 | return this; 71 | } 72 | 73 | public Vector3D subtract(Vector3D v2) { 74 | x -= v2.x(); 75 | y -= v2.y(); 76 | z -= v2.z(); 77 | return this; 78 | } 79 | 80 | public Vector3D subtract(double x, double y, double z) { 81 | this.x -= x; 82 | this.y -= y; 83 | this.z -= z; 84 | return this; 85 | } 86 | 87 | public Vector3D multiply(double scalar) { 88 | x *= scalar; 89 | y *= scalar; 90 | z *= scalar; 91 | return this; 92 | } 93 | 94 | public Vector3D divide(double scalar) { 95 | x /= scalar; 96 | y /= scalar; 97 | z /= scalar; 98 | return this; 99 | } 100 | 101 | public Vector3D scaleToLength(double length) { 102 | double d = length(); 103 | x /= d; 104 | y /= d; 105 | z /= d; 106 | x *= length; 107 | y *= length; 108 | z *= length; 109 | return this; 110 | } 111 | 112 | public Vector3D clone() { 113 | return new Vector3D(x, y, z); 114 | } 115 | 116 | public String toString() { 117 | return "(" + x + ", " + y + ", " + z + ")"; 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /src/engine/mouse/Mouse.java: -------------------------------------------------------------------------------- 1 | package engine.mouse; 2 | 3 | import java.awt.event.MouseEvent; 4 | import java.awt.event.MouseListener; 5 | import java.util.Arrays; 6 | 7 | import engine.Game; 8 | 9 | public class Mouse implements MouseListener { 10 | 11 | private boolean[] keys; 12 | 13 | private long[] keyPressedTime; 14 | 15 | private long[] keyReleasedTime; 16 | 17 | private long clickedTimeThreshold = 100; 18 | 19 | private int x1; 20 | 21 | private int y1; 22 | 23 | private int x2; 24 | 25 | private int y2; 26 | 27 | public Mouse() { 28 | keys = new boolean[MouseEvent.MOUSE_LAST]; 29 | keyPressedTime = new long[MouseEvent.MOUSE_LAST]; 30 | Arrays.fill(keyPressedTime, -1); 31 | keyReleasedTime = new long[MouseEvent.MOUSE_LAST]; 32 | Arrays.fill(keyReleasedTime, -1); 33 | for(int i = 0; i < keys.length; i++) { 34 | keyPressedTime[i] = -1; 35 | } 36 | } 37 | 38 | @Override 39 | public void mouseClicked(MouseEvent e) { 40 | } 41 | 42 | @Override 43 | public void mouseEntered(MouseEvent e) { 44 | } 45 | 46 | @Override 47 | public void mouseExited(MouseEvent e) { 48 | } 49 | 50 | @Override 51 | public void mousePressed(MouseEvent e) { 52 | keys[e.getButton()] = true; 53 | keyPressedTime[e.getButton()] = Game.clock.elapsedMillis(); 54 | x1 = e.getX() / Game.zoom(); 55 | y1 = e.getY() / Game.zoom(); 56 | x2 = -1; 57 | y2 = -1; 58 | } 59 | 60 | @Override 61 | public void mouseReleased(MouseEvent e) { 62 | keys[e.getButton()] = false; 63 | keyReleasedTime[e.getButton()] = Game.clock.elapsedMillis(); 64 | x2 = e.getX() / Game.zoom(); 65 | y2 = e.getY() / Game.zoom(); 66 | // System.out.println("released: " + x2 + " " + y2); 67 | } 68 | 69 | public long mouseClickedTime(int e) { 70 | return keyPressedTime[e]; 71 | } 72 | 73 | public boolean isMousePressed(int e) { 74 | return keys[e]; 75 | } 76 | 77 | public boolean isMouseClicked(int e) { 78 | return Game.clock.elapsedMillis() - keyReleasedTime[e] < clickedTimeThreshold; 79 | } 80 | 81 | public int x1() { 82 | return x1; 83 | } 84 | 85 | public int y1() { 86 | return y1; 87 | } 88 | 89 | public int x2() { 90 | return x2; 91 | } 92 | 93 | public int y2() { 94 | return y2; 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /src/engine/sound/AbstractSound.java: -------------------------------------------------------------------------------- 1 | package engine.sound; 2 | 3 | import engine.Game; 4 | 5 | public abstract class AbstractSound { 6 | 7 | protected int volume = 50; 8 | 9 | protected boolean loaded = false; 10 | 11 | protected final String file; 12 | 13 | protected SoundChannels channels; 14 | 15 | protected AbstractSound(String file) { 16 | this.file = file; 17 | if(Game.config.contains("volume")) { 18 | if("mute".equalsIgnoreCase(Game.config.getString("volume"))) { 19 | volume = 0; 20 | } else { 21 | volume = Game.config.getInt("volume"); 22 | } 23 | } 24 | } 25 | 26 | public abstract void play(); 27 | 28 | public String file() { 29 | return file; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/engine/sound/LoopingSound.java: -------------------------------------------------------------------------------- 1 | package engine.sound; 2 | 3 | import java.io.IOException; 4 | import java.net.URL; 5 | 6 | import javax.sound.sampled.AudioInputStream; 7 | import javax.sound.sampled.AudioSystem; 8 | import javax.sound.sampled.Clip; 9 | import javax.sound.sampled.FloatControl; 10 | import javax.sound.sampled.LineUnavailableException; 11 | import javax.sound.sampled.UnsupportedAudioFileException; 12 | 13 | public class LoopingSound extends AbstractSound { 14 | 15 | private Clip clip; 16 | 17 | public LoopingSound(String file) { 18 | super(file); 19 | try { 20 | // below causes bug per: http://stackoverflow.com/questions/9659842/java-exception-reading-stream-from-resource-wav 21 | //InputStream is = getClass().getClassLoader().getResourceAsStream(file); 22 | URL url = this.getClass().getClassLoader().getResource(file); 23 | clip = AudioSystem.getClip(); 24 | AudioInputStream inputStream = AudioSystem.getAudioInputStream(url); 25 | clip.open(inputStream); 26 | loaded = true; 27 | volume(volume); 28 | } catch(LineUnavailableException e) { 29 | e.printStackTrace(); 30 | loaded = false; 31 | } catch(UnsupportedAudioFileException e) { 32 | e.printStackTrace(); 33 | loaded = false; 34 | } catch(IOException e) { 35 | e.printStackTrace(); 36 | loaded = false; 37 | } 38 | } 39 | 40 | public void play() { 41 | if (loaded) { 42 | if (clip.isRunning()) { 43 | clip.stop(); 44 | } 45 | clip.setFramePosition(0); 46 | clip.loop(Clip.LOOP_CONTINUOUSLY); 47 | } 48 | } 49 | 50 | public void stop() { 51 | if (loaded) { 52 | clip.stop(); 53 | } 54 | } 55 | 56 | public boolean playing() { 57 | return clip.isActive(); 58 | } 59 | 60 | public void volume(int volume) { 61 | this.volume = volume; 62 | if (this.volume < 0) { 63 | this.volume = 0; 64 | } else if (this.volume > 100) { 65 | this.volume = 100; 66 | } 67 | if (loaded) { 68 | FloatControl gainControl = (FloatControl) clip 69 | .getControl(FloatControl.Type.MASTER_GAIN); 70 | float amt = 0; 71 | float range = gainControl.getMaximum() - gainControl.getMinimum(); 72 | amt = (float) (gainControl.getMinimum() + range * this.volume 73 | / 100.0); 74 | gainControl.setValue(amt); // Reduce volume by 10 decibels. 75 | } 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /src/engine/sound/SoundBank.java: -------------------------------------------------------------------------------- 1 | package engine.sound; 2 | 3 | import java.util.HashMap; 4 | 5 | import org.apache.log4j.Logger; 6 | 7 | public class SoundBank { 8 | 9 | private HashMap resources = new HashMap(); 10 | 11 | private final static Logger LOGGER = Logger.getLogger(SoundBank.class.getName()); 12 | 13 | public SoundBank() { 14 | } 15 | 16 | public void set(String key, AbstractSound sound) { 17 | LOGGER.debug("loading new sound: " + sound.file()); 18 | resources.put(key, sound); 19 | } 20 | 21 | public AbstractSound get(String key) { 22 | return resources.get(key); 23 | } 24 | 25 | public int size() { 26 | return resources.size(); 27 | } 28 | 29 | public HashMap all() { 30 | return resources; 31 | } 32 | 33 | public void stopAll() { 34 | for(String soundId : all().keySet()) { 35 | if(get(soundId) instanceof LoopingSound) { 36 | ((LoopingSound) get(soundId)).stop(); 37 | } 38 | } 39 | SoundChannels.getInstance().stopAll(); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/engine/sound/SoundChannels.java: -------------------------------------------------------------------------------- 1 | package engine.sound; 2 | 3 | import javax.sound.sampled.AudioFormat; 4 | import javax.sound.sampled.AudioSystem; 5 | import javax.sound.sampled.DataLine; 6 | import javax.sound.sampled.LineUnavailableException; 7 | import javax.sound.sampled.SourceDataLine; 8 | 9 | import org.apache.log4j.Logger; 10 | 11 | public class SoundChannels { 12 | 13 | private static SourceDataLine[] lines; 14 | 15 | private final int numLines; 16 | 17 | private volatile int currentLine = 0; 18 | 19 | private static SoundChannels INSTANCE; 20 | 21 | private final static Logger LOGGER = Logger.getLogger(SoundChannels.class.getName()); 22 | 23 | public static SoundChannels getInstance() { 24 | if(INSTANCE == null) { 25 | INSTANCE = new SoundChannels(25); 26 | } 27 | return INSTANCE; 28 | } 29 | 30 | public SoundChannels(int numLines) { 31 | this.numLines = numLines; 32 | lines = new SourceDataLine[numLines]; 33 | } 34 | 35 | public SourceDataLine getFreeLine(AudioFormat format, int volume) { 36 | try { 37 | synchronized(this) { 38 | DataLine.Info info = new DataLine.Info(SourceDataLine.class, format); 39 | if(currentLine >= lines.length) { 40 | currentLine = 0; 41 | } 42 | if(lines[currentLine] == null) { 43 | lines[currentLine] = (SourceDataLine) AudioSystem.getLine(info); 44 | } 45 | if(!lines[currentLine].isActive()) { 46 | return lines[currentLine++]; 47 | } 48 | } 49 | } catch (LineUnavailableException e) { 50 | e.printStackTrace(); 51 | LOGGER.error(e.getMessage()); 52 | } 53 | return null; 54 | } 55 | 56 | public SourceDataLine[] lines() { 57 | return lines; 58 | } 59 | 60 | public void stopAll() { 61 | for(int i = 0; i < numLines; i++) { 62 | if(lines[i] != null) { 63 | if(lines[i].isActive()) { 64 | lines[i].close(); 65 | } 66 | } 67 | } 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/engine/utils/ZLibUtils.java: -------------------------------------------------------------------------------- 1 | package engine.utils; 2 | 3 | import java.io.ByteArrayOutputStream; 4 | import java.io.IOException; 5 | import java.util.zip.DataFormatException; 6 | import java.util.zip.Deflater; 7 | import java.util.zip.Inflater; 8 | 9 | public class ZLibUtils { 10 | 11 | public static String CHAR_SET = "UTF-8"; 12 | 13 | public static String CHAR_SET_UTF8 = "UTF-8"; 14 | 15 | public static String CHAR_SET_ISO_8859_1 = "ISO-8859-1"; 16 | 17 | private ZLibUtils() { 18 | 19 | } 20 | 21 | /** 22 | * usese zlib 23 | * 24 | * @param str 25 | * @return 26 | * @throws DataFormatException 27 | * @throws IOException 28 | */ 29 | public static byte[] inflate(byte[] compressedData) { 30 | try { 31 | Inflater decompressor = new Inflater(); 32 | decompressor.setInput(compressedData); 33 | ByteArrayOutputStream bos = new ByteArrayOutputStream(); 34 | byte[] buf = new byte[1024]; 35 | while (!decompressor.finished()) { 36 | int count = decompressor.inflate(buf); 37 | bos.write(buf, 0, count); 38 | } 39 | decompressor.end(); 40 | bos.close(); 41 | return bos.toByteArray(); 42 | } catch(Exception e) { 43 | e.printStackTrace(); 44 | return null; 45 | } 46 | } 47 | 48 | /** 49 | * deflate using zlib 50 | * 51 | * @param str 52 | * @return 53 | * @throws DataFormatException 54 | * @throws IOException 55 | */ 56 | public static byte[] deflate(byte[] uncompressedData) { 57 | try { 58 | Deflater compressor = new Deflater(); 59 | compressor.setLevel(Deflater.BEST_COMPRESSION); 60 | compressor.setInput(uncompressedData); 61 | compressor.finish(); 62 | ByteArrayOutputStream bos = new ByteArrayOutputStream(uncompressedData.length); 63 | byte[] buf = new byte[1024]; 64 | while (!compressor.finished()) { 65 | int count = compressor.deflate(buf); 66 | bos.write(buf, 0, count); 67 | } 68 | bos.close(); 69 | return bos.toByteArray(); 70 | } catch(Exception e) { 71 | e.printStackTrace(); 72 | return null; 73 | } 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/game/cubes/Cubes.java: -------------------------------------------------------------------------------- 1 | package game.cubes; 2 | 3 | import java.awt.Font; 4 | import java.awt.event.WindowAdapter; 5 | import java.awt.event.WindowEvent; 6 | 7 | import javax.media.opengl.GLCapabilities; 8 | import javax.media.opengl.GLProfile; 9 | import javax.media.opengl.awt.GLCanvas; 10 | 11 | import engine.Game; 12 | import engine.GameFactory; 13 | import engine.GameStateEnum; 14 | import game.cubes.gamestates.MainGameLoop; 15 | 16 | public class Cubes extends Game { 17 | 18 | private static final long serialVersionUID = 1L; 19 | 20 | public static void main(String[] args) { 21 | GameFactory.set(new Cubes()); 22 | Game game = GameFactory.get(); 23 | game.setTitle("Cubes"); 24 | game.start(); 25 | game.run(); 26 | } 27 | 28 | private Cubes() { 29 | super(460, 350, 2); 30 | 31 | } 32 | 33 | /** 34 | * load global resources 35 | */ 36 | @Override 37 | public void start() { 38 | super.start(); 39 | // load globals 40 | 41 | // load sprites 42 | // Game.sprites.set("entities", new SpriteSheet("sprites/entity/zelda/entities.png", 16, 16)); 43 | 44 | // load fonts 45 | Game.fonts.set("small", new Font("Serif", Font.BOLD, 10)); 46 | Game.fonts.set("large", new Font("Serif", Font.BOLD, 40)); 47 | 48 | // Game.sounds.set("title_screen", new LoopingSound("sounds/bg/LoZ Oracle of Seasons Intro + Title Screen.WAV")); 49 | 50 | // Game.usables.set("sword1", new SwordLevel1()); 51 | 52 | gameLoops.put(GameStateEnum.MAIN, new MainGameLoop()); 53 | 54 | gameState = GameStateEnum.MAIN; 55 | gameLoops.get(GameStateEnum.MAIN).start(); 56 | 57 | } 58 | 59 | public void run() { 60 | while(true) { 61 | switch(gameState) { 62 | case TITLE_SCREEN: 63 | break; 64 | case MAIN: 65 | gameLoops.get(GameStateEnum.MAIN).run(); 66 | break; 67 | case ITEM_SCREEN: 68 | break; 69 | case PAUSED: 70 | break; 71 | case DEAD: 72 | break; 73 | case END: 74 | System.exit(0); 75 | break; 76 | } 77 | } 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /src/game/cubes/GLScreen.java: -------------------------------------------------------------------------------- 1 | package game.cubes; 2 | 3 | import javax.media.opengl.GL; 4 | import javax.media.opengl.GL2; 5 | import javax.media.opengl.GLAutoDrawable; 6 | import javax.media.opengl.GLEventListener; 7 | 8 | import engine.graphics.shape.Polygon; 9 | import engine.math.Vector2D; 10 | 11 | public class GLScreen implements GLEventListener { 12 | 13 | private int width; 14 | 15 | private int height; 16 | 17 | private Polygon polygon = new Polygon( 18 | new Vector2D(10, 10), 19 | new Vector2D(40, 40), 20 | new Vector2D(200, 100), 21 | new Vector2D(100, 200), 22 | new Vector2D(30, 150), 23 | new Vector2D(10, 50) 24 | ); 25 | 26 | 27 | public GLScreen(int width, int height) { 28 | this.width = width; 29 | this.height = height; 30 | } 31 | 32 | @Override 33 | public void display(GLAutoDrawable gLDrawable) { 34 | final GL2 gl = gLDrawable.getGL().getGL2(); 35 | 36 | gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT); 37 | 38 | polygon.draw(gl); 39 | gl.glFlush(); 40 | } 41 | 42 | 43 | public void init(GLAutoDrawable gLDrawable) { 44 | System.out.println("init() called"); 45 | GL2 gl = gLDrawable.getGL().getGL2(); 46 | // Projection mode is for setting camera 47 | gl.glMatrixMode(GL2.GL_PROJECTION); 48 | // This will set the camera for orthographic projection and allow 2D 49 | // view 50 | // Our projection will be on 400 X 400 screen 51 | gl.glLoadIdentity(); 52 | gl.glOrtho(0, width, height, 0, 0, 1); 53 | // Modelview is for drawing 54 | gl.glMatrixMode(GL2.GL_MODELVIEW); 55 | // Depth is disabled because we are drawing in 2D 56 | gl.glDisable(GL.GL_DEPTH_TEST); 57 | // Setting the clear color (in this case black) 58 | // and clearing the buffer with this set clear color 59 | // gl.glClearColor(1.0f, 1.0f, 1.0f, 0.0f); 60 | //gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); 61 | // This defines how to blend when a transparent graphics 62 | // is placed over another (here we have blended colors of 63 | // two consecutively overlapping graphic objects) 64 | gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA); 65 | gl.glEnable(GL.GL_BLEND); 66 | } 67 | 68 | public void reshape(GLAutoDrawable gLDrawable, int x, int y, int width, int height) { 69 | this.width = width; 70 | this.height = height; 71 | System.out.println("reshape() called: x = " + x + ", y = " + y + ", width = " + width + ", height = " + height); 72 | } 73 | 74 | public void dispose(GLAutoDrawable arg0) { 75 | System.out.println("dispose() called"); 76 | } 77 | 78 | 79 | } 80 | -------------------------------------------------------------------------------- /src/game/cubes/gamestates/MainGameLoop.java: -------------------------------------------------------------------------------- 1 | package game.cubes.gamestates; 2 | 3 | import java.awt.Canvas; 4 | import java.awt.Color; 5 | import java.awt.Graphics2D; 6 | import java.awt.event.KeyEvent; 7 | import java.awt.image.BufferedImage; 8 | import java.util.Random; 9 | 10 | import engine.AbstractGameLoop; 11 | import engine.Game; 12 | import engine.GameStateEnum; 13 | import engine.graphics.shape.Polygon; 14 | import engine.math.Vector2D; 15 | 16 | public class MainGameLoop extends AbstractGameLoop { 17 | 18 | private Random random; 19 | 20 | private Polygon polygon = new Polygon( 21 | new Vector2D(10, 10), 22 | new Vector2D(40, 40), 23 | new Vector2D(200, 100), 24 | new Vector2D(100, 200), 25 | new Vector2D(30, 150), 26 | new Vector2D(10, 50) 27 | ); 28 | 29 | public MainGameLoop() { 30 | super(); 31 | 32 | random = new Random(); 33 | } 34 | 35 | @Override 36 | public void run() { 37 | handleInput(); 38 | if(Game.clock.systemElapsedMillis() - lastRefresh >= refreshInterval) { 39 | // paint everything 40 | // draw(game.screen().bufferedImage()); 41 | // game.screenPanel().repaint(); 42 | game.glCanvas().getGraphics(); 43 | 44 | 45 | 46 | lastRefresh = Game.clock.systemElapsedMillis(); 47 | } 48 | } 49 | 50 | public void handleInput() { 51 | 52 | if(Game.keyboard.isKeyPressed(KeyEvent.VK_C)) { 53 | 54 | } 55 | if(Game.keyboard.isKeyPressed(KeyEvent.VK_R)) { 56 | 57 | } 58 | if(Game.keyboard.isKeyPressed(KeyEvent.VK_ESCAPE)) { 59 | game.gameState(GameStateEnum.END); 60 | } 61 | } 62 | 63 | 64 | @Override 65 | public void draw(BufferedImage bi) { 66 | Graphics2D g = bi.createGraphics(); 67 | 68 | if(Game.zoom() > 1) { 69 | g.scale(Game.zoom(), Game.zoom()); 70 | } 71 | g.setColor(Color.BLACK); 72 | g.fillRect(0, 0, Game.SCREEN_WIDTH, Game.SCREEN_HEIGHT); 73 | 74 | g.dispose(); 75 | } 76 | 77 | @Override 78 | public void start() { 79 | lastRefresh = Game.clock.systemElapsedMillis() - refreshInterval; 80 | transitionTime = Game.clock.systemElapsedMillis(); 81 | Game.clock.start(); 82 | } 83 | 84 | @Override 85 | public void end() { 86 | Game.clock.stop(); 87 | } 88 | 89 | 90 | } 91 | -------------------------------------------------------------------------------- /src/game/minesweeper/MineSweeper.java: -------------------------------------------------------------------------------- 1 | package game.minesweeper; 2 | 3 | import java.awt.Font; 4 | 5 | import engine.graphics.sprite.SpriteSheet; 6 | import engine.Game; 7 | import engine.GameFactory; 8 | import engine.GameStateEnum; 9 | import game.minesweeper.gamestates.MainGameLoop; 10 | 11 | public class MineSweeper extends Game { 12 | 13 | private static final long serialVersionUID = 1L; 14 | 15 | public static void main(String[] args) { 16 | GameFactory.set(new MineSweeper()); 17 | Game game = GameFactory.get(); 18 | game.setTitle("MineSweeper"); 19 | game.start(); 20 | game.run(); 21 | } 22 | 23 | private MineSweeper() { 24 | super(460, 350, 2); 25 | } 26 | 27 | /** 28 | * load global resources 29 | */ 30 | @Override 31 | public void start() { 32 | super.start(); 33 | // load globals 34 | 35 | // load sprites 36 | Game.sprites.set("entities", new SpriteSheet("sprites/entity/zelda/entities.png", 16, 16)); 37 | // Game.sprites.set("entities8x8", new SpriteSheet("sprites/entity/zelda/entities.png", 8, 8)); 38 | // Game.sprites.set("title_screen", new SimpleSprite("sprites/entity/zelda/Oracle_of_Ages_logo.png")); 39 | 40 | // load fonts 41 | Game.fonts.set("small", new Font("Serif", Font.BOLD, 10)); 42 | Game.fonts.set("large", new Font("Serif", Font.BOLD, 40)); 43 | 44 | // Game.sounds.set("title_screen", new LoopingSound("sounds/bg/LoZ Oracle of Seasons Intro + Title Screen.WAV")); 45 | // Game.sounds.set("main_theme", new LoopingSound("sounds/bg/LoZ Oracle of Seasons Main Theme.WAV")); 46 | 47 | // Game.usables.set("sword1", new SwordLevel1()); 48 | 49 | gameLoops.put(GameStateEnum.MAIN, new MainGameLoop()); 50 | 51 | gameState = GameStateEnum.MAIN; 52 | gameLoops.get(GameStateEnum.MAIN).start(); 53 | 54 | } 55 | 56 | public void run() { 57 | while(true) { 58 | switch(gameState) { 59 | case TITLE_SCREEN: 60 | break; 61 | case MAIN: 62 | gameLoops.get(GameStateEnum.MAIN).run(); 63 | break; 64 | case ITEM_SCREEN: 65 | break; 66 | case PAUSED: 67 | break; 68 | case DEAD: 69 | break; 70 | case END: 71 | System.exit(0); 72 | break; 73 | } 74 | } 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/game/zelda/Buttons.java: -------------------------------------------------------------------------------- 1 | package game.zelda; 2 | 3 | import java.awt.event.KeyEvent; 4 | 5 | public class Buttons { 6 | 7 | public static int UP = KeyEvent.VK_UP; 8 | 9 | public static int DOWN = KeyEvent.VK_DOWN; 10 | 11 | public static int LEFT = KeyEvent.VK_LEFT; 12 | 13 | public static int RIGHT = KeyEvent.VK_RIGHT; 14 | 15 | public static int ITEM_B = KeyEvent.VK_A; 16 | 17 | public static int ITEM_A = KeyEvent.VK_S; 18 | 19 | public static int START = KeyEvent.VK_SPACE; 20 | 21 | public static int PAUSE = KeyEvent.VK_P; 22 | 23 | public static int RESET = KeyEvent.VK_R; 24 | 25 | public static int ESCAPE = KeyEvent.VK_ESCAPE; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/game/zelda/TopMenu.java: -------------------------------------------------------------------------------- 1 | package game.zelda; 2 | 3 | import java.awt.Color; 4 | import java.awt.Graphics2D; 5 | 6 | import engine.Game; 7 | import engine.GameFactory; 8 | import engine.graphics.sprite.SpriteSheet; 9 | import game.zelda.item.EntityItemSpriteResourceNumber; 10 | 11 | public class TopMenu { 12 | 13 | private LegendOfZelda game; 14 | 15 | /** 16 | * quick references to commonly used sprite resources 17 | */ 18 | private SpriteSheet entities8x8; 19 | 20 | public TopMenu() { 21 | game = (LegendOfZelda)GameFactory.get(); 22 | entities8x8 = (SpriteSheet) Game.sprites.get("entities8x8"); 23 | } 24 | 25 | public void draw(Graphics2D g) { 26 | g.setColor(new Color(0xE0F3FF)); 27 | g.fillRect(0, 0, Game.SCREEN_WIDTH, 24); 28 | 29 | g.setColor(Color.BLACK); 30 | g.setFont(Game.fonts.get("menu_small")); 31 | g.drawString("B", 0, 10); 32 | g.setFont(Game.fonts.get("menu_large")); 33 | g.drawString("[ ]",10, 19); 34 | if(game.link().itemB() != null) { 35 | game.link().itemB().menuDraw(g, 13, 3); 36 | g.setFont(Game.fonts.get("menu_smaller")); 37 | g.drawString(game.link().itemB().menuDisplayName(), 28, 20); 38 | } 39 | 40 | g.setFont(Game.fonts.get("menu_small")); 41 | g.drawString("A", 55, 10); 42 | g.setFont(Game.fonts.get("menu_large")); 43 | g.drawString("[ ]", 65, 19); 44 | if(game.link().itemA() != null) { 45 | game.link().itemA().menuDraw(g, 69, 3); 46 | g.setFont(Game.fonts.get("menu_smaller")); 47 | g.drawString(game.link().itemA().menuDisplayName(), 85, 20); 48 | } 49 | 50 | drawRupees(g); 51 | drawHearts(g); 52 | } 53 | 54 | private void drawRupees(Graphics2D g) { 55 | entities8x8.get(EntityItemSpriteResourceNumber.MENU_RUPEE).draw(g, 110, 2); 56 | g.setFont(Game.fonts.get("menu_small")); 57 | g.drawString(String.valueOf(game.link().rupees()), 110, 22); 58 | } 59 | 60 | private void drawHearts(Graphics2D g) { 61 | for(int i = 0, x = 0, y = 2; i < game.link().maxLife(); i++, x += 9) { 62 | if(i == 10) { 63 | x = 0; 64 | } 65 | if(i >= 10) { 66 | y = 11; 67 | } 68 | if(game.link().life() >= i + 1) { 69 | entities8x8.get(EntityItemSpriteResourceNumber.MENU_HEART_FULL).draw(g, 142 + x, y); 70 | } else if(game.link().life() + 0.5 == i + 1) { 71 | entities8x8.get(EntityItemSpriteResourceNumber.MENU_HEART_HALF).draw(g, 142 + x, y); 72 | } else { 73 | entities8x8.get(EntityItemSpriteResourceNumber.MENU_HEART_EMPTY).draw(g, 142 + x, y); 74 | } 75 | } 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /src/game/zelda/dialog/ZeldaDialog.java: -------------------------------------------------------------------------------- 1 | package game.zelda.dialog; 2 | 3 | import engine.dialog.BasicDialog; 4 | 5 | public class ZeldaDialog extends BasicDialog { 6 | 7 | public ZeldaDialog(String text) { 8 | this(new String[]{text}); 9 | } 10 | 11 | public ZeldaDialog(String[] text) { 12 | super(text, 10, 40, 220, 52, 50); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/game/zelda/enemy/BabyWorm.java: -------------------------------------------------------------------------------- 1 | package game.zelda.enemy; 2 | 3 | import java.awt.Graphics2D; 4 | 5 | import engine.FaceDirection; 6 | import engine.Game; 7 | import engine.ai.RandomAIStrategy; 8 | import engine.entity.AbstractSimpleEntity; 9 | import engine.entity.enemy.AbstractEnemy; 10 | import engine.graphics.sprite.AnimatedSprite; 11 | import engine.graphics.sprite.SpriteSheet; 12 | import engine.graphics.sprite.SpriteUtils; 13 | import game.zelda.item.Heart; 14 | import game.zelda.item.RupeeGold; 15 | import game.zelda.item.RupeeGreen; 16 | import game.zelda.player.Link; 17 | 18 | public class BabyWorm extends AbstractEnemy { 19 | 20 | private Body tail1; 21 | 22 | private Body tail2; 23 | 24 | public BabyWorm(Link link, int x, int y) { 25 | setAIStrategy(new RandomAIStrategy(this, 2500)); 26 | SpriteSheet sheet = (SpriteSheet) Game.sprites.get("entities"); 27 | 28 | spriteW = new AnimatedSprite(sheet.range(561, 561), 0); 29 | spriteE = SpriteUtils.flipHorizontal(spriteW); 30 | spriteS = SpriteUtils.rotate(spriteE, Math.PI / 2); 31 | spriteN = SpriteUtils.rotate(spriteW, Math.PI / 2); 32 | tail1 = new Body(sheet.range(562, 562)); 33 | tail2 = new Body(sheet.range(563, 563)); 34 | 35 | face = FaceDirection.EAST; 36 | spriteCurrent = spriteE; 37 | 38 | locate(x * game.map().tileWidth(), y * game.map().tileHeight()); 39 | damage = 2.0; 40 | life = 10; 41 | maxLife = 10; 42 | dropItems.add(new Heart(link)); 43 | dropItems.add(new Heart(link)); 44 | dropItems.add(new RupeeGreen(link)); 45 | dropItems.add(new RupeeGold(link)); 46 | } 47 | 48 | @Override 49 | public void draw(Graphics2D g) { 50 | tail2.draw(g); 51 | tail1.draw(g); 52 | spriteCurrent.draw(g, x(), y()); 53 | System.out.println("last face: " + lastFace() + " face: " + face()); 54 | } 55 | 56 | @Override 57 | public void handle() { 58 | super.handle(); 59 | strategy.handle(); 60 | 61 | // tail2.locate(tail1.x(), tail1.y()); 62 | //tail1.locate(x(), y()); 63 | 64 | } 65 | 66 | @Override 67 | public void face(FaceDirection face) { 68 | this.face = face; 69 | switch(face) { 70 | case NORTH: 71 | spriteCurrent = spriteN; 72 | break; 73 | case EAST: 74 | spriteCurrent = spriteE; 75 | break; 76 | case SOUTH: 77 | spriteCurrent = spriteS; 78 | break; 79 | case WEST: 80 | spriteCurrent = spriteW; 81 | break; 82 | } 83 | } 84 | 85 | private class Body extends AbstractSimpleEntity { 86 | 87 | public Body(SpriteSheet sprites) { 88 | this.sprite = new AnimatedSprite(sprites, 0); 89 | } 90 | 91 | @Override 92 | public void draw(Graphics2D g) { 93 | sprite.draw(g, x(), y()); 94 | } 95 | 96 | } 97 | 98 | } 99 | -------------------------------------------------------------------------------- /src/game/zelda/enemy/LikeLike.java: -------------------------------------------------------------------------------- 1 | package game.zelda.enemy; 2 | 3 | import engine.Game; 4 | import engine.ai.RandomAIStrategy; 5 | import engine.entity.enemy.AbstractEnemy; 6 | import engine.graphics.sprite.AnimatedSprite; 7 | import engine.graphics.sprite.SpriteSheet; 8 | import game.zelda.item.RupeeBlue; 9 | import game.zelda.player.Link; 10 | 11 | public class LikeLike extends AbstractEnemy { 12 | 13 | public LikeLike(Link link, int x, int y) { 14 | setAIStrategy(new RandomAIStrategy(this, 2500)); 15 | SpriteSheet sheet = (SpriteSheet) Game.sprites.get("entities"); 16 | spriteCurrent = new AnimatedSprite(sheet.range(462,464), 230); 17 | spriteCurrent.reverseCycle(true); 18 | spriteE = spriteW = spriteN = spriteS = spriteCurrent; 19 | locate(x * game.map().tileWidth(), y * game.map().tileHeight()); 20 | damage = 0.5; 21 | life = 2; 22 | maxLife = 2; 23 | dropItemProbability = 60; 24 | dropItems.add(new RupeeBlue(link)); 25 | } 26 | 27 | @Override 28 | public void handle() { 29 | super.handle(); 30 | strategy.handle(); 31 | 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/game/zelda/enemy/Octorok.java: -------------------------------------------------------------------------------- 1 | package game.zelda.enemy; 2 | 3 | import engine.FaceDirection; 4 | import engine.Game; 5 | import engine.ai.RandomAIStrategy; 6 | import engine.entity.enemy.AbstractEnemy; 7 | import engine.graphics.sprite.AnimatedSprite; 8 | import engine.graphics.sprite.SpriteSheet; 9 | import engine.graphics.sprite.SpriteUtils; 10 | import game.zelda.item.Heart; 11 | import game.zelda.item.RupeeGreen; 12 | import game.zelda.player.Link; 13 | 14 | public class Octorok extends AbstractEnemy { 15 | 16 | public Octorok(Link link, int x, int y) { 17 | setAIStrategy(new RandomAIStrategy(this, 2500)); 18 | SpriteSheet sheet = (SpriteSheet) Game.sprites.get("entities"); 19 | SpriteSheet west = new SpriteSheet(2, 16, 16); 20 | SpriteSheet south = new SpriteSheet(2, 16, 16); 21 | 22 | west.set(0, sheet.get(213)); 23 | west.set(1, sheet.get(263)); 24 | 25 | south.set(0, sheet.get(214)); 26 | south.set(1, sheet.get(313)); 27 | 28 | spriteW = new AnimatedSprite(west, 230); 29 | spriteE = SpriteUtils.flipHorizontal(spriteW); 30 | spriteS = new AnimatedSprite(south, 230); 31 | spriteN = SpriteUtils.flipVertical(spriteS); 32 | 33 | face = FaceDirection.EAST; 34 | spriteCurrent = spriteE; 35 | 36 | locate(x * game.map().tileWidth(), y * game.map().tileHeight()); 37 | damage = 0.5; 38 | life = 4; 39 | maxLife = 1; 40 | dropItems.add(new Heart(link)); 41 | dropItems.add(new Heart(link)); 42 | dropItems.add(new RupeeGreen(link)); 43 | dropItems.add(new RupeeGreen(link)); 44 | 45 | 46 | } 47 | 48 | @Override 49 | public void handle() { 50 | super.handle(); 51 | strategy.handle(); 52 | 53 | } 54 | 55 | @Override 56 | public void face(FaceDirection face) { 57 | this.face = face; 58 | switch(face) { 59 | case NORTH: 60 | spriteCurrent = spriteN; 61 | break; 62 | case EAST: 63 | spriteCurrent = spriteE; 64 | break; 65 | case SOUTH: 66 | spriteCurrent = spriteS; 67 | break; 68 | case WEST: 69 | spriteCurrent = spriteW; 70 | break; 71 | default: 72 | break; 73 | } 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/game/zelda/enemy/RedTurtle.java: -------------------------------------------------------------------------------- 1 | package game.zelda.enemy; 2 | 3 | import engine.Game; 4 | import engine.ai.AggressiveAIStrategy; 5 | import engine.entity.enemy.AbstractEnemy; 6 | import engine.graphics.sprite.AnimatedSprite; 7 | import engine.graphics.sprite.SpriteBank; 8 | import engine.graphics.sprite.SpriteSheet; 9 | import game.zelda.item.RupeeBlue; 10 | import game.zelda.player.Link; 11 | 12 | public class RedTurtle extends AbstractEnemy { 13 | 14 | public RedTurtle(Link link, int x, int y) { 15 | setAIStrategy(new AggressiveAIStrategy(this, link, 20, 100, 2, 400)); 16 | SpriteBank rsrcs = Game.sprites; 17 | SpriteSheet sheet = (SpriteSheet) rsrcs.get("entities"); 18 | 19 | SpriteSheet frames = new SpriteSheet(2, 16, 16); 20 | frames.set(0, sheet.get(679)); 21 | frames.set(1, sheet.get(629)); 22 | spriteCurrent = new AnimatedSprite(frames, 230); 23 | spriteCurrent.reverseCycle(true); 24 | spriteE = spriteW = spriteN = spriteS = spriteCurrent; 25 | locate(x * game.map().tileWidth(), y * game.map().tileHeight()); 26 | damage = 0.5; 27 | life = 2; 28 | maxLife = 2; 29 | collisionOffset = 2; 30 | dropItemProbability = 60; 31 | dropItems.add(new RupeeBlue(link)); 32 | } 33 | 34 | @Override 35 | public void handle() { 36 | super.handle(); 37 | strategy.handle(); 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/game/zelda/gamestates/MainGameLoop.java: -------------------------------------------------------------------------------- 1 | package game.zelda.gamestates; 2 | 3 | import java.awt.Color; 4 | import java.awt.Graphics2D; 5 | import java.awt.image.BufferedImage; 6 | import java.util.Iterator; 7 | 8 | import engine.AbstractGameLoop; 9 | import engine.Game; 10 | import engine.entity.AbstractEntity; 11 | import engine.entity.enemy.AbstractEnemy; 12 | import engine.entity.item.AbstractItem; 13 | import engine.sound.LoopingSound; 14 | import game.zelda.TopMenu; 15 | import game.zelda.player.Link; 16 | 17 | public class MainGameLoop extends AbstractGameLoop { 18 | 19 | private TopMenu menu; 20 | 21 | private LoopingSound sound; 22 | 23 | private Link link; 24 | 25 | public MainGameLoop(Link link) { 26 | super(); 27 | this.link = link; 28 | menu = new TopMenu(); 29 | sound = (LoopingSound) Game.sounds.get("main_theme"); 30 | } 31 | 32 | @Override 33 | public void run() { 34 | 35 | if(Game.clock.systemElapsedMillis() - lastRefresh >= refreshInterval) { 36 | // handle game logic 37 | 38 | // enemies 39 | Iterator enemyIter = game.map().enemies().iterator(); 40 | while(enemyIter.hasNext()) { 41 | AbstractEnemy entity = enemyIter.next(); 42 | entity.handle(); 43 | if(entity.dead()) { 44 | enemyIter.remove(); 45 | } 46 | } 47 | // items 48 | Iterator itemIter = game.map().items().iterator(); 49 | while(itemIter.hasNext()) { 50 | AbstractItem item = itemIter.next(); 51 | item.handle(); 52 | if(item.consumed() && item.disappearAfterConsume()) { 53 | itemIter.remove(); 54 | } 55 | } 56 | 57 | // handle map events 58 | game.map().events().handle(); 59 | 60 | link.handle(); 61 | 62 | // paint everything 63 | draw(game.screen().bufferedImage()); 64 | game.screenPanel().repaint(); 65 | lastRefresh = Game.clock.systemElapsedMillis(); 66 | } 67 | } 68 | 69 | @Override 70 | public void draw(BufferedImage bi) { 71 | Graphics2D g = bi.createGraphics(); 72 | if(game.zoom() > 1) { 73 | g.scale(game.zoom(), game.zoom()); 74 | } 75 | g.setColor(Color.BLACK); 76 | g.fillRect(0, 0, Game.SCREEN_WIDTH, Game.SCREEN_HEIGHT); 77 | //game.map().drawBackground(g); 78 | game.map().drawBottomLayer(g); 79 | game.map().drawMiddleLater(g); 80 | 81 | for(AbstractItem item : game.map().items()) { 82 | item.draw(g); 83 | } 84 | 85 | for(AbstractEntity enemy : game.map().enemies()) { 86 | enemy.draw(g); 87 | } 88 | 89 | link.draw(g); 90 | game.map().drawTopLater(g); 91 | menu.draw(g); 92 | game.map().drawMetaLaters(g); // doesn't really draw, just resets the positions 93 | g.dispose(); 94 | } 95 | 96 | @Override 97 | public void start() { 98 | lastRefresh = Game.clock.systemElapsedMillis() - refreshInterval; 99 | transitionTime = Game.clock.systemElapsedMillis(); 100 | if(!sound.playing()) { 101 | sound.play(); 102 | } 103 | Game.clock.start(); 104 | } 105 | 106 | @Override 107 | public void end() { 108 | Game.clock.stop(); 109 | sound.stop(); 110 | } 111 | 112 | } 113 | -------------------------------------------------------------------------------- /src/game/zelda/gamestates/PausedScreenGameLoop.java: -------------------------------------------------------------------------------- 1 | package game.zelda.gamestates; 2 | 3 | import java.awt.image.BufferedImage; 4 | 5 | import engine.AbstractGameLoop; 6 | import engine.Game; 7 | import engine.GameStateEnum; 8 | import game.zelda.Buttons; 9 | 10 | public class PausedScreenGameLoop extends AbstractGameLoop { 11 | 12 | @Override 13 | public void run() { 14 | long currentTime = Game.clock.systemElapsedMillis(); 15 | if (currentTime - lastRefresh >= refreshInterval) { 16 | if (Game.keyboard.isKeyPressed(Buttons.PAUSE)) { 17 | if (currentTime - game.gameLoops().get(GameStateEnum.PAUSED).transitionTime() >= 1000) { 18 | end(); 19 | game.gameLoops().get(GameStateEnum.MAIN).start(); 20 | game.gameState(GameStateEnum.MAIN); 21 | } 22 | } 23 | lastRefresh = Game.clock.systemElapsedMillis(); 24 | } 25 | } 26 | 27 | @Override 28 | public void draw(BufferedImage bi) { 29 | 30 | } 31 | 32 | 33 | @Override 34 | public void start() { 35 | lastRefresh = Game.clock.systemElapsedMillis() - refreshInterval; 36 | transitionTime = Game.clock.systemElapsedMillis(); 37 | Game.clock.pause(); 38 | } 39 | 40 | @Override 41 | public void end() { 42 | Game.clock.start(); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/game/zelda/item/AbstractRupee.java: -------------------------------------------------------------------------------- 1 | package game.zelda.item; 2 | 3 | import game.zelda.player.Link; 4 | import engine.Game; 5 | import engine.entity.item.AbstractItem; 6 | import engine.graphics.sprite.AnimatedSprite; 7 | import engine.graphics.sprite.SpriteSheet; 8 | import engine.sound.AbstractSound; 9 | 10 | public abstract class AbstractRupee extends AbstractItem { 11 | 12 | protected int value; 13 | 14 | protected AbstractSound sound; 15 | 16 | protected AbstractRupee(Link link, int value, int spriteNumber) { 17 | super(link); 18 | this.value = value; 19 | SpriteSheet sheet = (SpriteSheet) Game.sprites.get("entities"); 20 | sprite = new AnimatedSprite(sheet.range(spriteNumber), 0); 21 | collisionOffset = 2; 22 | } 23 | 24 | @Override 25 | public void consume() { 26 | if(justDropped) { 27 | if(Game.clock.elapsedMillis() - droppedTime > 500) { 28 | justDropped = false; 29 | } 30 | } 31 | if(!justDropped) { 32 | ((Link) owner).rupees(((Link) owner).rupees() + value); 33 | consumed = true; 34 | sound.play(); 35 | } else { 36 | if(Game.clock.elapsedMillis() - droppedTime > 500) { 37 | justDropped = false; 38 | } 39 | } 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/game/zelda/item/BossKey.java: -------------------------------------------------------------------------------- 1 | package game.zelda.item; 2 | 3 | import engine.Game; 4 | import engine.entity.item.AbstractItem; 5 | import engine.graphics.sprite.AnimatedSprite; 6 | import engine.graphics.sprite.SpriteSheet; 7 | import engine.sound.AbstractSound; 8 | import game.zelda.player.Link; 9 | 10 | public class BossKey extends AbstractItem { 11 | 12 | private AbstractSound sound; 13 | 14 | private Link link; 15 | 16 | public BossKey(Link link) { 17 | this(link, 0, 0); 18 | } 19 | 20 | public BossKey(Link link, int x, int y) { 21 | super(link); 22 | this.link = link; 23 | SpriteSheet sheet = (SpriteSheet) Game.sprites.get("entities"); 24 | sprite = new AnimatedSprite(sheet.range(357), 0); 25 | locate(x * sprite.width(), y * sprite.height()); 26 | collisionOffset = 1; 27 | mustTouch = true; 28 | sound = Game.sounds.get("link_get_item"); 29 | } 30 | 31 | @Override 32 | public void consume() { 33 | consumed = true; 34 | link.bossKey(true); 35 | sound.play(); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/game/zelda/item/EntityItemSpriteResourceNumber.java: -------------------------------------------------------------------------------- 1 | package game.zelda.item; 2 | 3 | public class EntityItemSpriteResourceNumber { 4 | 5 | public static final int ITEM_HEART = 257; 6 | 7 | 8 | // 8x8 9 | 10 | public static final int MENU_HEART_FULL = 212; 11 | 12 | public static final int MENU_HEART_HALF = 213; 13 | 14 | public static final int MENU_HEART_EMPTY = 214; 15 | 16 | public static final int MENU_RUPEE = 215; 17 | } 18 | -------------------------------------------------------------------------------- /src/game/zelda/item/FullHeart.java: -------------------------------------------------------------------------------- 1 | package game.zelda.item; 2 | 3 | import engine.Game; 4 | import engine.entity.item.AbstractItem; 5 | import engine.graphics.sprite.AnimatedSprite; 6 | import engine.graphics.sprite.SpriteSheet; 7 | import engine.sound.AbstractSound; 8 | import game.zelda.player.Link; 9 | 10 | public class FullHeart extends AbstractItem { 11 | 12 | private AbstractSound sound; 13 | 14 | private Link link; 15 | 16 | public FullHeart(Link link) { 17 | this(link, 0, 0); 18 | } 19 | 20 | public FullHeart(Link link, int x, int y) { 21 | super(link); 22 | this.link = link; 23 | SpriteSheet sheet = (SpriteSheet) Game.sprites.get("entities"); 24 | sprite = new AnimatedSprite(sheet.range(252, 252), 0); 25 | locate(x * sprite.width(), y * sprite.height()); 26 | collisionOffset = 1; 27 | mustTouch = true; 28 | sound = Game.sounds.get("link_get_heart_container"); 29 | } 30 | 31 | @Override 32 | public void consume() { 33 | link.maxLife(link.maxLife() + 1); 34 | link.life(link.maxLife()); 35 | consumed = true; 36 | sound.play(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/game/zelda/item/Heart.java: -------------------------------------------------------------------------------- 1 | package game.zelda.item; 2 | 3 | import engine.Game; 4 | import engine.entity.item.AbstractItem; 5 | import engine.graphics.sprite.AnimatedSprite; 6 | import engine.graphics.sprite.SpriteSheet; 7 | import engine.sound.AbstractSound; 8 | import game.zelda.player.Link; 9 | 10 | public class Heart extends AbstractItem { 11 | 12 | private AbstractSound sound; 13 | 14 | private Link link; 15 | 16 | public Heart(Link link) { 17 | super(link); 18 | this.link = link; 19 | SpriteSheet sheet = (SpriteSheet) Game.sprites.get("entities"); 20 | sprite = new AnimatedSprite(sheet.range(257), 0); 21 | collisionOffset = 4; 22 | sound = Game.sounds.get("link_get_heart"); 23 | } 24 | 25 | @Override 26 | public void consume() { 27 | if(!justDropped) { 28 | link.life(link.life() + 1); 29 | consumed = true; 30 | sound.play(); 31 | } else { 32 | if(Game.clock.elapsedMillis() - droppedTime > 500) { 33 | justDropped = false; 34 | } 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/game/zelda/item/HeartPiece.java: -------------------------------------------------------------------------------- 1 | package game.zelda.item; 2 | 3 | import engine.Game; 4 | import engine.entity.item.AbstractItem; 5 | import engine.graphics.sprite.AnimatedSprite; 6 | import engine.graphics.sprite.SpriteSheet; 7 | import engine.sound.AbstractSound; 8 | import game.zelda.player.Link; 9 | 10 | public class HeartPiece extends AbstractItem { 11 | 12 | private AbstractSound sound; 13 | 14 | private Link link; 15 | 16 | public HeartPiece(Link link) { 17 | this(link, 0, 0); 18 | } 19 | 20 | public HeartPiece(Link link, int x, int y) { 21 | super(link); 22 | this.link = link; 23 | SpriteSheet sheet = (SpriteSheet) Game.sprites.get("entities"); 24 | sprite = new AnimatedSprite(sheet.range(157), 0); 25 | locate(x * sprite.width(), y * sprite.height()); 26 | collisionOffset = 1; 27 | mustTouch = true; 28 | sound = Game.sounds.get("link_get_heart_container"); 29 | } 30 | 31 | @Override 32 | public void consume() { 33 | link.heartPieces(link.heartPieces() + 1); 34 | link.life(link.life() + 5); 35 | consumed = true; 36 | sound.play(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/game/zelda/item/RupeeBlue.java: -------------------------------------------------------------------------------- 1 | package game.zelda.item; 2 | 3 | import engine.Game; 4 | import game.zelda.player.Link; 5 | 6 | 7 | public class RupeeBlue extends AbstractRupee { 8 | 9 | public RupeeBlue(Link link) { 10 | super(link, 5, 419); 11 | sound = Game.sounds.get("link_get_rupee5"); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/game/zelda/item/RupeeGold.java: -------------------------------------------------------------------------------- 1 | package game.zelda.item; 2 | 3 | import engine.Game; 4 | import game.zelda.player.Link; 5 | 6 | 7 | public class RupeeGold extends AbstractRupee { 8 | 9 | public RupeeGold(Link link) { 10 | super(link, 100, 422); 11 | sound = Game.sounds.get("link_get_rupee5"); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/game/zelda/item/RupeeGreen.java: -------------------------------------------------------------------------------- 1 | package game.zelda.item; 2 | 3 | import engine.Game; 4 | import game.zelda.player.Link; 5 | 6 | 7 | public class RupeeGreen extends AbstractRupee { 8 | 9 | public RupeeGreen(Link link) { 10 | super(link, 1, 418); 11 | sound = Game.sounds.get("link_get_rupee"); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/game/zelda/item/RupeePurple.java: -------------------------------------------------------------------------------- 1 | package game.zelda.item; 2 | 3 | import engine.Game; 4 | import game.zelda.player.Link; 5 | 6 | public class RupeePurple extends AbstractRupee { 7 | 8 | public RupeePurple(Link link) { 9 | super(link, 50, 421); 10 | sound = Game.sounds.get("link_get_rupee5"); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/game/zelda/item/RupeeRed.java: -------------------------------------------------------------------------------- 1 | package game.zelda.item; 2 | 3 | import engine.Game; 4 | import game.zelda.player.Link; 5 | 6 | 7 | public class RupeeRed extends AbstractRupee { 8 | 9 | public RupeeRed(Link link) { 10 | super(link, 20, 420); 11 | sound = Game.sounds.get("link_get_rupee5"); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/game/zelda/item/SmallKey.java: -------------------------------------------------------------------------------- 1 | package game.zelda.item; 2 | 3 | import engine.Game; 4 | import engine.entity.item.AbstractItem; 5 | import engine.graphics.sprite.AnimatedSprite; 6 | import engine.graphics.sprite.SpriteSheet; 7 | import engine.sound.AbstractSound; 8 | import game.zelda.player.Link; 9 | 10 | public class SmallKey extends AbstractItem { 11 | 12 | private AbstractSound sound; 13 | 14 | private Link link; 15 | 16 | public SmallKey(Link link) { 17 | this(link, 0, 0); 18 | } 19 | 20 | public SmallKey(Link link, int x, int y) { 21 | super(link); 22 | this.link = link; 23 | SpriteSheet sheet = (SpriteSheet) Game.sprites.get("entities"); 24 | sprite = new AnimatedSprite(sheet.range(358), 0); 25 | locate(x * sprite.width(), y * sprite.height()); 26 | collisionOffset = 1; 27 | mustTouch = true; 28 | sound = Game.sounds.get("link_get_item"); 29 | } 30 | 31 | @Override 32 | public void consume() { 33 | consumed = true; 34 | link.smallKeys(link.smallKeys() + 1); 35 | sound.play(); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/game/zelda/item/TreasureChest.java: -------------------------------------------------------------------------------- 1 | package game.zelda.item; 2 | 3 | import engine.Game; 4 | import engine.entity.item.AbstractItem; 5 | import engine.event.AbstractEvent; 6 | import engine.graphics.sprite.AnimatedSprite; 7 | import engine.graphics.sprite.SpriteSheet; 8 | import engine.map.tiled.MetaTilesNumber; 9 | import engine.sound.AbstractSound; 10 | import game.zelda.player.Link; 11 | 12 | public class TreasureChest extends AbstractItem { 13 | 14 | private AbstractEvent[] events; 15 | 16 | private AbstractSound openSound; 17 | 18 | private boolean open = false; 19 | 20 | private Link link; 21 | 22 | public TreasureChest(Link link, int x, int y, AbstractEvent ... events) { 23 | super(link); 24 | this.link = link; 25 | mustTouch = true; 26 | walkable = false; 27 | disappearAfterConsume = true; 28 | this.events = events; 29 | SpriteSheet sheet = (SpriteSheet) Game.sprites.get("entities"); 30 | sprite = new AnimatedSprite(sheet.range(377), 0); 31 | locate(x * sprite.width(), y * sprite.height()); 32 | collisionOffset = 0; 33 | open = false; 34 | openSound = Game.sounds.get("open_chest"); 35 | game.map().collisionLayer()[x][y].value(MetaTilesNumber.COLLISION); 36 | } 37 | 38 | @Override 39 | public void consume() { 40 | if(!open) { 41 | if(link.mapX() == mapX() && link.mapY() == mapY() + 1) { 42 | game.map().collisionLayer()[mapX()][mapY()].value(0); 43 | consumed = true; 44 | openSound.play(); 45 | open = true; 46 | for(AbstractEvent event : events) { 47 | game.map().events().add(event); 48 | } 49 | } 50 | } 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/game/zelda/map/meta/LinkFallingMetaEvent.java: -------------------------------------------------------------------------------- 1 | package game.zelda.map.meta; 2 | 3 | import engine.entity.AbstractLivingEntity; 4 | import engine.event.AbstractEvent; 5 | import engine.map.tiled.MetaTilesNumber; 6 | 7 | public class LinkFallingMetaEvent extends AbstractEvent { 8 | 9 | private AbstractLivingEntity entity; 10 | 11 | public LinkFallingMetaEvent(AbstractLivingEntity entity) { 12 | this.entity = entity; 13 | } 14 | 15 | @Override 16 | public void trigger() { 17 | if(!entity.falling()) { 18 | entity.fall(); 19 | happened = true; 20 | } 21 | } 22 | 23 | @Override 24 | public boolean ready() { 25 | if(game.map().metaLayer()[entity.mapX()][entity.mapY()].value() == MetaTilesNumber.HOLE) { 26 | return true; 27 | } 28 | happened = true; 29 | return false; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/game/zelda/usables/Bracelet.java: -------------------------------------------------------------------------------- 1 | package game.zelda.usables; 2 | 3 | import java.awt.Graphics2D; 4 | 5 | import engine.FaceDirection; 6 | import engine.Game; 7 | import engine.entity.usable.AbstractUsableEntity; 8 | import engine.graphics.sprite.SimpleSprite; 9 | import engine.graphics.sprite.SpriteSheet; 10 | import game.zelda.player.Link; 11 | 12 | public class Bracelet extends AbstractUsableEntity { 13 | 14 | private SimpleSprite sprite; 15 | 16 | public Bracelet(Link link) { 17 | super(link); 18 | SpriteSheet entities = (SpriteSheet) Game.sprites.get("entities"); 19 | 20 | sprite = entities.get(408); 21 | 22 | using = false; 23 | } 24 | 25 | public void draw(Graphics2D g) { 26 | if(!using) { 27 | return; 28 | } 29 | //sprite.draw(g, x() + game.map().offset().x(), y() + game.map().offset().x()); 30 | } 31 | 32 | public void use() { 33 | if(using) { 34 | return; 35 | } 36 | using = true; 37 | 38 | x = user.x(); 39 | y = user.y(); 40 | 41 | } 42 | 43 | public boolean using() { 44 | return using; 45 | } 46 | 47 | public void handle() { 48 | if(!using) { 49 | return; 50 | } 51 | } 52 | 53 | public void menuDraw(Graphics2D g, int x, int y) { 54 | sprite.draw(g, x, y); 55 | } 56 | 57 | public String menuDisplayName() { 58 | return "L-1"; 59 | } 60 | 61 | public void face(FaceDirection face) { 62 | 63 | } 64 | 65 | @Override 66 | public int width() { 67 | return sprite.width(); 68 | } 69 | 70 | @Override 71 | public int height() { 72 | return sprite.height(); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/game/zelda/usables/Ocarina.java: -------------------------------------------------------------------------------- 1 | package game.zelda.usables; 2 | 3 | import java.awt.Graphics2D; 4 | 5 | import engine.FaceDirection; 6 | import engine.Game; 7 | import engine.entity.usable.AbstractUsableEntity; 8 | import engine.graphics.sprite.SimpleSprite; 9 | import engine.graphics.sprite.SpriteSheet; 10 | import engine.sound.AbstractSound; 11 | import game.zelda.player.Link; 12 | 13 | public class Ocarina extends AbstractUsableEntity { 14 | 15 | private SimpleSprite sprite; 16 | 17 | private boolean using; 18 | 19 | private AbstractSound sound; 20 | 21 | private long playTime; 22 | 23 | public Ocarina(Link link) { 24 | super(link); 25 | SpriteSheet entities = (SpriteSheet) Game.sprites.get("entities"); 26 | 27 | sprite = entities.get(361); 28 | 29 | using = false; 30 | sound = Game.sounds.get("tune_of_ages"); 31 | } 32 | 33 | public void draw(Graphics2D g) { 34 | if(!using) { 35 | return; 36 | } 37 | sprite.draw(g, x() + game.map().offset().x(), y + game.map().offset().y()); 38 | } 39 | 40 | public void use() { 41 | if(using) { 42 | return; 43 | } 44 | sound.play(); 45 | using = true; 46 | 47 | x = user.x(); 48 | y = user.y(); 49 | playTime = Game.clock.elapsedMillis(); 50 | 51 | } 52 | 53 | public boolean using() { 54 | return using; 55 | } 56 | 57 | public void handle() { 58 | if(!using) { 59 | return; 60 | } 61 | if(Game.clock.elapsedMillis() - playTime > 1000) { 62 | using = false; 63 | } 64 | } 65 | 66 | public void menuDraw(Graphics2D g, int x, int y) { 67 | sprite.draw(g, x, y); 68 | } 69 | 70 | public String menuDisplayName() { 71 | return ""; 72 | } 73 | 74 | public void face(FaceDirection face) { 75 | 76 | } 77 | 78 | @Override 79 | public int width() { 80 | return sprite.width(); 81 | } 82 | 83 | @Override 84 | public int height() { 85 | return sprite.height(); 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /src/game/zelda/usables/SwordLevel1.java: -------------------------------------------------------------------------------- 1 | package game.zelda.usables; 2 | 3 | import game.zelda.player.Link; 4 | 5 | public class SwordLevel1 extends AbstractSword { 6 | 7 | public SwordLevel1(Link link) { 8 | super(link, 54, 1); 9 | } 10 | 11 | @Override 12 | public String menuDisplayName() { 13 | return "L-1"; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/game/zelda/usables/SwordLevel2.java: -------------------------------------------------------------------------------- 1 | package game.zelda.usables; 2 | 3 | import game.zelda.player.Link; 4 | 5 | public class SwordLevel2 extends AbstractSword { 6 | 7 | public SwordLevel2(Link link) { 8 | super(link, 104, 2); 9 | } 10 | 11 | @Override 12 | public String menuDisplayName() { 13 | return "L-2"; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/game/zelda/usables/SwordLevel3.java: -------------------------------------------------------------------------------- 1 | package game.zelda.usables; 2 | 3 | import game.zelda.player.Link; 4 | 5 | public class SwordLevel3 extends AbstractSword { 6 | 7 | public SwordLevel3(Link link) { 8 | super(link, 55, 3); 9 | } 10 | 11 | @Override 12 | public String menuDisplayName() { 13 | return "L-3"; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/log4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /test/engine/clock/ClockTest.java: -------------------------------------------------------------------------------- 1 | package engine.clock; 2 | 3 | import static org.junit.Assert.assertEquals; 4 | import static org.junit.Assert.assertFalse; 5 | import static org.junit.Assert.assertTrue; 6 | 7 | import org.junit.Test; 8 | 9 | import engine.clock.Clock; 10 | 11 | public class ClockTest { 12 | 13 | @Test 14 | public void test() { 15 | Clock c = Clock.getInstance(); 16 | assertEquals(0, c.elapsedMillis()); 17 | assertFalse(c.running()); 18 | c.start(); 19 | assertTrue(c.running()); 20 | 21 | pause(2000); 22 | assertEquals(2000, c.elapsedMillis(), 10); 23 | 24 | c.pause(); 25 | pause(2000); 26 | assertEquals(2000, c.elapsedMillis(), 10); 27 | 28 | c.start(); 29 | pause(2000); 30 | assertEquals(4000, c.elapsedMillis(), 10); 31 | 32 | c.stop(); 33 | assertEquals(0, c.elapsedMillis(), 10); 34 | } 35 | 36 | 37 | private void pause(long milli) { 38 | try { 39 | Thread.sleep(milli); 40 | } catch (InterruptedException e) { 41 | e.printStackTrace(); 42 | } 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /test/engine/opengl/Draw3DCubesTest.java: -------------------------------------------------------------------------------- 1 | package engine.opengl; 2 | 3 | public class Draw3DCubesTest { 4 | 5 | public static void main(String[] args) { 6 | new Draw3DCubesTest(); 7 | } 8 | 9 | public Draw3DCubesTest() { 10 | 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /test/engine/opengl/OpenGLTest.java: -------------------------------------------------------------------------------- 1 | package engine.opengl; 2 | 3 | import java.awt.event.WindowAdapter; 4 | import java.awt.event.WindowEvent; 5 | 6 | import javax.media.opengl.GLCapabilities; 7 | import javax.media.opengl.GLProfile; 8 | import javax.media.opengl.awt.GLCanvas; 9 | import javax.swing.JFrame; 10 | 11 | 12 | public class OpenGLTest { 13 | 14 | public static void main(String[] args) { 15 | new OpenGLTest(); 16 | } 17 | 18 | public OpenGLTest() { 19 | // setup OpenGL Version 2 20 | GLProfile profile = GLProfile.get(GLProfile.GL2); 21 | GLCapabilities capabilities = new GLCapabilities(profile); 22 | 23 | // The canvas is the widget that's drawn in the JFrame 24 | GLCanvas glcanvas = new GLCanvas(capabilities); 25 | glcanvas.addGLEventListener(new Screen(640, 480)); 26 | glcanvas.setSize(640, 480); 27 | 28 | JFrame frame = new JFrame( "Hello World" ); 29 | frame.getContentPane().add( glcanvas); 30 | 31 | // shutdown the program on windows close event 32 | frame.addWindowListener(new WindowAdapter() { 33 | public void windowClosing(WindowEvent ev) { 34 | // System.exit(0); 35 | } 36 | }); 37 | 38 | frame.setSize( frame.getContentPane().getPreferredSize() ); 39 | frame.setVisible( true ); 40 | // 41 | } 42 | 43 | } 44 | --------------------------------------------------------------------------------