├── .gitignore ├── Assets ├── Animations.meta ├── Animations │ ├── Animations.meta │ ├── Animations │ │ ├── Enemy1Attack.anim │ │ ├── Enemy1Attack.anim.meta │ │ ├── Enemy1Idle.anim │ │ ├── Enemy1Idle.anim.meta │ │ ├── Enemy2Attack.anim │ │ ├── Enemy2Attack.anim.meta │ │ ├── Enemy2Idle.anim │ │ ├── Enemy2Idle.anim.meta │ │ ├── PlayerChop.anim │ │ ├── PlayerChop.anim.meta │ │ ├── PlayerHit.anim │ │ ├── PlayerHit.anim.meta │ │ ├── PlayerIdle.anim │ │ └── PlayerIdle.anim.meta │ ├── AnimatorControllers.meta │ └── AnimatorControllers │ │ ├── Enemy1.controller │ │ ├── Enemy1.controller.meta │ │ ├── Enemy2.overrideController │ │ ├── Enemy2.overrideController.meta │ │ ├── Player.controller │ │ └── Player.controller.meta ├── Audio.meta ├── Audio │ ├── scavengers_chop1.aif │ ├── scavengers_chop1.aif.meta │ ├── scavengers_chop2.aif │ ├── scavengers_chop2.aif.meta │ ├── scavengers_die.aif │ ├── scavengers_die.aif.meta │ ├── scavengers_enemy1.aif │ ├── scavengers_enemy1.aif.meta │ ├── scavengers_enemy2.aif │ ├── scavengers_enemy2.aif.meta │ ├── scavengers_footstep1.aif │ ├── scavengers_footstep1.aif.meta │ ├── scavengers_footstep2.aif │ ├── scavengers_footstep2.aif.meta │ ├── scavengers_fruit1.aif │ ├── scavengers_fruit1.aif.meta │ ├── scavengers_fruit2.aif │ ├── scavengers_fruit2.aif.meta │ ├── scavengers_music.aif │ ├── scavengers_music.aif.meta │ ├── scavengers_soda1.aif │ ├── scavengers_soda1.aif.meta │ ├── scavengers_soda2.aif │ └── scavengers_soda2.aif.meta ├── Completed.meta ├── Completed │ ├── Animation.meta │ ├── Animation │ │ ├── Animations.meta │ │ ├── Animations │ │ │ ├── Enemy1Attack.anim │ │ │ ├── Enemy1Attack.anim.meta │ │ │ ├── Enemy1Idle.anim │ │ │ ├── Enemy1Idle.anim.meta │ │ │ ├── Enemy2Attack.anim │ │ │ ├── Enemy2Attack.anim.meta │ │ │ ├── Enemy2Idle.anim │ │ │ ├── Enemy2Idle.anim.meta │ │ │ ├── PlayerChop.anim │ │ │ ├── PlayerChop.anim.meta │ │ │ ├── PlayerHit.anim │ │ │ ├── PlayerHit.anim.meta │ │ │ ├── PlayerIdle.anim │ │ │ └── PlayerIdle.anim.meta │ │ ├── AnimatorControllers.meta │ │ └── AnimatorControllers │ │ │ ├── Enemy1.controller │ │ │ ├── Enemy1.controller.meta │ │ │ ├── Enemy2.overrideController │ │ │ ├── Enemy2.overrideController.meta │ │ │ ├── Player.controller │ │ │ └── Player.controller.meta │ ├── Prefabs.meta │ ├── Prefabs │ │ ├── Enemy1.prefab │ │ ├── Enemy1.prefab.meta │ │ ├── Enemy2.prefab │ │ ├── Enemy2.prefab.meta │ │ ├── Exit.prefab │ │ ├── Exit.prefab.meta │ │ ├── Floor1.prefab │ │ ├── Floor1.prefab.meta │ │ ├── Floor2.prefab │ │ ├── Floor2.prefab.meta │ │ ├── Floor3.prefab │ │ ├── Floor3.prefab.meta │ │ ├── Floor4.prefab │ │ ├── Floor4.prefab.meta │ │ ├── Floor5.prefab │ │ ├── Floor5.prefab.meta │ │ ├── Floor6.prefab │ │ ├── Floor6.prefab.meta │ │ ├── Floor7.prefab │ │ ├── Floor7.prefab.meta │ │ ├── Floor8.prefab │ │ ├── Floor8.prefab.meta │ │ ├── Food.prefab │ │ ├── Food.prefab.meta │ │ ├── GameManager.prefab │ │ ├── GameManager.prefab.meta │ │ ├── OuterWall1.prefab │ │ ├── OuterWall1.prefab.meta │ │ ├── OuterWall2.prefab │ │ ├── OuterWall2.prefab.meta │ │ ├── OuterWall3.prefab │ │ ├── OuterWall3.prefab.meta │ │ ├── Player.prefab │ │ ├── Player.prefab.meta │ │ ├── Soda.prefab │ │ ├── Soda.prefab.meta │ │ ├── SoundManager.prefab │ │ ├── SoundManager.prefab.meta │ │ ├── Wall1.prefab │ │ ├── Wall1.prefab.meta │ │ ├── Wall2.prefab │ │ ├── Wall2.prefab.meta │ │ ├── Wall3.prefab │ │ ├── Wall3.prefab.meta │ │ ├── Wall4.prefab │ │ ├── Wall4.prefab.meta │ │ ├── Wall5.prefab │ │ ├── Wall5.prefab.meta │ │ ├── Wall6.prefab │ │ ├── Wall6.prefab.meta │ │ ├── Wall7.prefab │ │ ├── Wall7.prefab.meta │ │ ├── Wall8.prefab │ │ └── Wall8.prefab.meta │ ├── Scenes.meta │ ├── Scenes │ │ ├── Main.unity │ │ └── Main.unity.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── BoardManager.cs │ │ ├── BoardManager.cs.meta │ │ ├── Enemy.cs │ │ ├── Enemy.cs.meta │ │ ├── GameManager.cs │ │ ├── GameManager.cs.meta │ │ ├── Loader.cs │ │ ├── Loader.cs.meta │ │ ├── MovingObject.cs │ │ ├── MovingObject.cs.meta │ │ ├── Player.cs │ │ ├── Player.cs.meta │ │ ├── SoundManager.cs │ │ ├── SoundManager.cs.meta │ │ ├── Wall.cs │ │ └── Wall.cs.meta ├── Fonts.meta ├── Fonts │ ├── OFL.txt │ ├── OFL.txt.meta │ ├── PressStart2P-Regular.ttf │ └── PressStart2P-Regular.ttf.meta ├── Prefabs.meta ├── Prefabs │ ├── Enemy1.prefab │ ├── Enemy1.prefab.meta │ ├── Enemy2.prefab │ ├── Enemy2.prefab.meta │ ├── Exit.prefab │ ├── Exit.prefab.meta │ ├── Floor1.prefab │ ├── Floor1.prefab.meta │ ├── Floor2.prefab │ ├── Floor2.prefab.meta │ ├── Floor3.prefab │ ├── Floor3.prefab.meta │ ├── Floor4.prefab │ ├── Floor4.prefab.meta │ ├── Floor5.prefab │ ├── Floor5.prefab.meta │ ├── Floor6.prefab │ ├── Floor6.prefab.meta │ ├── Floor7.prefab │ ├── Floor7.prefab.meta │ ├── Floor8.prefab │ ├── Floor8.prefab.meta │ ├── Food.prefab │ ├── Food.prefab.meta │ ├── GameManager.prefab │ ├── GameManager.prefab.meta │ ├── OuterWall1.prefab │ ├── OuterWall1.prefab.meta │ ├── OuterWall2.prefab │ ├── OuterWall2.prefab.meta │ ├── OuterWall3.prefab │ ├── OuterWall3.prefab.meta │ ├── Player.prefab │ ├── Player.prefab.meta │ ├── Soda.prefab │ ├── Soda.prefab.meta │ ├── Wall1.prefab │ ├── Wall1.prefab.meta │ ├── Wall2.prefab │ ├── Wall2.prefab.meta │ ├── Wall3.prefab │ ├── Wall3.prefab.meta │ ├── Wall4.prefab │ ├── Wall4.prefab.meta │ ├── Wall5.prefab │ ├── Wall5.prefab.meta │ ├── Wall6.prefab │ ├── Wall6.prefab.meta │ ├── Wall7.prefab │ ├── Wall7.prefab.meta │ ├── Wall8.prefab │ └── Wall8.prefab.meta ├── Scenes.meta ├── Scenes │ ├── Main.unity │ └── Main.unity.meta ├── Scripts.meta ├── Scripts │ ├── BoardManager.cs │ ├── BoardManager.cs.meta │ ├── Enemy.cs │ ├── Enemy.cs.meta │ ├── GameManager.cs │ ├── GameManager.cs.meta │ ├── Loader.cs │ ├── Loader.cs.meta │ ├── MovingObject.cs │ ├── MovingObject.cs.meta │ ├── Player.cs │ ├── Player.cs.meta │ ├── SoundManager.cs │ ├── SoundManager.cs.meta │ ├── Wall.cs │ └── Wall.cs.meta ├── Sprites.meta └── Sprites │ ├── Scavengers_SpriteSheet.png │ └── Scavengers_SpriteSheet.png.meta ├── LICENSE ├── ProjectSettings ├── AudioManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NavMeshLayers.asset ├── NavMeshLayers.asset.meta ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset └── TimeManager.asset └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Oo]bj/ 4 | [Bb]uild/ 5 | 6 | # Autogenerated VS/MD solution and project files 7 | /*.csproj 8 | /*.unityproj 9 | /*.sln 10 | /*.suo 11 | /*.user 12 | /*.userprefs 13 | /*.pidb 14 | /*.booproj 15 | 16 | #Unity3D Generated File On Crash Reports 17 | sysinfo.txt 18 | -------------------------------------------------------------------------------- /Assets/Animations.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: af8dde1fe712e44c4a72281d9de62bde 3 | folderAsset: yes 4 | timeCreated: 1424842167 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Animations/Animations.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eadba2d1ba9124a888f9f92e63deb6f6 3 | folderAsset: yes 4 | timeCreated: 1424842168 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Animations/Animations/Enemy1Attack.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Animations/Animations/Enemy1Attack.anim -------------------------------------------------------------------------------- /Assets/Animations/Animations/Enemy1Attack.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d64a2d4749fa4c77831b4bd58e11b3c 3 | timeCreated: 1425063103 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Animations/Animations/Enemy1Idle.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Animations/Animations/Enemy1Idle.anim -------------------------------------------------------------------------------- /Assets/Animations/Animations/Enemy1Idle.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 23fb9ae2ce05449949b5e3733b86a716 3 | timeCreated: 1425063035 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Animations/Animations/Enemy2Attack.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Animations/Animations/Enemy2Attack.anim -------------------------------------------------------------------------------- /Assets/Animations/Animations/Enemy2Attack.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bfadb5efd5ee84385b3d6e6d7305abd6 3 | timeCreated: 1425063584 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Animations/Animations/Enemy2Idle.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Animations/Animations/Enemy2Idle.anim -------------------------------------------------------------------------------- /Assets/Animations/Animations/Enemy2Idle.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7db69c3cc9f6f4011bdae3178764715a 3 | timeCreated: 1425063449 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Animations/Animations/PlayerChop.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Animations/Animations/PlayerChop.anim -------------------------------------------------------------------------------- /Assets/Animations/Animations/PlayerChop.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73d814c6ec8af4b9790389ac001116a0 3 | timeCreated: 1425060659 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Animations/Animations/PlayerHit.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Animations/Animations/PlayerHit.anim -------------------------------------------------------------------------------- /Assets/Animations/Animations/PlayerHit.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8363867f4027745e09eb993b6a96a187 3 | timeCreated: 1425060713 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Animations/Animations/PlayerIdle.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Animations/Animations/PlayerIdle.anim -------------------------------------------------------------------------------- /Assets/Animations/Animations/PlayerIdle.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d130b68269d93467aa9cec1f427a90f9 3 | timeCreated: 1425060519 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Animations/AnimatorControllers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 98294fbfdfe2e435488d274924c82aa2 3 | folderAsset: yes 4 | timeCreated: 1424842168 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Animations/AnimatorControllers/Enemy1.controller: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Animations/AnimatorControllers/Enemy1.controller -------------------------------------------------------------------------------- /Assets/Animations/AnimatorControllers/Enemy1.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a523fcd327804f1d81d485ea1a7ab82 3 | timeCreated: 1425063035 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Animations/AnimatorControllers/Enemy2.overrideController: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Animations/AnimatorControllers/Enemy2.overrideController -------------------------------------------------------------------------------- /Assets/Animations/AnimatorControllers/Enemy2.overrideController.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3368d93c017c7408982a2e105f399770 3 | timeCreated: 1425063691 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Animations/AnimatorControllers/Player.controller: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Animations/AnimatorControllers/Player.controller -------------------------------------------------------------------------------- /Assets/Animations/AnimatorControllers/Player.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d7315bf1ec93c4cbfa667f87242370f0 3 | timeCreated: 1425060519 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Audio.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f64576655430c42429121b3f409ae46e 3 | folderAsset: yes 4 | timeCreated: 1424842167 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Audio/scavengers_chop1.aif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Audio/scavengers_chop1.aif -------------------------------------------------------------------------------- /Assets/Audio/scavengers_chop1.aif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c2332bc8245b474dad63074059bb755 3 | AudioImporter: 4 | serializedVersion: 6 5 | defaultSettings: 6 | loadType: 1 7 | sampleRateSetting: 0 8 | sampleRateOverride: 0 9 | compressionFormat: 0 10 | quality: .5 11 | conversionMode: 0 12 | platformSettingOverrides: {} 13 | forceToMono: 0 14 | preloadAudioData: 1 15 | loadInBackground: 0 16 | 3D: 0 17 | userData: 18 | assetBundleName: 19 | assetBundleVariant: 20 | -------------------------------------------------------------------------------- /Assets/Audio/scavengers_chop2.aif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Audio/scavengers_chop2.aif -------------------------------------------------------------------------------- /Assets/Audio/scavengers_chop2.aif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6aaac83be9e0493493aace800b76619 3 | AudioImporter: 4 | serializedVersion: 6 5 | defaultSettings: 6 | loadType: 1 7 | sampleRateSetting: 0 8 | sampleRateOverride: 0 9 | compressionFormat: 0 10 | quality: .5 11 | conversionMode: 0 12 | platformSettingOverrides: {} 13 | forceToMono: 0 14 | preloadAudioData: 1 15 | loadInBackground: 0 16 | 3D: 0 17 | userData: 18 | assetBundleName: 19 | assetBundleVariant: 20 | -------------------------------------------------------------------------------- /Assets/Audio/scavengers_die.aif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Audio/scavengers_die.aif -------------------------------------------------------------------------------- /Assets/Audio/scavengers_die.aif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e2beefeb2273f4efe992adf5b8d67c29 3 | AudioImporter: 4 | serializedVersion: 6 5 | defaultSettings: 6 | loadType: 1 7 | sampleRateSetting: 0 8 | sampleRateOverride: 0 9 | compressionFormat: 0 10 | quality: .5 11 | conversionMode: 0 12 | platformSettingOverrides: {} 13 | forceToMono: 0 14 | preloadAudioData: 1 15 | loadInBackground: 0 16 | 3D: 0 17 | userData: 18 | assetBundleName: 19 | assetBundleVariant: 20 | -------------------------------------------------------------------------------- /Assets/Audio/scavengers_enemy1.aif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Audio/scavengers_enemy1.aif -------------------------------------------------------------------------------- /Assets/Audio/scavengers_enemy1.aif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0db8cac2749584a009540aa5671ee80d 3 | AudioImporter: 4 | serializedVersion: 6 5 | defaultSettings: 6 | loadType: 1 7 | sampleRateSetting: 0 8 | sampleRateOverride: 0 9 | compressionFormat: 0 10 | quality: .5 11 | conversionMode: 0 12 | platformSettingOverrides: {} 13 | forceToMono: 0 14 | preloadAudioData: 1 15 | loadInBackground: 0 16 | 3D: 0 17 | userData: 18 | assetBundleName: 19 | assetBundleVariant: 20 | -------------------------------------------------------------------------------- /Assets/Audio/scavengers_enemy2.aif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Audio/scavengers_enemy2.aif -------------------------------------------------------------------------------- /Assets/Audio/scavengers_enemy2.aif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 114514a3b3697484ebaa08f7fbf842d3 3 | AudioImporter: 4 | serializedVersion: 6 5 | defaultSettings: 6 | loadType: 1 7 | sampleRateSetting: 0 8 | sampleRateOverride: 0 9 | compressionFormat: 0 10 | quality: .5 11 | conversionMode: 0 12 | platformSettingOverrides: {} 13 | forceToMono: 0 14 | preloadAudioData: 1 15 | loadInBackground: 0 16 | 3D: 0 17 | userData: 18 | assetBundleName: 19 | assetBundleVariant: 20 | -------------------------------------------------------------------------------- /Assets/Audio/scavengers_footstep1.aif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Audio/scavengers_footstep1.aif -------------------------------------------------------------------------------- /Assets/Audio/scavengers_footstep1.aif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 892962212a4b74d1c9f578a3b6ea6439 3 | AudioImporter: 4 | serializedVersion: 6 5 | defaultSettings: 6 | loadType: 1 7 | sampleRateSetting: 0 8 | sampleRateOverride: 0 9 | compressionFormat: 0 10 | quality: .5 11 | conversionMode: 0 12 | platformSettingOverrides: {} 13 | forceToMono: 0 14 | preloadAudioData: 1 15 | loadInBackground: 0 16 | 3D: 0 17 | userData: 18 | assetBundleName: 19 | assetBundleVariant: 20 | -------------------------------------------------------------------------------- /Assets/Audio/scavengers_footstep2.aif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Audio/scavengers_footstep2.aif -------------------------------------------------------------------------------- /Assets/Audio/scavengers_footstep2.aif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a826bc3d758db43d6ae9caf415b63d1d 3 | AudioImporter: 4 | serializedVersion: 6 5 | defaultSettings: 6 | loadType: 1 7 | sampleRateSetting: 0 8 | sampleRateOverride: 0 9 | compressionFormat: 0 10 | quality: .5 11 | conversionMode: 0 12 | platformSettingOverrides: {} 13 | forceToMono: 0 14 | preloadAudioData: 1 15 | loadInBackground: 0 16 | 3D: 0 17 | userData: 18 | assetBundleName: 19 | assetBundleVariant: 20 | -------------------------------------------------------------------------------- /Assets/Audio/scavengers_fruit1.aif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Audio/scavengers_fruit1.aif -------------------------------------------------------------------------------- /Assets/Audio/scavengers_fruit1.aif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1cb61f83d60374c7389bb547431919e3 3 | AudioImporter: 4 | serializedVersion: 6 5 | defaultSettings: 6 | loadType: 1 7 | sampleRateSetting: 0 8 | sampleRateOverride: 0 9 | compressionFormat: 0 10 | quality: .5 11 | conversionMode: 0 12 | platformSettingOverrides: {} 13 | forceToMono: 0 14 | preloadAudioData: 1 15 | loadInBackground: 0 16 | 3D: 0 17 | userData: 18 | assetBundleName: 19 | assetBundleVariant: 20 | -------------------------------------------------------------------------------- /Assets/Audio/scavengers_fruit2.aif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Audio/scavengers_fruit2.aif -------------------------------------------------------------------------------- /Assets/Audio/scavengers_fruit2.aif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 062161c1897a54088a5430f8c197e1b8 3 | AudioImporter: 4 | serializedVersion: 6 5 | defaultSettings: 6 | loadType: 1 7 | sampleRateSetting: 0 8 | sampleRateOverride: 0 9 | compressionFormat: 0 10 | quality: .5 11 | conversionMode: 0 12 | platformSettingOverrides: {} 13 | forceToMono: 0 14 | preloadAudioData: 1 15 | loadInBackground: 0 16 | 3D: 0 17 | userData: 18 | assetBundleName: 19 | assetBundleVariant: 20 | -------------------------------------------------------------------------------- /Assets/Audio/scavengers_music.aif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Audio/scavengers_music.aif -------------------------------------------------------------------------------- /Assets/Audio/scavengers_music.aif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d75080d0851d4613ada1117d91ee417 3 | AudioImporter: 4 | serializedVersion: 6 5 | defaultSettings: 6 | loadType: 1 7 | sampleRateSetting: 0 8 | sampleRateOverride: 0 9 | compressionFormat: 0 10 | quality: .5 11 | conversionMode: 0 12 | platformSettingOverrides: {} 13 | forceToMono: 0 14 | preloadAudioData: 1 15 | loadInBackground: 0 16 | 3D: 0 17 | userData: 18 | assetBundleName: 19 | assetBundleVariant: 20 | -------------------------------------------------------------------------------- /Assets/Audio/scavengers_soda1.aif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Audio/scavengers_soda1.aif -------------------------------------------------------------------------------- /Assets/Audio/scavengers_soda1.aif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6b608537288246c9a464915db27bf52 3 | AudioImporter: 4 | serializedVersion: 6 5 | defaultSettings: 6 | loadType: 1 7 | sampleRateSetting: 0 8 | sampleRateOverride: 0 9 | compressionFormat: 0 10 | quality: .5 11 | conversionMode: 0 12 | platformSettingOverrides: {} 13 | forceToMono: 0 14 | preloadAudioData: 1 15 | loadInBackground: 0 16 | 3D: 0 17 | userData: 18 | assetBundleName: 19 | assetBundleVariant: 20 | -------------------------------------------------------------------------------- /Assets/Audio/scavengers_soda2.aif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Audio/scavengers_soda2.aif -------------------------------------------------------------------------------- /Assets/Audio/scavengers_soda2.aif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bcb9dda73ee914d3e8f252895f73f461 3 | AudioImporter: 4 | serializedVersion: 6 5 | defaultSettings: 6 | loadType: 1 7 | sampleRateSetting: 0 8 | sampleRateOverride: 0 9 | compressionFormat: 0 10 | quality: .5 11 | conversionMode: 0 12 | platformSettingOverrides: {} 13 | forceToMono: 0 14 | preloadAudioData: 1 15 | loadInBackground: 0 16 | 3D: 0 17 | userData: 18 | assetBundleName: 19 | assetBundleVariant: 20 | -------------------------------------------------------------------------------- /Assets/Completed.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80572675a600d4752ac495da226743b0 3 | folderAsset: yes 4 | timeCreated: 1424842167 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Completed/Animation.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 429dd70778e324b75962fe09c62b370c 3 | folderAsset: yes 4 | timeCreated: 1424842168 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Completed/Animation/Animations.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 15fb2cf97b75046a79f612f0fdc90668 3 | folderAsset: yes 4 | timeCreated: 1424842168 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Completed/Animation/Animations/Enemy1Attack.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Animation/Animations/Enemy1Attack.anim -------------------------------------------------------------------------------- /Assets/Completed/Animation/Animations/Enemy1Attack.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d27b42c7b05ae47b8a5357d81d590f01 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Animation/Animations/Enemy1Idle.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Animation/Animations/Enemy1Idle.anim -------------------------------------------------------------------------------- /Assets/Completed/Animation/Animations/Enemy1Idle.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5afd3037c1370446fb0a18a403eb806e 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Animation/Animations/Enemy2Attack.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Animation/Animations/Enemy2Attack.anim -------------------------------------------------------------------------------- /Assets/Completed/Animation/Animations/Enemy2Attack.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cfbd97c78ee5a48bfb9c77d2557b4a03 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Animation/Animations/Enemy2Idle.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Animation/Animations/Enemy2Idle.anim -------------------------------------------------------------------------------- /Assets/Completed/Animation/Animations/Enemy2Idle.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5eae0f1926a14fa5ad34bd8f671afb1 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Animation/Animations/PlayerChop.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Animation/Animations/PlayerChop.anim -------------------------------------------------------------------------------- /Assets/Completed/Animation/Animations/PlayerChop.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1e7ecc239aec4292a421108d3884268 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Animation/Animations/PlayerHit.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Animation/Animations/PlayerHit.anim -------------------------------------------------------------------------------- /Assets/Completed/Animation/Animations/PlayerHit.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb6a8b9e76955449ea0a724eb706705d 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Animation/Animations/PlayerIdle.anim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Animation/Animations/PlayerIdle.anim -------------------------------------------------------------------------------- /Assets/Completed/Animation/Animations/PlayerIdle.anim.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ae8e07f178274cb0bc69285d1aa5ef1 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Animation/AnimatorControllers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb7d70cee2d3d443aa2defa754e4f558 3 | folderAsset: yes 4 | timeCreated: 1424842168 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Completed/Animation/AnimatorControllers/Enemy1.controller: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Animation/AnimatorControllers/Enemy1.controller -------------------------------------------------------------------------------- /Assets/Completed/Animation/AnimatorControllers/Enemy1.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2980f4165a534b529ce669cbe3e8246 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Animation/AnimatorControllers/Enemy2.overrideController: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Animation/AnimatorControllers/Enemy2.overrideController -------------------------------------------------------------------------------- /Assets/Completed/Animation/AnimatorControllers/Enemy2.overrideController.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 48a3eefec5b8d447a8b8ce0e78f6813c 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Animation/AnimatorControllers/Player.controller: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Animation/AnimatorControllers/Player.controller -------------------------------------------------------------------------------- /Assets/Completed/Animation/AnimatorControllers/Player.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed88edb0ae145440684f0bf998629c0c 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 626dd7fd9b5fb41d897b17ce7c874e42 3 | folderAsset: yes 4 | timeCreated: 1424842168 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Enemy1.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Enemy1.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Enemy1.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ebfba08a213d34c46ba2b1947aeaea83 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Enemy2.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Enemy2.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Enemy2.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 089a2f2c322ea40f9afdfaba0550c6d3 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Exit.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Exit.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Exit.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cb0f3020bafec423aa31d0e491c4b811 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Floor1.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Floor1.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Floor1.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 038998774947c4a8fa170d5b4492a7dd 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Floor2.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Floor2.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Floor2.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 41775b29042354678bcd58bb1a75871e 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Floor3.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Floor3.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Floor3.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 74398dca0c1f64f34aab8ba7bdb6c527 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Floor4.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Floor4.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Floor4.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed4c829589732490894350b134530050 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Floor5.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Floor5.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Floor5.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 04993e7a7b0514f0c8857ff106529ce1 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Floor6.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Floor6.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Floor6.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4cdf8ac85eff446d0a8fefbdc8c6569f 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Floor7.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Floor7.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Floor7.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5535fd6cd705e4a79a1d5a4f114de5dc 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Floor8.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Floor8.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Floor8.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c18e9692903814865aa9a855aaa66df5 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Food.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Food.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Food.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad25a4e752915438e9f55a35bedacf1f 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/GameManager.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/GameManager.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/GameManager.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ca8c6e960c494bbd937610290f80d1b 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/OuterWall1.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/OuterWall1.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/OuterWall1.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7094f72151ec74f569c4e03f1ec0f8e7 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/OuterWall2.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/OuterWall2.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/OuterWall2.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b0ace21a29149403094422fb3bd96aa9 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/OuterWall3.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/OuterWall3.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/OuterWall3.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e85c94355cc4641da919bd5d0ac956d4 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Player.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Player.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Player.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 28b53fc28d3a140c392f0e2d919f9de1 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Soda.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Soda.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Soda.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46e8bf4bf645a47e3ae1b60c7e18418c 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/SoundManager.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/SoundManager.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/SoundManager.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 76cd81135280f4ad6a4fa80f6422aea2 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Wall1.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Wall1.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Wall1.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2570048905bd94d6f8a99d13b80daf90 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Wall2.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Wall2.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Wall2.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b86334000bc0f47ba8dd33ea88cfcdb1 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Wall3.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Wall3.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Wall3.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01ca47a83ebe24ca5a2f6b1d6dcd7481 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Wall4.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Wall4.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Wall4.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 022eda2f1f0cb45e28ff6840b68928bc 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Wall5.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Wall5.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Wall5.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1816487b15cd4c5fbd9587521e068ca 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Wall6.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Wall6.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Wall6.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ddc2d7828b2d462286f09274199ad9a 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Wall7.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Wall7.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Wall7.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 64139c47b57e34c5fa97fd79f8d25244 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Wall8.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Prefabs/Wall8.prefab -------------------------------------------------------------------------------- /Assets/Completed/Prefabs/Wall8.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 741804431f4d341cdae1f15b3896aeff 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d948ea9d6157453b913820b7497c017 3 | folderAsset: yes 4 | timeCreated: 1424842167 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Completed/Scenes/Main.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Completed/Scenes/Main.unity -------------------------------------------------------------------------------- /Assets/Completed/Scenes/Main.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 329f4be6b831e43008ec1ddeaae85de9 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Completed/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cfb131ec971cc406da96b76ae69dbc9d 3 | folderAsset: yes 4 | timeCreated: 1424842168 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Completed/Scripts/BoardManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections.Generic; //Allows us to use Lists. 4 | using Random = UnityEngine.Random; //Tells Random to use the Unity Engine random number generator. 5 | 6 | namespace Completed 7 | 8 | { 9 | 10 | public class BoardManager : MonoBehaviour 11 | { 12 | // Using Serializable allows us to embed a class with sub properties in the inspector. 13 | [Serializable] 14 | public class Count 15 | { 16 | public int minimum; //Minimum value for our Count class. 17 | public int maximum; //Maximum value for our Count class. 18 | 19 | 20 | //Assignment constructor. 21 | public Count (int min, int max) 22 | { 23 | minimum = min; 24 | maximum = max; 25 | } 26 | } 27 | 28 | 29 | public int columns = 8; //Number of columns in our game board. 30 | public int rows = 8; //Number of rows in our game board. 31 | public Count wallCount = new Count (5, 9); //Lower and upper limit for our random number of walls per level. 32 | public Count foodCount = new Count (1, 5); //Lower and upper limit for our random number of food items per level. 33 | public GameObject exit; //Prefab to spawn for exit. 34 | public GameObject[] floorTiles; //Array of floor prefabs. 35 | public GameObject[] wallTiles; //Array of wall prefabs. 36 | public GameObject[] foodTiles; //Array of food prefabs. 37 | public GameObject[] enemyTiles; //Array of enemy prefabs. 38 | public GameObject[] outerWallTiles; //Array of outer tile prefabs. 39 | 40 | private Transform boardHolder; //A variable to store a reference to the transform of our Board object. 41 | private List gridPositions = new List (); //A list of possible locations to place tiles. 42 | 43 | 44 | //Clears our list gridPositions and prepares it to generate a new board. 45 | void InitialiseList () 46 | { 47 | //Clear our list gridPositions. 48 | gridPositions.Clear (); 49 | 50 | //Loop through x axis (columns). 51 | for(int x = 1; x < columns-1; x++) 52 | { 53 | //Within each column, loop through y axis (rows). 54 | for(int y = 1; y < rows-1; y++) 55 | { 56 | //At each index add a new Vector3 to our list with the x and y coordinates of that position. 57 | gridPositions.Add (new Vector3(x, y, 0f)); 58 | } 59 | } 60 | } 61 | 62 | 63 | //Sets up the outer walls and floor (background) of the game board. 64 | void BoardSetup () 65 | { 66 | //Instantiate Board and set boardHolder to its transform. 67 | boardHolder = new GameObject ("Board").transform; 68 | 69 | //Loop along x axis, starting from -1 (to fill corner) with floor or outerwall edge tiles. 70 | for(int x = -1; x < columns + 1; x++) 71 | { 72 | //Loop along y axis, starting from -1 to place floor or outerwall tiles. 73 | for(int y = -1; y < rows + 1; y++) 74 | { 75 | //Choose a random tile from our array of floor tile prefabs and prepare to instantiate it. 76 | GameObject toInstantiate = floorTiles[Random.Range (0,floorTiles.Length)]; 77 | 78 | //Check if we current position is at board edge, if so choose a random outer wall prefab from our array of outer wall tiles. 79 | if(x == -1 || x == columns || y == -1 || y == rows) 80 | toInstantiate = outerWallTiles [Random.Range (0, outerWallTiles.Length)]; 81 | 82 | //Instantiate the GameObject instance using the prefab chosen for toInstantiate at the Vector3 corresponding to current grid position in loop, cast it to GameObject. 83 | GameObject instance = 84 | Instantiate (toInstantiate, new Vector3 (x, y, 0f), Quaternion.identity) as GameObject; 85 | 86 | //Set the parent of our newly instantiated object instance to boardHolder, this is just organizational to avoid cluttering hierarchy. 87 | instance.transform.SetParent (boardHolder); 88 | } 89 | } 90 | } 91 | 92 | 93 | //RandomPosition returns a random position from our list gridPositions. 94 | Vector3 RandomPosition () 95 | { 96 | //Declare an integer randomIndex, set it's value to a random number between 0 and the count of items in our List gridPositions. 97 | int randomIndex = Random.Range (0, gridPositions.Count); 98 | 99 | //Declare a variable of type Vector3 called randomPosition, set it's value to the entry at randomIndex from our List gridPositions. 100 | Vector3 randomPosition = gridPositions[randomIndex]; 101 | 102 | //Remove the entry at randomIndex from the list so that it can't be re-used. 103 | gridPositions.RemoveAt (randomIndex); 104 | 105 | //Return the randomly selected Vector3 position. 106 | return randomPosition; 107 | } 108 | 109 | 110 | //LayoutObjectAtRandom accepts an array of game objects to choose from along with a minimum and maximum range for the number of objects to create. 111 | void LayoutObjectAtRandom (GameObject[] tileArray, int minimum, int maximum) 112 | { 113 | //Choose a random number of objects to instantiate within the minimum and maximum limits 114 | int objectCount = Random.Range (minimum, maximum+1); 115 | 116 | //Instantiate objects until the randomly chosen limit objectCount is reached 117 | for(int i = 0; i < objectCount; i++) 118 | { 119 | //Choose a position for randomPosition by getting a random position from our list of available Vector3s stored in gridPosition 120 | Vector3 randomPosition = RandomPosition(); 121 | 122 | //Choose a random tile from tileArray and assign it to tileChoice 123 | GameObject tileChoice = tileArray[Random.Range (0, tileArray.Length)]; 124 | 125 | //Instantiate tileChoice at the position returned by RandomPosition with no change in rotation 126 | Instantiate(tileChoice, randomPosition, Quaternion.identity); 127 | } 128 | } 129 | 130 | 131 | //SetupScene initializes our level and calls the previous functions to lay out the game board 132 | public void SetupScene (int level) 133 | { 134 | //Creates the outer walls and floor. 135 | BoardSetup (); 136 | 137 | //Reset our list of gridpositions. 138 | InitialiseList (); 139 | 140 | //Instantiate a random number of wall tiles based on minimum and maximum, at randomized positions. 141 | LayoutObjectAtRandom (wallTiles, wallCount.minimum, wallCount.maximum); 142 | 143 | //Instantiate a random number of food tiles based on minimum and maximum, at randomized positions. 144 | LayoutObjectAtRandom (foodTiles, foodCount.minimum, foodCount.maximum); 145 | 146 | //Determine number of enemies based on current level number, based on a logarithmic progression 147 | int enemyCount = (int)Mathf.Log(level, 2f); 148 | 149 | //Instantiate a random number of enemies based on minimum and maximum, at randomized positions. 150 | LayoutObjectAtRandom (enemyTiles, enemyCount, enemyCount); 151 | 152 | //Instantiate the exit tile in the upper right hand corner of our game board 153 | Instantiate (exit, new Vector3 (columns - 1, rows - 1, 0f), Quaternion.identity); 154 | } 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /Assets/Completed/Scripts/BoardManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fff182172d726402b9e9eacdb89c9724 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Completed/Scripts/Enemy.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | namespace Completed 5 | { 6 | //Enemy inherits from MovingObject, our base class for objects that can move, Player also inherits from this. 7 | public class Enemy : MovingObject 8 | { 9 | public int playerDamage; //The amount of food points to subtract from the player when attacking. 10 | public AudioClip attackSound1; //First of two audio clips to play when attacking the player. 11 | public AudioClip attackSound2; //Second of two audio clips to play when attacking the player. 12 | 13 | 14 | private Animator animator; //Variable of type Animator to store a reference to the enemy's Animator component. 15 | private Transform target; //Transform to attempt to move toward each turn. 16 | private bool skipMove; //Boolean to determine whether or not enemy should skip a turn or move this turn. 17 | 18 | 19 | //Start overrides the virtual Start function of the base class. 20 | protected override void Start () 21 | { 22 | //Register this enemy with our instance of GameManager by adding it to a list of Enemy objects. 23 | //This allows the GameManager to issue movement commands. 24 | GameManager.instance.AddEnemyToList (this); 25 | 26 | //Get and store a reference to the attached Animator component. 27 | animator = GetComponent (); 28 | 29 | //Find the Player GameObject using it's tag and store a reference to its transform component. 30 | target = GameObject.FindGameObjectWithTag ("Player").transform; 31 | 32 | //Call the start function of our base class MovingObject. 33 | base.Start (); 34 | } 35 | 36 | 37 | //Override the AttemptMove function of MovingObject to include functionality needed for Enemy to skip turns. 38 | //See comments in MovingObject for more on how base AttemptMove function works. 39 | protected override void AttemptMove (int xDir, int yDir) 40 | { 41 | //Check if skipMove is true, if so set it to false and skip this turn. 42 | if(skipMove) 43 | { 44 | skipMove = false; 45 | return; 46 | 47 | } 48 | 49 | //Call the AttemptMove function from MovingObject. 50 | base.AttemptMove (xDir, yDir); 51 | 52 | //Now that Enemy has moved, set skipMove to true to skip next move. 53 | skipMove = true; 54 | } 55 | 56 | 57 | //MoveEnemy is called by the GameManger each turn to tell each Enemy to try to move towards the player. 58 | public void MoveEnemy () 59 | { 60 | //Declare variables for X and Y axis move directions, these range from -1 to 1. 61 | //These values allow us to choose between the cardinal directions: up, down, left and right. 62 | int xDir = 0; 63 | int yDir = 0; 64 | 65 | //If the difference in positions is approximately zero (Epsilon) do the following: 66 | if(Mathf.Abs (target.position.x - transform.position.x) < float.Epsilon) 67 | 68 | //If the y coordinate of the target's (player) position is greater than the y coordinate of this enemy's position set y direction 1 (to move up). If not, set it to -1 (to move down). 69 | yDir = target.position.y > transform.position.y ? 1 : -1; 70 | 71 | //If the difference in positions is not approximately zero (Epsilon) do the following: 72 | else 73 | //Check if target x position is greater than enemy's x position, if so set x direction to 1 (move right), if not set to -1 (move left). 74 | xDir = target.position.x > transform.position.x ? 1 : -1; 75 | 76 | //Call the AttemptMove function and pass in the generic parameter Player, because Enemy is moving and expecting to potentially encounter a Player 77 | AttemptMove (xDir, yDir); 78 | } 79 | 80 | 81 | //OnCantMove is called if Enemy attempts to move into a space occupied by a Player, it overrides the OnCantMove function of MovingObject 82 | //and takes a generic parameter T which we use to pass in the component we expect to encounter, in this case Player 83 | protected override void OnCantMove (T component) 84 | { 85 | //Declare hitPlayer and set it to equal the encountered component. 86 | Player hitPlayer = component as Player; 87 | 88 | //Call the LoseFood function of hitPlayer passing it playerDamage, the amount of foodpoints to be subtracted. 89 | hitPlayer.LoseFood (playerDamage); 90 | 91 | //Set the attack trigger of animator to trigger Enemy attack animation. 92 | animator.SetTrigger ("enemyAttack"); 93 | 94 | //Call the RandomizeSfx function of SoundManager passing in the two audio clips to choose randomly between. 95 | SoundManager.instance.RandomizeSfx (attackSound1, attackSound2); 96 | } 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Assets/Completed/Scripts/Enemy.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d22f79ef0655a41bb9e62823f6e7a3f1 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Completed/Scripts/GameManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | namespace Completed 5 | { 6 | using System.Collections.Generic; //Allows us to use Lists. 7 | using UnityEngine.UI; //Allows us to use UI. 8 | 9 | public class GameManager : MonoBehaviour 10 | { 11 | public float levelStartDelay = 2f; //Time to wait before starting level, in seconds. 12 | public float turnDelay = 0.1f; //Delay between each Player turn. 13 | public int playerFoodPoints = 100; //Starting value for Player food points. 14 | public static GameManager instance = null; //Static instance of GameManager which allows it to be accessed by any other script. 15 | [HideInInspector] public bool playersTurn = true; //Boolean to check if it's players turn, hidden in inspector but public. 16 | 17 | 18 | private Text levelText; //Text to display current level number. 19 | private GameObject levelImage; //Image to block out level as levels are being set up, background for levelText. 20 | private BoardManager boardScript; //Store a reference to our BoardManager which will set up the level. 21 | private int level = 1; //Current level number, expressed in game as "Day 1". 22 | private List enemies; //List of all Enemy units, used to issue them move commands. 23 | private bool enemiesMoving; //Boolean to check if enemies are moving. 24 | private bool doingSetup = true; //Boolean to check if we're setting up board, prevent Player from moving during setup. 25 | 26 | 27 | 28 | //Awake is always called before any Start functions 29 | void Awake() 30 | { 31 | //Check if instance already exists 32 | if (instance == null) 33 | 34 | //if not, set instance to this 35 | instance = this; 36 | 37 | //If instance already exists and it's not this: 38 | else if (instance != this) 39 | 40 | //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager. 41 | Destroy(gameObject); 42 | 43 | //Sets this to not be destroyed when reloading scene 44 | DontDestroyOnLoad(gameObject); 45 | 46 | //Assign enemies to a new List of Enemy objects. 47 | enemies = new List(); 48 | 49 | //Get a component reference to the attached BoardManager script 50 | boardScript = GetComponent(); 51 | 52 | //Call the InitGame function to initialize the first level 53 | InitGame(); 54 | } 55 | 56 | //This is called each time a scene is loaded. 57 | void OnLevelWasLoaded(int index) 58 | { 59 | //Add one to our level number. 60 | level++; 61 | //Call InitGame to initialize our level. 62 | InitGame(); 63 | } 64 | 65 | //Initializes the game for each level. 66 | void InitGame() 67 | { 68 | //While doingSetup is true the player can't move, prevent player from moving while title card is up. 69 | doingSetup = true; 70 | 71 | //Get a reference to our image LevelImage by finding it by name. 72 | levelImage = GameObject.Find("LevelImage"); 73 | 74 | //Get a reference to our text LevelText's text component by finding it by name and calling GetComponent. 75 | levelText = GameObject.Find("LevelText").GetComponent(); 76 | 77 | //Set the text of levelText to the string "Day" and append the current level number. 78 | levelText.text = "Day " + level; 79 | 80 | //Set levelImage to active blocking player's view of the game board during setup. 81 | levelImage.SetActive(true); 82 | 83 | //Call the HideLevelImage function with a delay in seconds of levelStartDelay. 84 | Invoke("HideLevelImage", levelStartDelay); 85 | 86 | //Clear any Enemy objects in our List to prepare for next level. 87 | enemies.Clear(); 88 | 89 | //Call the SetupScene function of the BoardManager script, pass it current level number. 90 | boardScript.SetupScene(level); 91 | 92 | } 93 | 94 | 95 | //Hides black image used between levels 96 | void HideLevelImage() 97 | { 98 | //Disable the levelImage gameObject. 99 | levelImage.SetActive(false); 100 | 101 | //Set doingSetup to false allowing player to move again. 102 | doingSetup = false; 103 | } 104 | 105 | //Update is called every frame. 106 | void Update() 107 | { 108 | //Check that playersTurn or enemiesMoving or doingSetup are not currently true. 109 | if(playersTurn || enemiesMoving || doingSetup) 110 | 111 | //If any of these are true, return and do not start MoveEnemies. 112 | return; 113 | 114 | //Start moving enemies. 115 | StartCoroutine (MoveEnemies ()); 116 | } 117 | 118 | //Call this to add the passed in Enemy to the List of Enemy objects. 119 | public void AddEnemyToList(Enemy script) 120 | { 121 | //Add Enemy to List enemies. 122 | enemies.Add(script); 123 | } 124 | 125 | 126 | //GameOver is called when the player reaches 0 food points 127 | public void GameOver() 128 | { 129 | //Set levelText to display number of levels passed and game over message 130 | levelText.text = "After " + level + " days, you starved."; 131 | 132 | //Enable black background image gameObject. 133 | levelImage.SetActive(true); 134 | 135 | //Disable this GameManager. 136 | enabled = false; 137 | } 138 | 139 | //Coroutine to move enemies in sequence. 140 | IEnumerator MoveEnemies() 141 | { 142 | //While enemiesMoving is true player is unable to move. 143 | enemiesMoving = true; 144 | 145 | //Wait for turnDelay seconds, defaults to .1 (100 ms). 146 | yield return new WaitForSeconds(turnDelay); 147 | 148 | //If there are no enemies spawned (IE in first level): 149 | if (enemies.Count == 0) 150 | { 151 | //Wait for turnDelay seconds between moves, replaces delay caused by enemies moving when there are none. 152 | yield return new WaitForSeconds(turnDelay); 153 | } 154 | 155 | //Loop through List of Enemy objects. 156 | for (int i = 0; i < enemies.Count; i++) 157 | { 158 | //Call the MoveEnemy function of Enemy at index i in the enemies List. 159 | enemies[i].MoveEnemy (); 160 | 161 | //Wait for Enemy's moveTime before moving next Enemy, 162 | yield return new WaitForSeconds(enemies[i].moveTime); 163 | } 164 | //Once Enemies are done moving, set playersTurn to true so player can move. 165 | playersTurn = true; 166 | 167 | //Enemies are done moving, set enemiesMoving to false. 168 | enemiesMoving = false; 169 | } 170 | } 171 | } 172 | 173 | -------------------------------------------------------------------------------- /Assets/Completed/Scripts/GameManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7d59e4dfb9c9404b9471de0c983feac 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Completed/Scripts/Loader.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | namespace Completed 5 | { 6 | public class Loader : MonoBehaviour 7 | { 8 | public GameObject gameManager; //GameManager prefab to instantiate. 9 | public GameObject soundManager; //SoundManager prefab to instantiate. 10 | 11 | 12 | void Awake () 13 | { 14 | //Check if a GameManager has already been assigned to static variable GameManager.instance or if it's still null 15 | if (GameManager.instance == null) 16 | 17 | //Instantiate gameManager prefab 18 | Instantiate(gameManager); 19 | 20 | //Check if a SoundManager has already been assigned to static variable GameManager.instance or if it's still null 21 | if (SoundManager.instance == null) 22 | 23 | //Instantiate SoundManager prefab 24 | Instantiate(soundManager); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /Assets/Completed/Scripts/Loader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c23d8039e659d46a7b71f4f3c0b02486 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Completed/Scripts/MovingObject.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | namespace Completed 5 | { 6 | //The abstract keyword enables you to create classes and class members that are incomplete and must be implemented in a derived class. 7 | public abstract class MovingObject : MonoBehaviour 8 | { 9 | public float moveTime = 0.1f; //Time it will take object to move, in seconds. 10 | public LayerMask blockingLayer; //Layer on which collision will be checked. 11 | 12 | 13 | private BoxCollider2D boxCollider; //The BoxCollider2D component attached to this object. 14 | private Rigidbody2D rb2D; //The Rigidbody2D component attached to this object. 15 | private float inverseMoveTime; //Used to make movement more efficient. 16 | 17 | 18 | //Protected, virtual functions can be overridden by inheriting classes. 19 | protected virtual void Start () 20 | { 21 | //Get a component reference to this object's BoxCollider2D 22 | boxCollider = GetComponent (); 23 | 24 | //Get a component reference to this object's Rigidbody2D 25 | rb2D = GetComponent (); 26 | 27 | //By storing the reciprocal of the move time we can use it by multiplying instead of dividing, this is more efficient. 28 | inverseMoveTime = 1f / moveTime; 29 | } 30 | 31 | 32 | //Move returns true if it is able to move and false if not. 33 | //Move takes parameters for x direction, y direction and a RaycastHit2D to check collision. 34 | protected bool Move (int xDir, int yDir, out RaycastHit2D hit) 35 | { 36 | //Store start position to move from, based on objects current transform position. 37 | Vector2 start = transform.position; 38 | 39 | // Calculate end position based on the direction parameters passed in when calling Move. 40 | Vector2 end = start + new Vector2 (xDir, yDir); 41 | 42 | //Disable the boxCollider so that linecast doesn't hit this object's own collider. 43 | boxCollider.enabled = false; 44 | 45 | //Cast a line from start point to end point checking collision on blockingLayer. 46 | hit = Physics2D.Linecast (start, end, blockingLayer); 47 | 48 | //Re-enable boxCollider after linecast 49 | boxCollider.enabled = true; 50 | 51 | //Check if anything was hit 52 | if(hit.transform == null) 53 | { 54 | //If nothing was hit, start SmoothMovement co-routine passing in the Vector2 end as destination 55 | StartCoroutine (SmoothMovement (end)); 56 | 57 | //Return true to say that Move was successful 58 | return true; 59 | } 60 | 61 | //If something was hit, return false, Move was unsuccesful. 62 | return false; 63 | } 64 | 65 | 66 | //Co-routine for moving units from one space to next, takes a parameter end to specify where to move to. 67 | protected IEnumerator SmoothMovement (Vector3 end) 68 | { 69 | //Calculate the remaining distance to move based on the square magnitude of the difference between current position and end parameter. 70 | //Square magnitude is used instead of magnitude because it's computationally cheaper. 71 | float sqrRemainingDistance = (transform.position - end).sqrMagnitude; 72 | 73 | //While that distance is greater than a very small amount (Epsilon, almost zero): 74 | while(sqrRemainingDistance > float.Epsilon) 75 | { 76 | //Find a new position proportionally closer to the end, based on the moveTime 77 | Vector3 newPostion = Vector3.MoveTowards(rb2D.position, end, inverseMoveTime * Time.deltaTime); 78 | 79 | //Call MovePosition on attached Rigidbody2D and move it to the calculated position. 80 | rb2D.MovePosition (newPostion); 81 | 82 | //Recalculate the remaining distance after moving. 83 | sqrRemainingDistance = (transform.position - end).sqrMagnitude; 84 | 85 | //Return and loop until sqrRemainingDistance is close enough to zero to end the function 86 | yield return null; 87 | } 88 | } 89 | 90 | 91 | //The virtual keyword means AttemptMove can be overridden by inheriting classes using the override keyword. 92 | //AttemptMove takes a generic parameter T to specify the type of component we expect our unit to interact with if blocked (Player for Enemies, Wall for Player). 93 | protected virtual void AttemptMove (int xDir, int yDir) 94 | where T : Component 95 | { 96 | //Hit will store whatever our linecast hits when Move is called. 97 | RaycastHit2D hit; 98 | 99 | //Set canMove to true if Move was successful, false if failed. 100 | bool canMove = Move (xDir, yDir, out hit); 101 | 102 | //Check if nothing was hit by linecast 103 | if(hit.transform == null) 104 | //If nothing was hit, return and don't execute further code. 105 | return; 106 | 107 | //Get a component reference to the component of type T attached to the object that was hit 108 | T hitComponent = hit.transform.GetComponent (); 109 | 110 | //If canMove is false and hitComponent is not equal to null, meaning MovingObject is blocked and has hit something it can interact with. 111 | if(!canMove && hitComponent != null) 112 | 113 | //Call the OnCantMove function and pass it hitComponent as a parameter. 114 | OnCantMove (hitComponent); 115 | } 116 | 117 | 118 | //The abstract modifier indicates that the thing being modified has a missing or incomplete implementation. 119 | //OnCantMove will be overriden by functions in the inheriting classes. 120 | protected abstract void OnCantMove (T component) 121 | where T : Component; 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /Assets/Completed/Scripts/MovingObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 29a09f5f5da1e4687902e8b80de57300 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Completed/Scripts/Player.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEngine.UI; //Allows us to use UI. 4 | 5 | namespace Completed 6 | { 7 | //Player inherits from MovingObject, our base class for objects that can move, Enemy also inherits from this. 8 | public class Player : MovingObject 9 | { 10 | public float restartLevelDelay = 1f; //Delay time in seconds to restart level. 11 | public int pointsPerFood = 10; //Number of points to add to player food points when picking up a food object. 12 | public int pointsPerSoda = 20; //Number of points to add to player food points when picking up a soda object. 13 | public int wallDamage = 1; //How much damage a player does to a wall when chopping it. 14 | public Text foodText; //UI Text to display current player food total. 15 | public AudioClip moveSound1; //1 of 2 Audio clips to play when player moves. 16 | public AudioClip moveSound2; //2 of 2 Audio clips to play when player moves. 17 | public AudioClip eatSound1; //1 of 2 Audio clips to play when player collects a food object. 18 | public AudioClip eatSound2; //2 of 2 Audio clips to play when player collects a food object. 19 | public AudioClip drinkSound1; //1 of 2 Audio clips to play when player collects a soda object. 20 | public AudioClip drinkSound2; //2 of 2 Audio clips to play when player collects a soda object. 21 | public AudioClip gameOverSound; //Audio clip to play when player dies. 22 | 23 | private Animator animator; //Used to store a reference to the Player's animator component. 24 | private int food; //Used to store player food points total during level. 25 | private Vector2 touchOrigin = -Vector2.one; //Used to store location of screen touch origin for mobile controls. 26 | 27 | 28 | //Start overrides the Start function of MovingObject 29 | protected override void Start () 30 | { 31 | //Get a component reference to the Player's animator component 32 | animator = GetComponent(); 33 | 34 | //Get the current food point total stored in GameManager.instance between levels. 35 | food = GameManager.instance.playerFoodPoints; 36 | 37 | //Set the foodText to reflect the current player food total. 38 | foodText.text = "Food: " + food; 39 | 40 | //Call the Start function of the MovingObject base class. 41 | base.Start (); 42 | } 43 | 44 | 45 | //This function is called when the behaviour becomes disabled or inactive. 46 | private void OnDisable () 47 | { 48 | //When Player object is disabled, store the current local food total in the GameManager so it can be re-loaded in next level. 49 | GameManager.instance.playerFoodPoints = food; 50 | } 51 | 52 | 53 | private void Update () 54 | { 55 | //If it's not the player's turn, exit the function. 56 | if(!GameManager.instance.playersTurn) return; 57 | 58 | int horizontal = 0; //Used to store the horizontal move direction. 59 | int vertical = 0; //Used to store the vertical move direction. 60 | 61 | //Check if we are running either in the Unity editor or in a standalone build. 62 | #if UNITY_STANDALONE || UNITY_WEBPLAYER 63 | 64 | //Get input from the input manager, round it to an integer and store in horizontal to set x axis move direction 65 | horizontal = (int) (Input.GetAxisRaw ("Horizontal")); 66 | 67 | //Get input from the input manager, round it to an integer and store in vertical to set y axis move direction 68 | vertical = (int) (Input.GetAxisRaw ("Vertical")); 69 | 70 | //Check if moving horizontally, if so set vertical to zero. 71 | if(horizontal != 0) 72 | { 73 | vertical = 0; 74 | } 75 | //Check if we are running on iOS, Android, Windows Phone 8 or Unity iPhone 76 | #elif UNITY_IOS || UNITY_ANDROID || UNITY_WP8 || UNITY_IPHONE 77 | 78 | //Check if Input has registered more than zero touches 79 | if (Input.touchCount > 0) 80 | { 81 | //Store the first touch detected. 82 | Touch myTouch = Input.touches[0]; 83 | 84 | //Check if the phase of that touch equals Began 85 | if (myTouch.phase == TouchPhase.Began) 86 | { 87 | //If so, set touchOrigin to the position of that touch 88 | touchOrigin = myTouch.position; 89 | } 90 | 91 | //If the touch phase is not Began, and instead is equal to Ended and the x of touchOrigin is greater or equal to zero: 92 | else if (myTouch.phase == TouchPhase.Ended && touchOrigin.x >= 0) 93 | { 94 | //Set touchEnd to equal the position of this touch 95 | Vector2 touchEnd = myTouch.position; 96 | 97 | //Calculate the difference between the beginning and end of the touch on the x axis. 98 | float x = touchEnd.x - touchOrigin.x; 99 | 100 | //Calculate the difference between the beginning and end of the touch on the y axis. 101 | float y = touchEnd.y - touchOrigin.y; 102 | 103 | //Set touchOrigin.x to -1 so that our else if statement will evaluate false and not repeat immediately. 104 | touchOrigin.x = -1; 105 | 106 | //Check if the difference along the x axis is greater than the difference along the y axis. 107 | if (Mathf.Abs(x) > Mathf.Abs(y)) 108 | //If x is greater than zero, set horizontal to 1, otherwise set it to -1 109 | horizontal = x > 0 ? 1 : -1; 110 | else 111 | //If y is greater than zero, set horizontal to 1, otherwise set it to -1 112 | vertical = y > 0 ? 1 : -1; 113 | } 114 | } 115 | 116 | #endif //End of mobile platform dependendent compilation section started above with #elif 117 | //Check if we have a non-zero value for horizontal or vertical 118 | if(horizontal != 0 || vertical != 0) 119 | { 120 | //Call AttemptMove passing in the generic parameter Wall, since that is what Player may interact with if they encounter one (by attacking it) 121 | //Pass in horizontal and vertical as parameters to specify the direction to move Player in. 122 | AttemptMove (horizontal, vertical); 123 | } 124 | } 125 | 126 | //AttemptMove overrides the AttemptMove function in the base class MovingObject 127 | //AttemptMove takes a generic parameter T which for Player will be of the type Wall, it also takes integers for x and y direction to move in. 128 | protected override void AttemptMove (int xDir, int yDir) 129 | { 130 | //Every time player moves, subtract from food points total. 131 | food--; 132 | 133 | //Update food text display to reflect current score. 134 | foodText.text = "Food: " + food; 135 | 136 | //Call the AttemptMove method of the base class, passing in the component T (in this case Wall) and x and y direction to move. 137 | base.AttemptMove (xDir, yDir); 138 | 139 | //Hit allows us to reference the result of the Linecast done in Move. 140 | RaycastHit2D hit; 141 | 142 | //If Move returns true, meaning Player was able to move into an empty space. 143 | if (Move (xDir, yDir, out hit)) 144 | { 145 | //Call RandomizeSfx of SoundManager to play the move sound, passing in two audio clips to choose from. 146 | SoundManager.instance.RandomizeSfx (moveSound1, moveSound2); 147 | } 148 | 149 | //Since the player has moved and lost food points, check if the game has ended. 150 | CheckIfGameOver (); 151 | 152 | //Set the playersTurn boolean of GameManager to false now that players turn is over. 153 | GameManager.instance.playersTurn = false; 154 | } 155 | 156 | 157 | //OnCantMove overrides the abstract function OnCantMove in MovingObject. 158 | //It takes a generic parameter T which in the case of Player is a Wall which the player can attack and destroy. 159 | protected override void OnCantMove (T component) 160 | { 161 | //Set hitWall to equal the component passed in as a parameter. 162 | Wall hitWall = component as Wall; 163 | 164 | //Call the DamageWall function of the Wall we are hitting. 165 | hitWall.DamageWall (wallDamage); 166 | 167 | //Set the attack trigger of the player's animation controller in order to play the player's attack animation. 168 | animator.SetTrigger ("playerChop"); 169 | } 170 | 171 | 172 | //OnTriggerEnter2D is sent when another object enters a trigger collider attached to this object (2D physics only). 173 | private void OnTriggerEnter2D (Collider2D other) 174 | { 175 | //Check if the tag of the trigger collided with is Exit. 176 | if(other.tag == "Exit") 177 | { 178 | //Invoke the Restart function to start the next level with a delay of restartLevelDelay (default 1 second). 179 | Invoke ("Restart", restartLevelDelay); 180 | 181 | //Disable the player object since level is over. 182 | enabled = false; 183 | } 184 | 185 | //Check if the tag of the trigger collided with is Food. 186 | else if(other.tag == "Food") 187 | { 188 | //Add pointsPerFood to the players current food total. 189 | food += pointsPerFood; 190 | 191 | //Update foodText to represent current total and notify player that they gained points 192 | foodText.text = "+" + pointsPerFood + " Food: " + food; 193 | 194 | //Call the RandomizeSfx function of SoundManager and pass in two eating sounds to choose between to play the eating sound effect. 195 | SoundManager.instance.RandomizeSfx (eatSound1, eatSound2); 196 | 197 | //Disable the food object the player collided with. 198 | other.gameObject.SetActive (false); 199 | } 200 | 201 | //Check if the tag of the trigger collided with is Soda. 202 | else if(other.tag == "Soda") 203 | { 204 | //Add pointsPerSoda to players food points total 205 | food += pointsPerSoda; 206 | 207 | //Update foodText to represent current total and notify player that they gained points 208 | foodText.text = "+" + pointsPerSoda + " Food: " + food; 209 | 210 | //Call the RandomizeSfx function of SoundManager and pass in two drinking sounds to choose between to play the drinking sound effect. 211 | SoundManager.instance.RandomizeSfx (drinkSound1, drinkSound2); 212 | 213 | //Disable the soda object the player collided with. 214 | other.gameObject.SetActive (false); 215 | } 216 | } 217 | 218 | 219 | //Restart reloads the scene when called. 220 | private void Restart () 221 | { 222 | //Load the last scene loaded, in this case Main, the only scene in the game. 223 | Application.LoadLevel (Application.loadedLevel); 224 | } 225 | 226 | 227 | //LoseFood is called when an enemy attacks the player. 228 | //It takes a parameter loss which specifies how many points to lose. 229 | public void LoseFood (int loss) 230 | { 231 | //Set the trigger for the player animator to transition to the playerHit animation. 232 | animator.SetTrigger ("playerHit"); 233 | 234 | //Subtract lost food points from the players total. 235 | food -= loss; 236 | 237 | //Update the food display with the new total. 238 | foodText.text = "-"+ loss + " Food: " + food; 239 | 240 | //Check to see if game has ended. 241 | CheckIfGameOver (); 242 | } 243 | 244 | 245 | //CheckIfGameOver checks if the player is out of food points and if so, ends the game. 246 | private void CheckIfGameOver () 247 | { 248 | //Check if food point total is less than or equal to zero. 249 | if (food <= 0) 250 | { 251 | //Call the PlaySingle function of SoundManager and pass it the gameOverSound as the audio clip to play. 252 | SoundManager.instance.PlaySingle (gameOverSound); 253 | 254 | //Stop the background music. 255 | SoundManager.instance.musicSource.Stop(); 256 | 257 | //Call the GameOver function of GameManager. 258 | GameManager.instance.GameOver (); 259 | } 260 | } 261 | } 262 | } 263 | 264 | -------------------------------------------------------------------------------- /Assets/Completed/Scripts/Player.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 16e3f930239ae4562865b7c0918b8677 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Completed/Scripts/SoundManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | namespace Completed 5 | { 6 | public class SoundManager : MonoBehaviour 7 | { 8 | public AudioSource efxSource; //Drag a reference to the audio source which will play the sound effects. 9 | public AudioSource musicSource; //Drag a reference to the audio source which will play the music. 10 | public static SoundManager instance = null; //Allows other scripts to call functions from SoundManager. 11 | public float lowPitchRange = .95f; //The lowest a sound effect will be randomly pitched. 12 | public float highPitchRange = 1.05f; //The highest a sound effect will be randomly pitched. 13 | 14 | 15 | void Awake () 16 | { 17 | //Check if there is already an instance of SoundManager 18 | if (instance == null) 19 | //if not, set it to this. 20 | instance = this; 21 | //If instance already exists: 22 | else if (instance != this) 23 | //Destroy this, this enforces our singleton pattern so there can only be one instance of SoundManager. 24 | Destroy (gameObject); 25 | 26 | //Set SoundManager to DontDestroyOnLoad so that it won't be destroyed when reloading our scene. 27 | DontDestroyOnLoad (gameObject); 28 | } 29 | 30 | 31 | //Used to play single sound clips. 32 | public void PlaySingle(AudioClip clip) 33 | { 34 | //Set the clip of our efxSource audio source to the clip passed in as a parameter. 35 | efxSource.clip = clip; 36 | 37 | //Play the clip. 38 | efxSource.Play (); 39 | } 40 | 41 | 42 | //RandomizeSfx chooses randomly between various audio clips and slightly changes their pitch. 43 | public void RandomizeSfx (params AudioClip[] clips) 44 | { 45 | //Generate a random number between 0 and the length of our array of clips passed in. 46 | int randomIndex = Random.Range(0, clips.Length); 47 | 48 | //Choose a random pitch to play back our clip at between our high and low pitch ranges. 49 | float randomPitch = Random.Range(lowPitchRange, highPitchRange); 50 | 51 | //Set the pitch of the audio source to the randomly chosen pitch. 52 | efxSource.pitch = randomPitch; 53 | 54 | //Set the clip to the clip at our randomly chosen index. 55 | efxSource.clip = clips[randomIndex]; 56 | 57 | //Play the clip. 58 | efxSource.Play(); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Assets/Completed/Scripts/SoundManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e9664006bbf82436782d24280d78f122 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Completed/Scripts/Wall.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | namespace Completed 5 | { 6 | public class Wall : MonoBehaviour 7 | { 8 | public AudioClip chopSound1; //1 of 2 audio clips that play when the wall is attacked by the player. 9 | public AudioClip chopSound2; //2 of 2 audio clips that play when the wall is attacked by the player. 10 | public Sprite dmgSprite; //Alternate sprite to display after Wall has been attacked by player. 11 | public int hp = 3; //hit points for the wall. 12 | 13 | 14 | private SpriteRenderer spriteRenderer; //Store a component reference to the attached SpriteRenderer. 15 | 16 | 17 | void Awake () 18 | { 19 | //Get a component reference to the SpriteRenderer. 20 | spriteRenderer = GetComponent (); 21 | } 22 | 23 | 24 | //DamageWall is called when the player attacks a wall. 25 | public void DamageWall (int loss) 26 | { 27 | //Call the RandomizeSfx function of SoundManager to play one of two chop sounds. 28 | SoundManager.instance.RandomizeSfx (chopSound1, chopSound2); 29 | 30 | //Set spriteRenderer to the damaged wall sprite. 31 | spriteRenderer.sprite = dmgSprite; 32 | 33 | //Subtract loss from hit point total. 34 | hp -= loss; 35 | 36 | //If hit points are less than or equal to zero: 37 | if(hp <= 0) 38 | //Disable the gameObject. 39 | gameObject.SetActive (false); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Assets/Completed/Scripts/Wall.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b55ebdc127da43ee9afaef098e22f35 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Fonts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df1b9d01e0cb044deb4dcafafef40003 3 | folderAsset: yes 4 | timeCreated: 1424842167 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Fonts/OFL.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012, Cody "CodeMan38" Boisclair (cody@zone38.net), with Reserved Font Name "Press Start 2P" 2 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 3 | This license is copied below, and is also available with a FAQ at: 4 | http://scripts.sil.org/OFL 5 | 6 | 7 | ----------------------------------------------------------- 8 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 9 | ----------------------------------------------------------- 10 | 11 | PREAMBLE 12 | The goals of the Open Font License (OFL) are to stimulate worldwide 13 | development of collaborative font projects, to support the font creation 14 | efforts of academic and linguistic communities, and to provide a free and 15 | open framework in which fonts may be shared and improved in partnership 16 | with others. 17 | 18 | The OFL allows the licensed fonts to be used, studied, modified and 19 | redistributed freely as long as they are not sold by themselves. The 20 | fonts, including any derivative works, can be bundled, embedded, 21 | redistributed and/or sold with any software provided that any reserved 22 | names are not used by derivative works. The fonts and derivatives, 23 | however, cannot be released under any other type of license. The 24 | requirement for fonts to remain under this license does not apply 25 | to any document created using the fonts or their derivatives. 26 | 27 | DEFINITIONS 28 | "Font Software" refers to the set of files released by the Copyright 29 | Holder(s) under this license and clearly marked as such. This may 30 | include source files, build scripts and documentation. 31 | 32 | "Reserved Font Name" refers to any names specified as such after the 33 | copyright statement(s). 34 | 35 | "Original Version" refers to the collection of Font Software components as 36 | distributed by the Copyright Holder(s). 37 | 38 | "Modified Version" refers to any derivative made by adding to, deleting, 39 | or substituting -- in part or in whole -- any of the components of the 40 | Original Version, by changing formats or by porting the Font Software to a 41 | new environment. 42 | 43 | "Author" refers to any designer, engineer, programmer, technical 44 | writer or other person who contributed to the Font Software. 45 | 46 | PERMISSION & CONDITIONS 47 | Permission is hereby granted, free of charge, to any person obtaining 48 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 49 | redistribute, and sell modified and unmodified copies of the Font 50 | Software, subject to the following conditions: 51 | 52 | 1) Neither the Font Software nor any of its individual components, 53 | in Original or Modified Versions, may be sold by itself. 54 | 55 | 2) Original or Modified Versions of the Font Software may be bundled, 56 | redistributed and/or sold with any software, provided that each copy 57 | contains the above copyright notice and this license. These can be 58 | included either as stand-alone text files, human-readable headers or 59 | in the appropriate machine-readable metadata fields within text or 60 | binary files as long as those fields can be easily viewed by the user. 61 | 62 | 3) No Modified Version of the Font Software may use the Reserved Font 63 | Name(s) unless explicit written permission is granted by the corresponding 64 | Copyright Holder. This restriction only applies to the primary font name as 65 | presented to the users. 66 | 67 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 68 | Software shall not be used to promote, endorse or advertise any 69 | Modified Version, except to acknowledge the contribution(s) of the 70 | Copyright Holder(s) and the Author(s) or with their explicit written 71 | permission. 72 | 73 | 5) The Font Software, modified or unmodified, in part or in whole, 74 | must be distributed entirely under this license, and must not be 75 | distributed under any other license. The requirement for fonts to 76 | remain under this license does not apply to any document created 77 | using the Font Software. 78 | 79 | TERMINATION 80 | This license becomes null and void if any of the above conditions are 81 | not met. 82 | 83 | DISCLAIMER 84 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 85 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 86 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 87 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 88 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 89 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 90 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 91 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 92 | OTHER DEALINGS IN THE FONT SOFTWARE. 93 | -------------------------------------------------------------------------------- /Assets/Fonts/OFL.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5014456921e71459d869c8378fed6ca3 3 | TextScriptImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Fonts/PressStart2P-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Fonts/PressStart2P-Regular.ttf -------------------------------------------------------------------------------- /Assets/Fonts/PressStart2P-Regular.ttf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b284a6525342f44599e9ce79e37c2d61 3 | TrueTypeFontImporter: 4 | serializedVersion: 2 5 | fontSize: 16 6 | forceTextureCase: -2 7 | characterSpacing: 1 8 | characterPadding: 0 9 | includeFontData: 1 10 | use2xBehaviour: 0 11 | fontNames: [] 12 | customCharacters: 13 | fontRenderingMode: 0 14 | userData: 15 | assetBundleName: 16 | assetBundleVariant: 17 | -------------------------------------------------------------------------------- /Assets/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f9a59214fb8b487494b2eb4dc2c4613 3 | folderAsset: yes 4 | timeCreated: 1424842167 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prefabs/Enemy1.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Enemy1.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Enemy1.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5ff5e3688fe14691b558302d3e84874 3 | timeCreated: 1425063402 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Enemy2.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Enemy2.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Enemy2.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 658a8e2613fcb4d7d90f76d388f15944 3 | timeCreated: 1425063765 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Exit.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Exit.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Exit.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b5dcb6ac56cc42b4a9affd5c6d1a19c 3 | timeCreated: 1425064298 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Floor1.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Floor1.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Floor1.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 87d432f7596f549a7aa45ae416cdaff9 3 | timeCreated: 1425063992 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Floor2.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Floor2.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Floor2.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fbc6fb22329f046e0995493ad0dddce9 3 | timeCreated: 1425064034 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Floor3.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Floor3.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Floor3.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01e35c1b4fb82442d86b4912b678aa77 3 | timeCreated: 1425064054 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Floor4.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Floor4.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Floor4.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4cb79d9b509454a95bbe26e288024ade 3 | timeCreated: 1425064074 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Floor5.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Floor5.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Floor5.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4641d3549a2874661895378f698844e4 3 | timeCreated: 1425064088 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Floor6.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Floor6.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Floor6.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e64932d9466b4ca7ad18b5870fd9aa2 3 | timeCreated: 1425064112 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Floor7.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Floor7.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Floor7.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a67906c794a1144af827769955834620 3 | timeCreated: 1425064127 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Floor8.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Floor8.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Floor8.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec9659f43848d44d682c7b5fc01b1e0c 3 | timeCreated: 1425064140 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Food.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Food.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Food.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 96bc1e589b8ae4ae6803e13cf484704c 3 | timeCreated: 1425064385 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/GameManager.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/GameManager.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/GameManager.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 38e44d8bf10d343dd82fabb9862946a9 3 | timeCreated: 1425068183 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/OuterWall1.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/OuterWall1.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/OuterWall1.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a5f90ec538e7e4819a957bfcd89d389b 3 | timeCreated: 1425064552 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/OuterWall2.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/OuterWall2.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/OuterWall2.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 507286c659feb4144be4fdd47a8292d4 3 | timeCreated: 1425064805 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/OuterWall3.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/OuterWall3.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/OuterWall3.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ca40f5b629464c61a0c50e317d61e0c 3 | timeCreated: 1425064903 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Player.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Player.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Player.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b65b72cd1b9b4a0ea21f4f4d9faa0c1 3 | timeCreated: 1425061138 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Soda.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Soda.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Soda.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70adb60059b4e41eaa8acc305d2c0412 3 | timeCreated: 1425064452 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Wall1.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Wall1.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Wall1.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6dc46b418bf2f405f8f91acb0fa87956 3 | timeCreated: 1425064963 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Wall2.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Wall2.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Wall2.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c303d7af989694bef8fa9c235bcae836 3 | timeCreated: 1425064977 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Wall3.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Wall3.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Wall3.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f8bd45bc811934fb2801bf2e7986fd47 3 | timeCreated: 1425064993 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Wall4.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Wall4.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Wall4.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02d483c9e54af4086a4432f6bc22df0d 3 | timeCreated: 1425065006 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Wall5.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Wall5.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Wall5.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4d59260ce466e47b49b78f3465891c20 3 | timeCreated: 1425065058 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Wall6.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Wall6.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Wall6.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d35a5e83d92244551a934352353a4796 3 | timeCreated: 1425065074 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Wall7.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Wall7.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Wall7.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d8c23b74915aa4a0084b80264c80f6d8 3 | timeCreated: 1425065088 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/Wall8.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Prefabs/Wall8.prefab -------------------------------------------------------------------------------- /Assets/Prefabs/Wall8.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c039def0e3f6408a9045b6a15a2f673 3 | timeCreated: 1425065104 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1932cd33b9ccb423e934c141086207f4 3 | folderAsset: yes 4 | timeCreated: 1424842167 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes/Main.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Scenes/Main.unity -------------------------------------------------------------------------------- /Assets/Scenes/Main.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f75f5aede1fe04c2aa6306131d8d321f 3 | timeCreated: 1425063801 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1f2bc930294c48dcab046ca93b70da0 3 | folderAsset: yes 4 | timeCreated: 1424842167 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/BoardManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using Random = UnityEngine.Random; 6 | 7 | public class BoardManager : MonoBehaviour 8 | { 9 | [Serializable] 10 | public class Count 11 | { 12 | public int minimum; 13 | public int maximum; 14 | 15 | public Count (int min, int max) 16 | { 17 | minimum = min; 18 | maximum = max; 19 | } 20 | } 21 | 22 | public int columns = 8; 23 | public int rows = 8; 24 | public Count wallCount = new Count (5,9); 25 | public Count foodCount = new Count (1,5); 26 | public GameObject exit; 27 | public GameObject[] floorTiles; 28 | public GameObject[] wallTiles; 29 | public GameObject[] foodTiles; 30 | public GameObject[] enemyTiles; 31 | public GameObject[] outerWallTiles; 32 | 33 | private Transform boardHolder; 34 | private List gridPositions = new List (); 35 | 36 | void InitialiseList() 37 | { 38 | gridPositions.Clear (); 39 | 40 | for (int x = 1; x < columns - 1; x++) { 41 | for (int y = 1; y < rows - 1; y++) { 42 | gridPositions.Add (new Vector3 (x, y, 0f)); 43 | } 44 | } 45 | } 46 | 47 | void BoardSetup () 48 | { 49 | boardHolder = new GameObject ("Board").transform; 50 | 51 | for (int x = -1; x < columns + 1; x++) { 52 | for (int y = -1; y < rows + 1; y++) { 53 | GameObject toInstantiate = floorTiles [Random.Range (0, floorTiles.Length)]; 54 | if (x == -1 || x == columns || y == -1 || y == rows) 55 | toInstantiate = outerWallTiles [Random.Range (0, outerWallTiles.Length)]; 56 | 57 | GameObject instance = Instantiate (toInstantiate, new Vector3 (x, y, 0f), Quaternion.identity) as GameObject; 58 | 59 | instance.transform.SetParent (boardHolder); 60 | } 61 | } 62 | } 63 | 64 | Vector3 RandomPosition() 65 | { 66 | int randomIndex = Random.Range (0, gridPositions.Count); 67 | Vector3 randomPosition = gridPositions [randomIndex]; 68 | gridPositions.RemoveAt (randomIndex); 69 | return randomPosition; 70 | } 71 | 72 | void LayoutObjectAtRandom(GameObject[] tileArray, int minimum, int maximum) 73 | { 74 | int objectCount = Random.Range (minimum, maximum + 1); 75 | 76 | for (int i = 0; i < objectCount; i++) { 77 | Vector3 randomPosition = RandomPosition (); 78 | GameObject tileChoice = tileArray [Random.Range (0, tileArray.Length)]; 79 | Instantiate (tileChoice, randomPosition, Quaternion.identity); 80 | } 81 | } 82 | 83 | public void SetupScene(int level) 84 | { 85 | BoardSetup (); 86 | InitialiseList (); 87 | LayoutObjectAtRandom (wallTiles, wallCount.minimum, wallCount.maximum); 88 | LayoutObjectAtRandom (foodTiles, foodCount.minimum, foodCount.maximum); 89 | int enemyCount = (int)Mathf.Log (level, 2f); 90 | LayoutObjectAtRandom (enemyTiles, enemyCount, enemyCount); 91 | Instantiate (exit, new Vector3 (columns - 1, rows - 1, 0F), Quaternion.identity); 92 | } 93 | 94 | 95 | // Use this for initialization 96 | void Start () { 97 | 98 | } 99 | 100 | // Update is called once per frame 101 | void Update () { 102 | 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /Assets/Scripts/BoardManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1edd0cd095384e1280682fb2c8c0eb1 3 | timeCreated: 1425065203 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Enemy.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Enemy : MovingObject { 5 | 6 | public int playerDamage; 7 | 8 | private Animator animator; 9 | private Transform target; 10 | private bool skipMove; 11 | public AudioClip enemyAttack1; 12 | public AudioClip enemyAttack2; 13 | 14 | protected override void Start () { 15 | GameManager.instance.AddEnemyToList (this); 16 | animator = GetComponent (); 17 | target = GameObject.FindGameObjectWithTag ("Player").transform; 18 | base.Start (); 19 | } 20 | 21 | protected override void AttemptMove (int xDir, int yDir) 22 | { 23 | if (skipMove) { 24 | skipMove = false; 25 | return; 26 | } 27 | 28 | base.AttemptMove (xDir, yDir); 29 | 30 | skipMove = true; 31 | } 32 | 33 | public void MoveEnemy() 34 | { 35 | int xDir = 0; 36 | int yDir = 0; 37 | 38 | if (Mathf.Abs (target.position.x - transform.position.x) < float.Epsilon) 39 | yDir = target.position.y > transform.position.y ? 1 : -1; 40 | else 41 | xDir = target.position.x > transform.position.x ? 1 : -1; 42 | 43 | AttemptMove (xDir, yDir); 44 | } 45 | 46 | protected override void OnCantMove (T component) 47 | { 48 | Player hitPlayer = component as Player; 49 | 50 | hitPlayer.LoseFood (playerDamage); 51 | 52 | animator.SetTrigger ("enemyAttack"); 53 | 54 | SoundManager.instance.RandomizeSfx (enemyAttack1, enemyAttack2); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Assets/Scripts/Enemy.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e7000d9b2e764938a4ef12e3000d4c1 3 | timeCreated: 1425073638 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/GameManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine.UI; 5 | 6 | public class GameManager : MonoBehaviour { 7 | 8 | public float levelStartDelay = 2f; 9 | public float turnDelay = .1f; 10 | public static GameManager instance = null; 11 | public BoardManager boardScript; 12 | public int playerFoodPoints = 100; 13 | [HideInInspector] public bool playersTurn = true; 14 | 15 | private Text levelText; 16 | private GameObject levelImage; 17 | private int level = 1; 18 | private List enemies; 19 | private bool enemiesMoving; 20 | private bool doingSetup; 21 | 22 | // Use this for initialization 23 | void Awake () { 24 | if (instance == null) 25 | instance = this; 26 | else if (instance != this) 27 | Destroy (gameObject); 28 | 29 | DontDestroyOnLoad (gameObject); 30 | enemies = new List (); 31 | boardScript = GetComponent (); 32 | InitGame (); 33 | } 34 | 35 | void OnLevelWasLoaded (int index) 36 | { 37 | level++; 38 | 39 | InitGame (); 40 | } 41 | 42 | void InitGame() 43 | { 44 | doingSetup = true; 45 | 46 | levelImage = GameObject.Find ("LevelImage"); 47 | levelText = GameObject.Find ("LevelText").GetComponent (); 48 | levelText.text = "Day " + level; 49 | levelImage.SetActive (true); 50 | Invoke ("HideLevelImage", levelStartDelay); 51 | 52 | enemies.Clear (); 53 | boardScript.SetupScene (level); 54 | } 55 | 56 | private void HideLevelImage() 57 | { 58 | levelImage.SetActive (false); 59 | doingSetup = false; 60 | } 61 | 62 | public void GameOver() 63 | { 64 | levelText.text = "After " + level + " days, you starved."; 65 | levelImage.SetActive (true); 66 | enabled = false; 67 | } 68 | 69 | // Update is called once per frame 70 | void Update () { 71 | if (playersTurn || enemiesMoving || doingSetup) 72 | return; 73 | 74 | StartCoroutine (MoveEnemies ()); 75 | } 76 | 77 | public void AddEnemyToList(Enemy script) 78 | { 79 | enemies.Add (script); 80 | } 81 | 82 | IEnumerator MoveEnemies() 83 | { 84 | enemiesMoving = true; 85 | yield return new WaitForSeconds (turnDelay); 86 | if (enemies.Count == 0) { 87 | yield return new WaitForSeconds (turnDelay); 88 | } 89 | 90 | for (int i = 0; i < enemies.Count; i++) { 91 | enemies [i].MoveEnemy (); 92 | yield return new WaitForSeconds (enemies [i].moveTime); 93 | } 94 | 95 | playersTurn = true; 96 | enemiesMoving = false; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Assets/Scripts/GameManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d65ba5744bb7c4662954a1d4f259d53b 3 | timeCreated: 1425065215 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Loader.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Loader : MonoBehaviour { 5 | 6 | public GameObject gameManager; 7 | 8 | // Use this for initialization 9 | void Awake () { 10 | if (GameManager.instance == null) 11 | Instantiate (gameManager); 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Assets/Scripts/Loader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5da809839f8564a7e8c0bf6dc860925c 3 | timeCreated: 1425068194 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/MovingObject.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public abstract class MovingObject : MonoBehaviour 5 | { 6 | public float moveTime = 0.1f; 7 | public LayerMask blockingLayer; 8 | 9 | private BoxCollider2D boxCollider; 10 | private Rigidbody2D rb2D; 11 | private float inverseMoveTime; 12 | 13 | // Use this for initialization 14 | protected virtual void Start () { 15 | boxCollider = GetComponent (); 16 | rb2D = GetComponent (); 17 | inverseMoveTime = 1f / moveTime; 18 | } 19 | 20 | protected bool Move (int xDir, int yDir, out RaycastHit2D hit) 21 | { 22 | Vector2 start = transform.position; 23 | Vector2 end = start + new Vector2 (xDir, yDir); 24 | 25 | boxCollider.enabled = false; 26 | hit = Physics2D.Linecast (start, end, blockingLayer); 27 | boxCollider.enabled = true; 28 | 29 | if (hit.transform == null) { 30 | StartCoroutine (SmoothMovement (end)); 31 | return true; 32 | } 33 | 34 | return false; 35 | } 36 | 37 | protected IEnumerator SmoothMovement (Vector3 end) 38 | { 39 | float sqrRemainingDistance = (transform.position - end).sqrMagnitude; 40 | 41 | while (sqrRemainingDistance > float.Epsilon) { 42 | Vector3 newPosition = Vector3.MoveTowards (rb2D.position, end, inverseMoveTime * Time.deltaTime); 43 | rb2D.MovePosition(newPosition); 44 | sqrRemainingDistance = (transform.position - end).sqrMagnitude; 45 | yield return null; 46 | } 47 | } 48 | 49 | protected virtual void AttemptMove (int xDir, int yDir) 50 | where T : Component 51 | { 52 | RaycastHit2D hit; 53 | bool canMove = Move (xDir, yDir, out hit); 54 | 55 | if (hit.transform == null) 56 | return; 57 | 58 | T hitComponent = hit.transform.GetComponent (); 59 | 60 | if (!canMove && hitComponent != null) 61 | OnCantMove (hitComponent); 62 | } 63 | 64 | protected abstract void OnCantMove (T component) 65 | where T : Component; 66 | } 67 | -------------------------------------------------------------------------------- /Assets/Scripts/MovingObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69cad2503d44949f482151bbb326b68d 3 | timeCreated: 1425068485 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Player.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEngine.UI; 4 | 5 | public class Player : MovingObject { 6 | 7 | public int wallDamage = 1; 8 | public int pointsPerFood = 10; 9 | public int pointsPerSoda = 20; 10 | public float restartLevelDelay = 1f; 11 | public Text foodText; 12 | public AudioClip moveSound1; 13 | public AudioClip moveSound2; 14 | public AudioClip eatSound1; 15 | public AudioClip eatSound2; 16 | public AudioClip drinkSound1; 17 | public AudioClip drinkSound2; 18 | public AudioClip gameOverSound; 19 | 20 | private Animator animator; 21 | private int food; 22 | private Vector2 touchOrigin = -Vector2.one; 23 | 24 | // Use this for initialization 25 | protected override void Start () { 26 | animator = GetComponent (); 27 | 28 | food = GameManager.instance.playerFoodPoints; 29 | 30 | foodText.text = "Food: " + food; 31 | 32 | base.Start (); 33 | } 34 | 35 | private void OnDisable() 36 | { 37 | GameManager.instance.playerFoodPoints = food; 38 | } 39 | 40 | // Update is called once per frame 41 | void Update () { 42 | if (!GameManager.instance.playersTurn) 43 | return; 44 | 45 | int horizontal = 0; 46 | int vertical = 0; 47 | 48 | #if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBPLAYER 49 | 50 | horizontal = (int)Input.GetAxisRaw ("Horizontal"); 51 | vertical = (int)Input.GetAxisRaw ("Vertical"); 52 | 53 | if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1)) { 54 | var posVec = Camera.main.ScreenToWorldPoint(Input.mousePosition); 55 | var x = Mathf.RoundToInt(posVec.x) - transform.position.x; 56 | var y = Mathf.RoundToInt(posVec.y) - transform.position.y; 57 | if (Mathf.Abs(x) > Mathf.Abs(y)) { 58 | horizontal = x > 0 ? 1 : -1; 59 | } else { 60 | vertical = y > 0 ? 1 : -1; 61 | } 62 | } 63 | 64 | if (horizontal != 0) 65 | vertical = 0; 66 | 67 | #else 68 | if (Input.touchCount > 0) 69 | { 70 | Touch myTouch = Input.touches[0]; 71 | 72 | if (myTouch.phase == TouchPhase.Began) 73 | { 74 | touchOrigin = myTouch.position; 75 | } else if (myTouch.phase == TouchPhase.Ended && touchOrigin.x >= 0) 76 | { 77 | Vector2 touchEnd = myTouch.position; 78 | float x = touchEnd.x - touchOrigin.x; 79 | float y = touchEnd.y - touchOrigin.y; 80 | touchOrigin.x = -1; 81 | if (Mathf.Abs(x) > Mathf.Abs(y)) 82 | horizontal = x > 0 ? 1 : -1; 83 | else 84 | vertical = y > 0 ? 1 : -1; 85 | } 86 | } 87 | 88 | #endif 89 | 90 | if (horizontal != 0 || vertical != 0) 91 | AttemptMove (horizontal, vertical); 92 | } 93 | 94 | protected override void AttemptMove (int xDir, int yDir) 95 | { 96 | food--; 97 | foodText.text = "Food: " + food; 98 | 99 | base.AttemptMove (xDir, yDir); 100 | 101 | RaycastHit2D hit; 102 | if (Move (xDir, yDir, out hit)) { 103 | SoundManager.instance.RandomizeSfx (moveSound1, moveSound2); 104 | } 105 | 106 | CheckIfGameOver (); 107 | 108 | GameManager.instance.playersTurn = false; 109 | } 110 | 111 | private void OnTriggerEnter2D (Collider2D other) 112 | { 113 | if (other.tag == "Exit") { 114 | Invoke ("Restart", restartLevelDelay); 115 | enabled = false; 116 | } else if (other.tag == "Food") { 117 | food += pointsPerFood; 118 | foodText.text = "+" + pointsPerFood + " Food: " + food; 119 | SoundManager.instance.RandomizeSfx(eatSound1, eatSound2); 120 | other.gameObject.SetActive (false); 121 | } else if (other.tag == "Soda") { 122 | food += pointsPerSoda; 123 | foodText.text = "+" + pointsPerSoda + " Food: " + food; 124 | SoundManager.instance.RandomizeSfx(drinkSound1, drinkSound2); 125 | other.gameObject.SetActive (false); 126 | } 127 | } 128 | 129 | protected override void OnCantMove (T component) 130 | { 131 | Wall hitWall = component as Wall; 132 | hitWall.DamageWall (wallDamage); 133 | animator.SetTrigger ("playerChop"); 134 | } 135 | 136 | private void Restart() 137 | { 138 | Application.LoadLevel (Application.loadedLevel); 139 | } 140 | 141 | public void LoseFood (int loss) 142 | { 143 | animator.SetTrigger ("playerHit"); 144 | food -= loss; 145 | foodText.text = "-" + loss + " Food: " + food; 146 | CheckIfGameOver (); 147 | } 148 | 149 | private void CheckIfGameOver() 150 | { 151 | if (food <= 0) { 152 | SoundManager.instance.PlaySingle(gameOverSound); 153 | SoundManager.instance.musicSource.Stop(); 154 | GameManager.instance.GameOver (); 155 | } 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /Assets/Scripts/Player.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3371ad31f38ce45178e8bf7516b97e14 3 | timeCreated: 1425072277 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/SoundManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class SoundManager : MonoBehaviour { 5 | 6 | public AudioSource efxSource; 7 | public AudioSource musicSource; 8 | public static SoundManager instance = null; 9 | 10 | public float lowPitchRange = .95f; 11 | public float highPitchRange = 1.05f; 12 | 13 | // Use this for initialization 14 | void Awake () { 15 | if (instance == null) 16 | instance = this; 17 | else if (instance != this) 18 | Destroy (gameObject); 19 | 20 | DontDestroyOnLoad (gameObject); 21 | } 22 | 23 | public void PlaySingle(AudioClip clip) 24 | { 25 | efxSource.clip = clip; 26 | efxSource.Play (); 27 | } 28 | 29 | public void RandomizeSfx (params AudioClip [] clips) 30 | { 31 | int randomIndex = Random.Range (0, clips.Length); 32 | float randomPitch = Random.Range (lowPitchRange, highPitchRange); 33 | 34 | efxSource.pitch = randomPitch; 35 | efxSource.clip = clips [randomIndex]; 36 | efxSource.Play (); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Assets/Scripts/SoundManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: abc9a09edbf03451c8bd7f72394ad60f 3 | timeCreated: 1425076264 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Wall.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Wall : MonoBehaviour { 5 | 6 | public Sprite dmgSprite; 7 | public int hp = 4; 8 | public AudioClip chopSound1; 9 | public AudioClip chopSound2; 10 | 11 | private SpriteRenderer spriteRenderer; 12 | 13 | // Use this for initialization 14 | void Awake () { 15 | spriteRenderer = GetComponent (); 16 | } 17 | 18 | public void DamageWall (int loss) 19 | { 20 | SoundManager.instance.RandomizeSfx (chopSound1, chopSound2); 21 | spriteRenderer.sprite = dmgSprite; 22 | hp -= loss; 23 | if (hp <= 0) 24 | gameObject.SetActive (false); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Assets/Scripts/Wall.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae2ce03854a674ae1a8ab685db21a986 3 | timeCreated: 1425069392 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Sprites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7cb6f0cdb977404399bd449b6b218d1 3 | folderAsset: yes 4 | timeCreated: 1424842167 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Sprites/Scavengers_SpriteSheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/Assets/Sprites/Scavengers_SpriteSheet.png -------------------------------------------------------------------------------- /Assets/Sprites/Scavengers_SpriteSheet.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fbe1e7b94bb1a4a099d5bcb15a00141c 3 | TextureImporter: 4 | fileIDToRecycleName: 5 | 21300000: Scavengers_SpriteSheet_0 6 | 21300002: Scavengers_SpriteSheet_1 7 | 21300004: Scavengers_SpriteSheet_2 8 | 21300006: Scavengers_SpriteSheet_3 9 | 21300008: Scavengers_SpriteSheet_4 10 | 21300010: Scavengers_SpriteSheet_5 11 | 21300012: Scavengers_SpriteSheet_6 12 | 21300014: Scavengers_SpriteSheet_7 13 | 21300016: Scavengers_SpriteSheet_8 14 | 21300018: Scavengers_SpriteSheet_9 15 | 21300020: Scavengers_SpriteSheet_10 16 | 21300022: Scavengers_SpriteSheet_11 17 | 21300024: Scavengers_SpriteSheet_12 18 | 21300026: Scavengers_SpriteSheet_13 19 | 21300028: Scavengers_SpriteSheet_14 20 | 21300030: Scavengers_SpriteSheet_15 21 | 21300032: Scavengers_SpriteSheet_16 22 | 21300034: Scavengers_SpriteSheet_17 23 | 21300036: Scavengers_SpriteSheet_18 24 | 21300038: Scavengers_SpriteSheet_19 25 | 21300040: Scavengers_SpriteSheet_20 26 | 21300042: Scavengers_SpriteSheet_21 27 | 21300044: Scavengers_SpriteSheet_22 28 | 21300046: Scavengers_SpriteSheet_23 29 | 21300048: Scavengers_SpriteSheet_24 30 | 21300050: Scavengers_SpriteSheet_25 31 | 21300052: Scavengers_SpriteSheet_26 32 | 21300054: Scavengers_SpriteSheet_27 33 | 21300056: Scavengers_SpriteSheet_28 34 | 21300058: Scavengers_SpriteSheet_29 35 | 21300060: Scavengers_SpriteSheet_30 36 | 21300062: Scavengers_SpriteSheet_31 37 | 21300064: Scavengers_SpriteSheet_32 38 | 21300066: Scavengers_SpriteSheet_33 39 | 21300068: Scavengers_SpriteSheet_34 40 | 21300070: Scavengers_SpriteSheet_35 41 | 21300072: Scavengers_SpriteSheet_36 42 | 21300074: Scavengers_SpriteSheet_37 43 | 21300076: Scavengers_SpriteSheet_38 44 | 21300078: Scavengers_SpriteSheet_39 45 | 21300080: Scavengers_SpriteSheet_40 46 | 21300082: Scavengers_SpriteSheet_41 47 | 21300084: Scavengers_SpriteSheet_42 48 | 21300086: Scavengers_SpriteSheet_43 49 | 21300088: Scavengers_SpriteSheet_44 50 | 21300090: Scavengers_SpriteSheet_45 51 | 21300092: Scavengers_SpriteSheet_46 52 | 21300094: Scavengers_SpriteSheet_47 53 | 21300096: Scavengers_SpriteSheet_48 54 | 21300098: Scavengers_SpriteSheet_49 55 | 21300100: Scavengers_SpriteSheet_50 56 | 21300102: Scavengers_SpriteSheet_51 57 | 21300104: Scavengers_SpriteSheet_52 58 | 21300106: Scavengers_SpriteSheet_53 59 | 21300108: Scavengers_SpriteSheet_54 60 | 21300110: Scavengers_SpriteSheet_55 61 | serializedVersion: 2 62 | mipmaps: 63 | mipMapMode: 0 64 | enableMipMap: 1 65 | linearTexture: 0 66 | correctGamma: 0 67 | fadeOut: 0 68 | borderMipMap: 0 69 | mipMapFadeDistanceStart: 1 70 | mipMapFadeDistanceEnd: 3 71 | bumpmap: 72 | convertToNormalMap: 0 73 | externalNormalMap: 0 74 | heightScale: .25 75 | normalMapFilter: 0 76 | isReadable: 0 77 | grayScaleToAlpha: 0 78 | generateCubemap: 0 79 | cubemapConvolution: 0 80 | cubemapConvolutionSteps: 8 81 | cubemapConvolutionExponent: 1.5 82 | seamlessCubemap: 0 83 | textureFormat: -3 84 | maxTextureSize: 1024 85 | textureSettings: 86 | filterMode: 0 87 | aniso: 16 88 | mipBias: -1 89 | wrapMode: 1 90 | nPOTScale: 0 91 | lightmap: 0 92 | rGBM: 0 93 | compressionQuality: 50 94 | spriteMode: 2 95 | spriteExtrude: 1 96 | spriteMeshType: 1 97 | alignment: 0 98 | spritePivot: {x: .5, y: .5} 99 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 100 | spritePixelsToUnits: 32 101 | alphaIsTransparency: 1 102 | textureType: 8 103 | buildTargetSettings: [] 104 | spriteSheet: 105 | sprites: 106 | - name: Scavengers_SpriteSheet_0 107 | rect: 108 | serializedVersion: 2 109 | x: 0 110 | y: 192 111 | width: 32 112 | height: 32 113 | alignment: 0 114 | pivot: {x: 0, y: 0} 115 | border: {x: 0, y: 0, z: 0, w: 0} 116 | - name: Scavengers_SpriteSheet_1 117 | rect: 118 | serializedVersion: 2 119 | x: 32 120 | y: 192 121 | width: 32 122 | height: 32 123 | alignment: 0 124 | pivot: {x: 0, y: 0} 125 | border: {x: 0, y: 0, z: 0, w: 0} 126 | - name: Scavengers_SpriteSheet_2 127 | rect: 128 | serializedVersion: 2 129 | x: 64 130 | y: 192 131 | width: 32 132 | height: 32 133 | alignment: 0 134 | pivot: {x: 0, y: 0} 135 | border: {x: 0, y: 0, z: 0, w: 0} 136 | - name: Scavengers_SpriteSheet_3 137 | rect: 138 | serializedVersion: 2 139 | x: 96 140 | y: 192 141 | width: 32 142 | height: 32 143 | alignment: 0 144 | pivot: {x: 0, y: 0} 145 | border: {x: 0, y: 0, z: 0, w: 0} 146 | - name: Scavengers_SpriteSheet_4 147 | rect: 148 | serializedVersion: 2 149 | x: 128 150 | y: 192 151 | width: 32 152 | height: 32 153 | alignment: 0 154 | pivot: {x: 0, y: 0} 155 | border: {x: 0, y: 0, z: 0, w: 0} 156 | - name: Scavengers_SpriteSheet_5 157 | rect: 158 | serializedVersion: 2 159 | x: 160 160 | y: 192 161 | width: 32 162 | height: 32 163 | alignment: 0 164 | pivot: {x: 0, y: 0} 165 | border: {x: 0, y: 0, z: 0, w: 0} 166 | - name: Scavengers_SpriteSheet_6 167 | rect: 168 | serializedVersion: 2 169 | x: 192 170 | y: 192 171 | width: 32 172 | height: 32 173 | alignment: 0 174 | pivot: {x: 0, y: 0} 175 | border: {x: 0, y: 0, z: 0, w: 0} 176 | - name: Scavengers_SpriteSheet_7 177 | rect: 178 | serializedVersion: 2 179 | x: 224 180 | y: 192 181 | width: 32 182 | height: 32 183 | alignment: 0 184 | pivot: {x: 0, y: 0} 185 | border: {x: 0, y: 0, z: 0, w: 0} 186 | - name: Scavengers_SpriteSheet_8 187 | rect: 188 | serializedVersion: 2 189 | x: 0 190 | y: 160 191 | width: 32 192 | height: 32 193 | alignment: 0 194 | pivot: {x: 0, y: 0} 195 | border: {x: 0, y: 0, z: 0, w: 0} 196 | - name: Scavengers_SpriteSheet_9 197 | rect: 198 | serializedVersion: 2 199 | x: 32 200 | y: 160 201 | width: 32 202 | height: 32 203 | alignment: 0 204 | pivot: {x: 0, y: 0} 205 | border: {x: 0, y: 0, z: 0, w: 0} 206 | - name: Scavengers_SpriteSheet_10 207 | rect: 208 | serializedVersion: 2 209 | x: 64 210 | y: 160 211 | width: 32 212 | height: 32 213 | alignment: 0 214 | pivot: {x: 0, y: 0} 215 | border: {x: 0, y: 0, z: 0, w: 0} 216 | - name: Scavengers_SpriteSheet_11 217 | rect: 218 | serializedVersion: 2 219 | x: 96 220 | y: 160 221 | width: 32 222 | height: 32 223 | alignment: 0 224 | pivot: {x: 0, y: 0} 225 | border: {x: 0, y: 0, z: 0, w: 0} 226 | - name: Scavengers_SpriteSheet_12 227 | rect: 228 | serializedVersion: 2 229 | x: 128 230 | y: 160 231 | width: 32 232 | height: 32 233 | alignment: 0 234 | pivot: {x: 0, y: 0} 235 | border: {x: 0, y: 0, z: 0, w: 0} 236 | - name: Scavengers_SpriteSheet_13 237 | rect: 238 | serializedVersion: 2 239 | x: 160 240 | y: 160 241 | width: 32 242 | height: 32 243 | alignment: 0 244 | pivot: {x: 0, y: 0} 245 | border: {x: 0, y: 0, z: 0, w: 0} 246 | - name: Scavengers_SpriteSheet_14 247 | rect: 248 | serializedVersion: 2 249 | x: 192 250 | y: 160 251 | width: 32 252 | height: 32 253 | alignment: 0 254 | pivot: {x: 0, y: 0} 255 | border: {x: 0, y: 0, z: 0, w: 0} 256 | - name: Scavengers_SpriteSheet_15 257 | rect: 258 | serializedVersion: 2 259 | x: 224 260 | y: 160 261 | width: 32 262 | height: 32 263 | alignment: 0 264 | pivot: {x: 0, y: 0} 265 | border: {x: 0, y: 0, z: 0, w: 0} 266 | - name: Scavengers_SpriteSheet_16 267 | rect: 268 | serializedVersion: 2 269 | x: 0 270 | y: 128 271 | width: 32 272 | height: 32 273 | alignment: 0 274 | pivot: {x: 0, y: 0} 275 | border: {x: 0, y: 0, z: 0, w: 0} 276 | - name: Scavengers_SpriteSheet_17 277 | rect: 278 | serializedVersion: 2 279 | x: 32 280 | y: 128 281 | width: 32 282 | height: 32 283 | alignment: 0 284 | pivot: {x: 0, y: 0} 285 | border: {x: 0, y: 0, z: 0, w: 0} 286 | - name: Scavengers_SpriteSheet_18 287 | rect: 288 | serializedVersion: 2 289 | x: 64 290 | y: 128 291 | width: 32 292 | height: 32 293 | alignment: 0 294 | pivot: {x: 0, y: 0} 295 | border: {x: 0, y: 0, z: 0, w: 0} 296 | - name: Scavengers_SpriteSheet_19 297 | rect: 298 | serializedVersion: 2 299 | x: 96 300 | y: 128 301 | width: 32 302 | height: 32 303 | alignment: 0 304 | pivot: {x: 0, y: 0} 305 | border: {x: 0, y: 0, z: 0, w: 0} 306 | - name: Scavengers_SpriteSheet_20 307 | rect: 308 | serializedVersion: 2 309 | x: 128 310 | y: 128 311 | width: 32 312 | height: 32 313 | alignment: 0 314 | pivot: {x: 0, y: 0} 315 | border: {x: 0, y: 0, z: 0, w: 0} 316 | - name: Scavengers_SpriteSheet_21 317 | rect: 318 | serializedVersion: 2 319 | x: 160 320 | y: 128 321 | width: 32 322 | height: 32 323 | alignment: 0 324 | pivot: {x: 0, y: 0} 325 | border: {x: 0, y: 0, z: 0, w: 0} 326 | - name: Scavengers_SpriteSheet_22 327 | rect: 328 | serializedVersion: 2 329 | x: 192 330 | y: 128 331 | width: 32 332 | height: 32 333 | alignment: 0 334 | pivot: {x: 0, y: 0} 335 | border: {x: 0, y: 0, z: 0, w: 0} 336 | - name: Scavengers_SpriteSheet_23 337 | rect: 338 | serializedVersion: 2 339 | x: 224 340 | y: 128 341 | width: 32 342 | height: 32 343 | alignment: 0 344 | pivot: {x: 0, y: 0} 345 | border: {x: 0, y: 0, z: 0, w: 0} 346 | - name: Scavengers_SpriteSheet_24 347 | rect: 348 | serializedVersion: 2 349 | x: 0 350 | y: 96 351 | width: 32 352 | height: 32 353 | alignment: 0 354 | pivot: {x: 0, y: 0} 355 | border: {x: 0, y: 0, z: 0, w: 0} 356 | - name: Scavengers_SpriteSheet_25 357 | rect: 358 | serializedVersion: 2 359 | x: 32 360 | y: 96 361 | width: 32 362 | height: 32 363 | alignment: 0 364 | pivot: {x: 0, y: 0} 365 | border: {x: 0, y: 0, z: 0, w: 0} 366 | - name: Scavengers_SpriteSheet_26 367 | rect: 368 | serializedVersion: 2 369 | x: 64 370 | y: 96 371 | width: 32 372 | height: 32 373 | alignment: 0 374 | pivot: {x: 0, y: 0} 375 | border: {x: 0, y: 0, z: 0, w: 0} 376 | - name: Scavengers_SpriteSheet_27 377 | rect: 378 | serializedVersion: 2 379 | x: 96 380 | y: 96 381 | width: 32 382 | height: 32 383 | alignment: 0 384 | pivot: {x: 0, y: 0} 385 | border: {x: 0, y: 0, z: 0, w: 0} 386 | - name: Scavengers_SpriteSheet_28 387 | rect: 388 | serializedVersion: 2 389 | x: 128 390 | y: 96 391 | width: 32 392 | height: 32 393 | alignment: 0 394 | pivot: {x: 0, y: 0} 395 | border: {x: 0, y: 0, z: 0, w: 0} 396 | - name: Scavengers_SpriteSheet_29 397 | rect: 398 | serializedVersion: 2 399 | x: 160 400 | y: 96 401 | width: 32 402 | height: 32 403 | alignment: 0 404 | pivot: {x: 0, y: 0} 405 | border: {x: 0, y: 0, z: 0, w: 0} 406 | - name: Scavengers_SpriteSheet_30 407 | rect: 408 | serializedVersion: 2 409 | x: 192 410 | y: 96 411 | width: 32 412 | height: 32 413 | alignment: 0 414 | pivot: {x: 0, y: 0} 415 | border: {x: 0, y: 0, z: 0, w: 0} 416 | - name: Scavengers_SpriteSheet_31 417 | rect: 418 | serializedVersion: 2 419 | x: 224 420 | y: 96 421 | width: 32 422 | height: 32 423 | alignment: 0 424 | pivot: {x: 0, y: 0} 425 | border: {x: 0, y: 0, z: 0, w: 0} 426 | - name: Scavengers_SpriteSheet_32 427 | rect: 428 | serializedVersion: 2 429 | x: 0 430 | y: 64 431 | width: 32 432 | height: 32 433 | alignment: 0 434 | pivot: {x: 0, y: 0} 435 | border: {x: 0, y: 0, z: 0, w: 0} 436 | - name: Scavengers_SpriteSheet_33 437 | rect: 438 | serializedVersion: 2 439 | x: 32 440 | y: 64 441 | width: 32 442 | height: 32 443 | alignment: 0 444 | pivot: {x: 0, y: 0} 445 | border: {x: 0, y: 0, z: 0, w: 0} 446 | - name: Scavengers_SpriteSheet_34 447 | rect: 448 | serializedVersion: 2 449 | x: 64 450 | y: 64 451 | width: 32 452 | height: 32 453 | alignment: 0 454 | pivot: {x: 0, y: 0} 455 | border: {x: 0, y: 0, z: 0, w: 0} 456 | - name: Scavengers_SpriteSheet_35 457 | rect: 458 | serializedVersion: 2 459 | x: 96 460 | y: 64 461 | width: 32 462 | height: 32 463 | alignment: 0 464 | pivot: {x: 0, y: 0} 465 | border: {x: 0, y: 0, z: 0, w: 0} 466 | - name: Scavengers_SpriteSheet_36 467 | rect: 468 | serializedVersion: 2 469 | x: 128 470 | y: 64 471 | width: 32 472 | height: 32 473 | alignment: 0 474 | pivot: {x: 0, y: 0} 475 | border: {x: 0, y: 0, z: 0, w: 0} 476 | - name: Scavengers_SpriteSheet_37 477 | rect: 478 | serializedVersion: 2 479 | x: 160 480 | y: 64 481 | width: 32 482 | height: 32 483 | alignment: 0 484 | pivot: {x: 0, y: 0} 485 | border: {x: 0, y: 0, z: 0, w: 0} 486 | - name: Scavengers_SpriteSheet_38 487 | rect: 488 | serializedVersion: 2 489 | x: 192 490 | y: 64 491 | width: 32 492 | height: 32 493 | alignment: 0 494 | pivot: {x: 0, y: 0} 495 | border: {x: 0, y: 0, z: 0, w: 0} 496 | - name: Scavengers_SpriteSheet_39 497 | rect: 498 | serializedVersion: 2 499 | x: 224 500 | y: 64 501 | width: 32 502 | height: 32 503 | alignment: 0 504 | pivot: {x: 0, y: 0} 505 | border: {x: 0, y: 0, z: 0, w: 0} 506 | - name: Scavengers_SpriteSheet_40 507 | rect: 508 | serializedVersion: 2 509 | x: 0 510 | y: 32 511 | width: 32 512 | height: 32 513 | alignment: 0 514 | pivot: {x: 0, y: 0} 515 | border: {x: 0, y: 0, z: 0, w: 0} 516 | - name: Scavengers_SpriteSheet_41 517 | rect: 518 | serializedVersion: 2 519 | x: 32 520 | y: 32 521 | width: 32 522 | height: 32 523 | alignment: 0 524 | pivot: {x: 0, y: 0} 525 | border: {x: 0, y: 0, z: 0, w: 0} 526 | - name: Scavengers_SpriteSheet_42 527 | rect: 528 | serializedVersion: 2 529 | x: 64 530 | y: 32 531 | width: 32 532 | height: 32 533 | alignment: 0 534 | pivot: {x: 0, y: 0} 535 | border: {x: 0, y: 0, z: 0, w: 0} 536 | - name: Scavengers_SpriteSheet_43 537 | rect: 538 | serializedVersion: 2 539 | x: 96 540 | y: 32 541 | width: 32 542 | height: 32 543 | alignment: 0 544 | pivot: {x: 0, y: 0} 545 | border: {x: 0, y: 0, z: 0, w: 0} 546 | - name: Scavengers_SpriteSheet_44 547 | rect: 548 | serializedVersion: 2 549 | x: 128 550 | y: 32 551 | width: 32 552 | height: 32 553 | alignment: 0 554 | pivot: {x: 0, y: 0} 555 | border: {x: 0, y: 0, z: 0, w: 0} 556 | - name: Scavengers_SpriteSheet_45 557 | rect: 558 | serializedVersion: 2 559 | x: 160 560 | y: 32 561 | width: 32 562 | height: 32 563 | alignment: 0 564 | pivot: {x: 0, y: 0} 565 | border: {x: 0, y: 0, z: 0, w: 0} 566 | - name: Scavengers_SpriteSheet_46 567 | rect: 568 | serializedVersion: 2 569 | x: 192 570 | y: 32 571 | width: 32 572 | height: 32 573 | alignment: 0 574 | pivot: {x: 0, y: 0} 575 | border: {x: 0, y: 0, z: 0, w: 0} 576 | - name: Scavengers_SpriteSheet_47 577 | rect: 578 | serializedVersion: 2 579 | x: 224 580 | y: 32 581 | width: 32 582 | height: 32 583 | alignment: 0 584 | pivot: {x: 0, y: 0} 585 | border: {x: 0, y: 0, z: 0, w: 0} 586 | - name: Scavengers_SpriteSheet_48 587 | rect: 588 | serializedVersion: 2 589 | x: 0 590 | y: 0 591 | width: 32 592 | height: 32 593 | alignment: 0 594 | pivot: {x: 0, y: 0} 595 | border: {x: 0, y: 0, z: 0, w: 0} 596 | - name: Scavengers_SpriteSheet_49 597 | rect: 598 | serializedVersion: 2 599 | x: 32 600 | y: 0 601 | width: 32 602 | height: 32 603 | alignment: 0 604 | pivot: {x: 0, y: 0} 605 | border: {x: 0, y: 0, z: 0, w: 0} 606 | - name: Scavengers_SpriteSheet_50 607 | rect: 608 | serializedVersion: 2 609 | x: 64 610 | y: 0 611 | width: 32 612 | height: 32 613 | alignment: 0 614 | pivot: {x: 0, y: 0} 615 | border: {x: 0, y: 0, z: 0, w: 0} 616 | - name: Scavengers_SpriteSheet_51 617 | rect: 618 | serializedVersion: 2 619 | x: 96 620 | y: 0 621 | width: 32 622 | height: 32 623 | alignment: 0 624 | pivot: {x: 0, y: 0} 625 | border: {x: 0, y: 0, z: 0, w: 0} 626 | - name: Scavengers_SpriteSheet_52 627 | rect: 628 | serializedVersion: 2 629 | x: 128 630 | y: 0 631 | width: 32 632 | height: 32 633 | alignment: 0 634 | pivot: {x: 0, y: 0} 635 | border: {x: 0, y: 0, z: 0, w: 0} 636 | - name: Scavengers_SpriteSheet_53 637 | rect: 638 | serializedVersion: 2 639 | x: 160 640 | y: 0 641 | width: 32 642 | height: 32 643 | alignment: 0 644 | pivot: {x: 0, y: 0} 645 | border: {x: 0, y: 0, z: 0, w: 0} 646 | - name: Scavengers_SpriteSheet_54 647 | rect: 648 | serializedVersion: 2 649 | x: 192 650 | y: 0 651 | width: 32 652 | height: 32 653 | alignment: 0 654 | pivot: {x: 0, y: 0} 655 | border: {x: 0, y: 0, z: 0, w: 0} 656 | - name: Scavengers_SpriteSheet_55 657 | rect: 658 | serializedVersion: 2 659 | x: 224 660 | y: 0 661 | width: 32 662 | height: 32 663 | alignment: 0 664 | pivot: {x: 0, y: 0} 665 | border: {x: 0, y: 0, z: 0, w: 0} 666 | spritePackingTag: 667 | userData: 668 | assetBundleName: 669 | assetBundleVariant: 670 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Oliver Forral 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshLayers.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/ProjectSettings/NavMeshLayers.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshLayers.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00000000000000004100000000000000 3 | LibraryAssetImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.0.0f3 2 | m_StandardAssetsVersion: 0 3 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intrepion/unity-tutorial-2d-roguelike/f76f22c635e9f5b229c4f70cbaad9ab0f4d3efb1/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # unity-tutorial-2d-roguelike 2 | Following tutorial at http://unity3d.com/learn/tutorials/projects/2d-roguelike 3 | --------------------------------------------------------------------------------