Sanjay Madhav 8 rokov pred
rodič
commit
09f77ffe65

+ 47 - 47
Chapter05/Chapter6-mac.xcodeproj/project.pbxproj → Chapter05/Chapter05-mac.xcodeproj/project.pbxproj

@@ -7,10 +7,6 @@
 	objects = {
 	objects = {
 
 
 /* Begin PBXBuildFile section */
 /* Begin PBXBuildFile section */
-		9203E9F01F0DD69900F9FFC2 /* Tower.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9203E9EE1F0DD69900F9FFC2 /* Tower.cpp */; };
-		9203E9F31F0DE24000F9FFC2 /* Enemy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9203E9F11F0DE24000F9FFC2 /* Enemy.cpp */; };
-		9203E9F61F0DF13600F9FFC2 /* NavComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9203E9F41F0DF13600F9FFC2 /* NavComponent.cpp */; };
-		9203E9F91F0F12FE00F9FFC2 /* Bullet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9203E9F71F0F12FE00F9FFC2 /* Bullet.cpp */; };
 		9206FDC61F140707005078A2 /* Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9206FDC41F140707005078A2 /* Texture.cpp */; };
 		9206FDC61F140707005078A2 /* Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9206FDC41F140707005078A2 /* Texture.cpp */; };
 		9206FDC91F140D40005078A2 /* Shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9206FDC71F140D40005078A2 /* Shader.cpp */; };
 		9206FDC91F140D40005078A2 /* Shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9206FDC71F140D40005078A2 /* Shader.cpp */; };
 		9223C4781F009428009A94D7 /* Game.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9223C4671F009428009A94D7 /* Game.cpp */; };
 		9223C4781F009428009A94D7 /* Game.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9223C4671F009428009A94D7 /* Game.cpp */; };
@@ -20,24 +16,18 @@
 		9223C47E1F009428009A94D7 /* Math.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9223C4721F009428009A94D7 /* Math.cpp */; };
 		9223C47E1F009428009A94D7 /* Math.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9223C4721F009428009A94D7 /* Math.cpp */; };
 		9223C4801F009428009A94D7 /* SpriteComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9223C4761F009428009A94D7 /* SpriteComponent.cpp */; };
 		9223C4801F009428009A94D7 /* SpriteComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9223C4761F009428009A94D7 /* SpriteComponent.cpp */; };
 		9223C48B1F0CA3CE009A94D7 /* MoveComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9223C48A1F0CA3CE009A94D7 /* MoveComponent.cpp */; };
 		9223C48B1F0CA3CE009A94D7 /* MoveComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9223C48A1F0CA3CE009A94D7 /* MoveComponent.cpp */; };
-		9223C48F1F0CA67A009A94D7 /* Tile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9223C48D1F0CA67A009A94D7 /* Tile.cpp */; };
-		9223C4941F0CA766009A94D7 /* CollisionComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9223C4901F0CA766009A94D7 /* CollisionComponent.cpp */; };
 		9223C4951F0CA766009A94D7 /* CircleComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9223C4911F0CA766009A94D7 /* CircleComponent.cpp */; };
 		9223C4951F0CA766009A94D7 /* CircleComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9223C4911F0CA766009A94D7 /* CircleComponent.cpp */; };
-		9223C4981F0DBD69009A94D7 /* Grid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9223C4961F0DBD69009A94D7 /* Grid.cpp */; };
 		92CF0D791F3BBF140086A0F3 /* VertexArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 92CF0D771F3BBF140086A0F3 /* VertexArray.cpp */; };
 		92CF0D791F3BBF140086A0F3 /* VertexArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 92CF0D771F3BBF140086A0F3 /* VertexArray.cpp */; };
 		92D324FB1B697389005A86C7 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D324FA1B697389005A86C7 /* CoreFoundation.framework */; };
 		92D324FB1B697389005A86C7 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 92D324FA1B697389005A86C7 /* CoreFoundation.framework */; };
+		92E391981FE87F4800D8C362 /* InputComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 92E3918F1FE87F4700D8C362 /* InputComponent.cpp */; };
+		92E391991FE87F4800D8C362 /* Ship.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 92E391911FE87F4700D8C362 /* Ship.cpp */; };
+		92E3919A1FE87F4800D8C362 /* Asteroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 92E391921FE87F4700D8C362 /* Asteroid.cpp */; };
+		92E3919B1FE87F4800D8C362 /* Laser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 92E391931FE87F4700D8C362 /* Laser.cpp */; };
+		92E3919C1FE87F4800D8C362 /* Random.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 92E391941FE87F4800D8C362 /* Random.cpp */; };
 		92E46E941B6353E50035CD21 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 92E46E931B6353E50035CD21 /* OpenGL.framework */; };
 		92E46E941B6353E50035CD21 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 92E46E931B6353E50035CD21 /* OpenGL.framework */; };
 /* End PBXBuildFile section */
 /* End PBXBuildFile section */
 
 
 /* Begin PBXFileReference section */
 /* Begin PBXFileReference section */
-		9203E9EE1F0DD69900F9FFC2 /* Tower.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Tower.cpp; sourceTree = "<group>"; };
-		9203E9EF1F0DD69900F9FFC2 /* Tower.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tower.h; sourceTree = "<group>"; };
-		9203E9F11F0DE24000F9FFC2 /* Enemy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Enemy.cpp; sourceTree = "<group>"; };
-		9203E9F21F0DE24000F9FFC2 /* Enemy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Enemy.h; sourceTree = "<group>"; };
-		9203E9F41F0DF13600F9FFC2 /* NavComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NavComponent.cpp; sourceTree = "<group>"; };
-		9203E9F51F0DF13600F9FFC2 /* NavComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavComponent.h; sourceTree = "<group>"; };
-		9203E9F71F0F12FE00F9FFC2 /* Bullet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Bullet.cpp; sourceTree = "<group>"; };
-		9203E9F81F0F12FE00F9FFC2 /* Bullet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bullet.h; sourceTree = "<group>"; };
 		9206FDC31F13F7E8005078A2 /* Shaders */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Shaders; sourceTree = "<group>"; };
 		9206FDC31F13F7E8005078A2 /* Shaders */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Shaders; sourceTree = "<group>"; };
 		9206FDC41F140707005078A2 /* Texture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Texture.cpp; sourceTree = "<group>"; };
 		9206FDC41F140707005078A2 /* Texture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Texture.cpp; sourceTree = "<group>"; };
 		9206FDC51F140707005078A2 /* Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Texture.h; sourceTree = "<group>"; };
 		9206FDC51F140707005078A2 /* Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Texture.h; sourceTree = "<group>"; };
@@ -56,17 +46,21 @@
 		9223C4771F009428009A94D7 /* SpriteComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpriteComponent.h; sourceTree = "<group>"; };
 		9223C4771F009428009A94D7 /* SpriteComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpriteComponent.h; sourceTree = "<group>"; };
 		9223C48A1F0CA3CE009A94D7 /* MoveComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MoveComponent.cpp; sourceTree = "<group>"; };
 		9223C48A1F0CA3CE009A94D7 /* MoveComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MoveComponent.cpp; sourceTree = "<group>"; };
 		9223C48C1F0CA3D4009A94D7 /* MoveComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MoveComponent.h; sourceTree = "<group>"; };
 		9223C48C1F0CA3D4009A94D7 /* MoveComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MoveComponent.h; sourceTree = "<group>"; };
-		9223C48D1F0CA67A009A94D7 /* Tile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Tile.cpp; sourceTree = "<group>"; };
-		9223C48E1F0CA67A009A94D7 /* Tile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tile.h; sourceTree = "<group>"; };
-		9223C4901F0CA766009A94D7 /* CollisionComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CollisionComponent.cpp; sourceTree = "<group>"; };
 		9223C4911F0CA766009A94D7 /* CircleComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CircleComponent.cpp; sourceTree = "<group>"; };
 		9223C4911F0CA766009A94D7 /* CircleComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CircleComponent.cpp; sourceTree = "<group>"; };
-		9223C4921F0CA766009A94D7 /* CollisionComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CollisionComponent.h; sourceTree = "<group>"; };
 		9223C4931F0CA766009A94D7 /* CircleComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CircleComponent.h; sourceTree = "<group>"; };
 		9223C4931F0CA766009A94D7 /* CircleComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CircleComponent.h; sourceTree = "<group>"; };
-		9223C4961F0DBD69009A94D7 /* Grid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Grid.cpp; sourceTree = "<group>"; };
-		9223C4971F0DBD69009A94D7 /* Grid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Grid.h; sourceTree = "<group>"; };
 		92CF0D771F3BBF140086A0F3 /* VertexArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VertexArray.cpp; sourceTree = "<group>"; };
 		92CF0D771F3BBF140086A0F3 /* VertexArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VertexArray.cpp; sourceTree = "<group>"; };
 		92CF0D781F3BBF140086A0F3 /* VertexArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VertexArray.h; sourceTree = "<group>"; };
 		92CF0D781F3BBF140086A0F3 /* VertexArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VertexArray.h; sourceTree = "<group>"; };
 		92D324FA1B697389005A86C7 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
 		92D324FA1B697389005A86C7 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
+		92E3918E1FE87F4700D8C362 /* Asteroid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Asteroid.h; sourceTree = "<group>"; };
+		92E3918F1FE87F4700D8C362 /* InputComponent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InputComponent.cpp; sourceTree = "<group>"; };
+		92E391901FE87F4700D8C362 /* Random.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Random.h; sourceTree = "<group>"; };
+		92E391911FE87F4700D8C362 /* Ship.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Ship.cpp; sourceTree = "<group>"; };
+		92E391921FE87F4700D8C362 /* Asteroid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Asteroid.cpp; sourceTree = "<group>"; };
+		92E391931FE87F4700D8C362 /* Laser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Laser.cpp; sourceTree = "<group>"; };
+		92E391941FE87F4800D8C362 /* Random.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Random.cpp; sourceTree = "<group>"; };
+		92E391951FE87F4800D8C362 /* Laser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Laser.h; sourceTree = "<group>"; };
+		92E391961FE87F4800D8C362 /* InputComponent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputComponent.h; sourceTree = "<group>"; };
+		92E391971FE87F4800D8C362 /* Ship.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Ship.h; sourceTree = "<group>"; };
 		92E46DF71B634EA30035CD21 /* Game-mac */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "Game-mac"; sourceTree = BUILT_PRODUCTS_DIR; };
 		92E46DF71B634EA30035CD21 /* Game-mac */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "Game-mac"; sourceTree = BUILT_PRODUCTS_DIR; };
 		92E46E931B6353E50035CD21 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
 		92E46E931B6353E50035CD21 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
 /* End PBXFileReference section */
 /* End PBXFileReference section */
@@ -87,41 +81,37 @@
 		92E46DEE1B634EA30035CD21 = {
 		92E46DEE1B634EA30035CD21 = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
-				92CF0D771F3BBF140086A0F3 /* VertexArray.cpp */,
-				92CF0D781F3BBF140086A0F3 /* VertexArray.h */,
 				9223C4681F009428009A94D7 /* Actor.cpp */,
 				9223C4681F009428009A94D7 /* Actor.cpp */,
 				9223C4691F009428009A94D7 /* Actor.h */,
 				9223C4691F009428009A94D7 /* Actor.h */,
-				9203E9F71F0F12FE00F9FFC2 /* Bullet.cpp */,
-				9203E9F81F0F12FE00F9FFC2 /* Bullet.h */,
+				92E391921FE87F4700D8C362 /* Asteroid.cpp */,
+				92E3918E1FE87F4700D8C362 /* Asteroid.h */,
 				9223C46E1F009428009A94D7 /* Component.cpp */,
 				9223C46E1F009428009A94D7 /* Component.cpp */,
 				9223C46F1F009428009A94D7 /* Component.h */,
 				9223C46F1F009428009A94D7 /* Component.h */,
 				9223C4911F0CA766009A94D7 /* CircleComponent.cpp */,
 				9223C4911F0CA766009A94D7 /* CircleComponent.cpp */,
 				9223C4931F0CA766009A94D7 /* CircleComponent.h */,
 				9223C4931F0CA766009A94D7 /* CircleComponent.h */,
-				9223C4901F0CA766009A94D7 /* CollisionComponent.cpp */,
-				9223C4921F0CA766009A94D7 /* CollisionComponent.h */,
-				9203E9F11F0DE24000F9FFC2 /* Enemy.cpp */,
-				9203E9F21F0DE24000F9FFC2 /* Enemy.h */,
 				9223C4671F009428009A94D7 /* Game.cpp */,
 				9223C4671F009428009A94D7 /* Game.cpp */,
 				9223C4701F009428009A94D7 /* Game.h */,
 				9223C4701F009428009A94D7 /* Game.h */,
-				9223C4961F0DBD69009A94D7 /* Grid.cpp */,
-				9223C4971F0DBD69009A94D7 /* Grid.h */,
+				92E3918F1FE87F4700D8C362 /* InputComponent.cpp */,
+				92E391961FE87F4800D8C362 /* InputComponent.h */,
+				92E391931FE87F4700D8C362 /* Laser.cpp */,
+				92E391951FE87F4800D8C362 /* Laser.h */,
 				9223C4711F009428009A94D7 /* Main.cpp */,
 				9223C4711F009428009A94D7 /* Main.cpp */,
 				9223C4721F009428009A94D7 /* Math.cpp */,
 				9223C4721F009428009A94D7 /* Math.cpp */,
 				9223C4731F009428009A94D7 /* Math.h */,
 				9223C4731F009428009A94D7 /* Math.h */,
 				9223C48A1F0CA3CE009A94D7 /* MoveComponent.cpp */,
 				9223C48A1F0CA3CE009A94D7 /* MoveComponent.cpp */,
 				9223C48C1F0CA3D4009A94D7 /* MoveComponent.h */,
 				9223C48C1F0CA3D4009A94D7 /* MoveComponent.h */,
-				9203E9F41F0DF13600F9FFC2 /* NavComponent.cpp */,
-				9203E9F51F0DF13600F9FFC2 /* NavComponent.h */,
+				92E391941FE87F4800D8C362 /* Random.cpp */,
+				92E391901FE87F4700D8C362 /* Random.h */,
 				9206FDC71F140D40005078A2 /* Shader.cpp */,
 				9206FDC71F140D40005078A2 /* Shader.cpp */,
 				9206FDC81F140D40005078A2 /* Shader.h */,
 				9206FDC81F140D40005078A2 /* Shader.h */,
+				92E391911FE87F4700D8C362 /* Ship.cpp */,
+				92E391971FE87F4800D8C362 /* Ship.h */,
 				9223C4761F009428009A94D7 /* SpriteComponent.cpp */,
 				9223C4761F009428009A94D7 /* SpriteComponent.cpp */,
 				9223C4771F009428009A94D7 /* SpriteComponent.h */,
 				9223C4771F009428009A94D7 /* SpriteComponent.h */,
 				9206FDC41F140707005078A2 /* Texture.cpp */,
 				9206FDC41F140707005078A2 /* Texture.cpp */,
 				9206FDC51F140707005078A2 /* Texture.h */,
 				9206FDC51F140707005078A2 /* Texture.h */,
-				9223C48D1F0CA67A009A94D7 /* Tile.cpp */,
-				9223C48E1F0CA67A009A94D7 /* Tile.h */,
-				9203E9EE1F0DD69900F9FFC2 /* Tower.cpp */,
-				9203E9EF1F0DD69900F9FFC2 /* Tower.h */,
+				92CF0D771F3BBF140086A0F3 /* VertexArray.cpp */,
+				92CF0D781F3BBF140086A0F3 /* VertexArray.h */,
 				9206FDC31F13F7E8005078A2 /* Shaders */,
 				9206FDC31F13F7E8005078A2 /* Shaders */,
 				92E46DF81B634EA30035CD21 /* Products */,
 				92E46DF81B634EA30035CD21 /* Products */,
 				92D324FA1B697389005A86C7 /* CoreFoundation.framework */,
 				92D324FA1B697389005A86C7 /* CoreFoundation.framework */,
@@ -163,7 +153,7 @@
 		92E46DEF1B634EA30035CD21 /* Project object */ = {
 		92E46DEF1B634EA30035CD21 /* Project object */ = {
 			isa = PBXProject;
 			isa = PBXProject;
 			attributes = {
 			attributes = {
-				LastUpgradeCheck = 0830;
+				LastUpgradeCheck = 0920;
 				ORGANIZATIONNAME = "Sanjay Madhav";
 				ORGANIZATIONNAME = "Sanjay Madhav";
 				TargetAttributes = {
 				TargetAttributes = {
 					92E46DF61B634EA30035CD21 = {
 					92E46DF61B634EA30035CD21 = {
@@ -171,7 +161,7 @@
 					};
 					};
 				};
 				};
 			};
 			};
-			buildConfigurationList = 92E46DF21B634EA30035CD21 /* Build configuration list for PBXProject "Chapter6-mac" */;
+			buildConfigurationList = 92E46DF21B634EA30035CD21 /* Build configuration list for PBXProject "Chapter05-mac" */;
 			compatibilityVersion = "Xcode 3.2";
 			compatibilityVersion = "Xcode 3.2";
 			developmentRegion = English;
 			developmentRegion = English;
 			hasScannedForEncodings = 0;
 			hasScannedForEncodings = 0;
@@ -209,24 +199,22 @@
 			isa = PBXSourcesBuildPhase;
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			buildActionMask = 2147483647;
 			files = (
 			files = (
-				9223C4941F0CA766009A94D7 /* CollisionComponent.cpp in Sources */,
+				92E391991FE87F4800D8C362 /* Ship.cpp in Sources */,
 				9223C47D1F009428009A94D7 /* Main.cpp in Sources */,
 				9223C47D1F009428009A94D7 /* Main.cpp in Sources */,
 				9223C47E1F009428009A94D7 /* Math.cpp in Sources */,
 				9223C47E1F009428009A94D7 /* Math.cpp in Sources */,
-				9203E9F01F0DD69900F9FFC2 /* Tower.cpp in Sources */,
 				9223C4781F009428009A94D7 /* Game.cpp in Sources */,
 				9223C4781F009428009A94D7 /* Game.cpp in Sources */,
-				9203E9F61F0DF13600F9FFC2 /* NavComponent.cpp in Sources */,
 				9223C4801F009428009A94D7 /* SpriteComponent.cpp in Sources */,
 				9223C4801F009428009A94D7 /* SpriteComponent.cpp in Sources */,
 				92CF0D791F3BBF140086A0F3 /* VertexArray.cpp in Sources */,
 				92CF0D791F3BBF140086A0F3 /* VertexArray.cpp in Sources */,
 				9223C48B1F0CA3CE009A94D7 /* MoveComponent.cpp in Sources */,
 				9223C48B1F0CA3CE009A94D7 /* MoveComponent.cpp in Sources */,
-				9203E9F31F0DE24000F9FFC2 /* Enemy.cpp in Sources */,
 				9206FDC91F140D40005078A2 /* Shader.cpp in Sources */,
 				9206FDC91F140D40005078A2 /* Shader.cpp in Sources */,
 				9223C4791F009428009A94D7 /* Actor.cpp in Sources */,
 				9223C4791F009428009A94D7 /* Actor.cpp in Sources */,
-				9203E9F91F0F12FE00F9FFC2 /* Bullet.cpp in Sources */,
+				92E3919B1FE87F4800D8C362 /* Laser.cpp in Sources */,
 				9223C4951F0CA766009A94D7 /* CircleComponent.cpp in Sources */,
 				9223C4951F0CA766009A94D7 /* CircleComponent.cpp in Sources */,
 				9223C47C1F009428009A94D7 /* Component.cpp in Sources */,
 				9223C47C1F009428009A94D7 /* Component.cpp in Sources */,
+				92E3919C1FE87F4800D8C362 /* Random.cpp in Sources */,
+				92E391981FE87F4800D8C362 /* InputComponent.cpp in Sources */,
+				92E3919A1FE87F4800D8C362 /* Asteroid.cpp in Sources */,
 				9206FDC61F140707005078A2 /* Texture.cpp in Sources */,
 				9206FDC61F140707005078A2 /* Texture.cpp in Sources */,
-				9223C48F1F0CA67A009A94D7 /* Tile.cpp in Sources */,
-				9223C4981F0DBD69009A94D7 /* Grid.cpp in Sources */,
 			);
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 		};
@@ -241,14 +229,20 @@
 				CLANG_CXX_LIBRARY = "libc++";
 				CLANG_CXX_LIBRARY = "libc++";
 				CLANG_ENABLE_MODULES = YES;
 				CLANG_ENABLE_MODULES = YES;
 				CLANG_ENABLE_OBJC_ARC = YES;
 				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
 				CLANG_WARN_BOOL_CONVERSION = YES;
 				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_COMMA = YES;
 				CLANG_WARN_CONSTANT_CONVERSION = YES;
 				CLANG_WARN_CONSTANT_CONVERSION = YES;
 				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
 				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
 				CLANG_WARN_EMPTY_BODY = YES;
 				CLANG_WARN_EMPTY_BODY = YES;
 				CLANG_WARN_ENUM_CONVERSION = YES;
 				CLANG_WARN_ENUM_CONVERSION = YES;
 				CLANG_WARN_INFINITE_RECURSION = YES;
 				CLANG_WARN_INFINITE_RECURSION = YES;
 				CLANG_WARN_INT_CONVERSION = YES;
 				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -286,14 +280,20 @@
 				CLANG_CXX_LIBRARY = "libc++";
 				CLANG_CXX_LIBRARY = "libc++";
 				CLANG_ENABLE_MODULES = YES;
 				CLANG_ENABLE_MODULES = YES;
 				CLANG_ENABLE_OBJC_ARC = YES;
 				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
 				CLANG_WARN_BOOL_CONVERSION = YES;
 				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_COMMA = YES;
 				CLANG_WARN_CONSTANT_CONVERSION = YES;
 				CLANG_WARN_CONSTANT_CONVERSION = YES;
 				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
 				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
 				CLANG_WARN_EMPTY_BODY = YES;
 				CLANG_WARN_EMPTY_BODY = YES;
 				CLANG_WARN_ENUM_CONVERSION = YES;
 				CLANG_WARN_ENUM_CONVERSION = YES;
 				CLANG_WARN_INFINITE_RECURSION = YES;
 				CLANG_WARN_INFINITE_RECURSION = YES;
 				CLANG_WARN_INT_CONVERSION = YES;
 				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -378,7 +378,7 @@
 /* End XCBuildConfiguration section */
 /* End XCBuildConfiguration section */
 
 
 /* Begin XCConfigurationList section */
 /* Begin XCConfigurationList section */
-		92E46DF21B634EA30035CD21 /* Build configuration list for PBXProject "Chapter6-mac" */ = {
+		92E46DF21B634EA30035CD21 /* Build configuration list for PBXProject "Chapter05-mac" */ = {
 			isa = XCConfigurationList;
 			isa = XCConfigurationList;
 			buildConfigurations = (
 			buildConfigurations = (
 				92E46DFC1B634EA40035CD21 /* Debug */,
 				92E46DFC1B634EA40035CD21 /* Debug */,

+ 1 - 1
Chapter05/Chapter6-mac.xcodeproj/project.xcworkspace/contents.xcworkspacedata → Chapter05/Chapter05-mac.xcodeproj/project.xcworkspace/contents.xcworkspacedata

@@ -2,6 +2,6 @@
 <Workspace
 <Workspace
    version = "1.0">
    version = "1.0">
    <FileRef
    <FileRef
-      location = "self:/Users/Sanjay/gameprogcpp-solutions/Chapter06-new/Chapter6-mac.xcodeproj">
+      location = "self:/Users/Sanjay/gameprogcpp-final/Chapter05/Chapter05-mac.xcodeproj">
    </FileRef>
    </FileRef>
 </Workspace>
 </Workspace>

+ 7 - 5
Chapter05/Chapter6-mac.xcodeproj/xcshareddata/xcschemes/Game-mac.xcscheme → Chapter05/Chapter05-mac.xcodeproj/xcshareddata/xcschemes/Game-mac.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
 <Scheme
-   LastUpgradeVersion = "0830"
+   LastUpgradeVersion = "0920"
    version = "1.3">
    version = "1.3">
    <BuildAction
    <BuildAction
       parallelizeBuildables = "YES"
       parallelizeBuildables = "YES"
@@ -17,7 +17,7 @@
                BlueprintIdentifier = "92E46DF61B634EA30035CD21"
                BlueprintIdentifier = "92E46DF61B634EA30035CD21"
                BuildableName = "Game-mac"
                BuildableName = "Game-mac"
                BlueprintName = "Game-mac"
                BlueprintName = "Game-mac"
-               ReferencedContainer = "container:Chapter6-mac.xcodeproj">
+               ReferencedContainer = "container:Chapter05-mac.xcodeproj">
             </BuildableReference>
             </BuildableReference>
          </BuildActionEntry>
          </BuildActionEntry>
       </BuildActionEntries>
       </BuildActionEntries>
@@ -26,6 +26,7 @@
       buildConfiguration = "Debug"
       buildConfiguration = "Debug"
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      language = ""
       shouldUseLaunchSchemeArgsEnv = "YES">
       shouldUseLaunchSchemeArgsEnv = "YES">
       <Testables>
       <Testables>
       </Testables>
       </Testables>
@@ -35,7 +36,7 @@
             BlueprintIdentifier = "92E46DF61B634EA30035CD21"
             BlueprintIdentifier = "92E46DF61B634EA30035CD21"
             BuildableName = "Game-mac"
             BuildableName = "Game-mac"
             BlueprintName = "Game-mac"
             BlueprintName = "Game-mac"
-            ReferencedContainer = "container:Chapter6-mac.xcodeproj">
+            ReferencedContainer = "container:Chapter05-mac.xcodeproj">
          </BuildableReference>
          </BuildableReference>
       </MacroExpansion>
       </MacroExpansion>
       <AdditionalOptions>
       <AdditionalOptions>
@@ -45,6 +46,7 @@
       buildConfiguration = "Debug"
       buildConfiguration = "Debug"
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      language = ""
       launchStyle = "0"
       launchStyle = "0"
       useCustomWorkingDirectory = "YES"
       useCustomWorkingDirectory = "YES"
       customWorkingDirectory = "$(SRCROOT)"
       customWorkingDirectory = "$(SRCROOT)"
@@ -59,7 +61,7 @@
             BlueprintIdentifier = "92E46DF61B634EA30035CD21"
             BlueprintIdentifier = "92E46DF61B634EA30035CD21"
             BuildableName = "Game-mac"
             BuildableName = "Game-mac"
             BlueprintName = "Game-mac"
             BlueprintName = "Game-mac"
-            ReferencedContainer = "container:Chapter6-mac.xcodeproj">
+            ReferencedContainer = "container:Chapter05-mac.xcodeproj">
          </BuildableReference>
          </BuildableReference>
       </BuildableProductRunnable>
       </BuildableProductRunnable>
       <AdditionalOptions>
       <AdditionalOptions>
@@ -78,7 +80,7 @@
             BlueprintIdentifier = "92E46DF61B634EA30035CD21"
             BlueprintIdentifier = "92E46DF61B634EA30035CD21"
             BuildableName = "Game-mac"
             BuildableName = "Game-mac"
             BlueprintName = "Game-mac"
             BlueprintName = "Game-mac"
-            ReferencedContainer = "container:Chapter6-mac.xcodeproj">
+            ReferencedContainer = "container:Chapter05-mac.xcodeproj">
          </BuildableReference>
          </BuildableReference>
       </BuildableProductRunnable>
       </BuildableProductRunnable>
    </ProfileAction>
    </ProfileAction>

+ 16 - 17
Chapter05/Math.cpp

@@ -99,12 +99,13 @@ Vector3 Vector3::Transform(const Vector3& v, const Quaternion& q)
 void Matrix4::Invert()
 void Matrix4::Invert()
 {
 {
 	// Thanks slow math
 	// Thanks slow math
-	float tmp[12]; /* temp array for pairs */
-	float src[16]; /* array of transpose source matrix */
-	float dst[16]; /* storage */
-	float det; /* determinant */
-	/* transpose matrix */
+	// This is a really janky way to unroll everything...
+	float tmp[12];
+	float src[16];
+	float dst[16];
+	float det;
 
 
+	// Transpose matrix
 	// row 1 to col 1
 	// row 1 to col 1
 	src[0] = mat[0][0];
 	src[0] = mat[0][0];
 	src[4] = mat[0][1];
 	src[4] = mat[0][1];
@@ -129,13 +130,7 @@ void Matrix4::Invert()
 	src[11] = mat[3][2];
 	src[11] = mat[3][2];
 	src[15] = mat[3][3];
 	src[15] = mat[3][3];
 
 
-	// 	for (int i = 0; i < 4; i++) {
-	// 		src[i] = mat[i*4];
-	// 		src[i + 4] = mat[i*4 + 1];
-	// 		src[i + 8] = mat[i*4 + 2];
-	// 		src[i + 12] = mat[i*4 + 3];
-	// 	}
-	/* calculate pairs for first 8 elements (cofactors) */
+	// Calculate cofactors
 	tmp[0] = src[10] * src[15];
 	tmp[0] = src[10] * src[15];
 	tmp[1] = src[11] * src[14];
 	tmp[1] = src[11] * src[14];
 	tmp[2] = src[9] * src[15];
 	tmp[2] = src[9] * src[15];
@@ -148,7 +143,7 @@ void Matrix4::Invert()
 	tmp[9] = src[10] * src[12];
 	tmp[9] = src[10] * src[12];
 	tmp[10] = src[8] * src[13];
 	tmp[10] = src[8] * src[13];
 	tmp[11] = src[9] * src[12];
 	tmp[11] = src[9] * src[12];
-	/* calculate first 8 elements (cofactors) */
+	
 	dst[0] = tmp[0] * src[5] + tmp[3] * src[6] + tmp[4] * src[7];
 	dst[0] = tmp[0] * src[5] + tmp[3] * src[6] + tmp[4] * src[7];
 	dst[0] -= tmp[1] * src[5] + tmp[2] * src[6] + tmp[5] * src[7];
 	dst[0] -= tmp[1] * src[5] + tmp[2] * src[6] + tmp[5] * src[7];
 	dst[1] = tmp[1] * src[4] + tmp[6] * src[6] + tmp[9] * src[7];
 	dst[1] = tmp[1] * src[4] + tmp[6] * src[6] + tmp[9] * src[7];
@@ -165,7 +160,7 @@ void Matrix4::Invert()
 	dst[6] -= tmp[2] * src[0] + tmp[7] * src[1] + tmp[10] * src[3];
 	dst[6] -= tmp[2] * src[0] + tmp[7] * src[1] + tmp[10] * src[3];
 	dst[7] = tmp[4] * src[0] + tmp[9] * src[1] + tmp[10] * src[2];
 	dst[7] = tmp[4] * src[0] + tmp[9] * src[1] + tmp[10] * src[2];
 	dst[7] -= tmp[5] * src[0] + tmp[8] * src[1] + tmp[11] * src[2];
 	dst[7] -= tmp[5] * src[0] + tmp[8] * src[1] + tmp[11] * src[2];
-	/* calculate pairs for second 8 elements (cofactors) */
+	
 	tmp[0] = src[2] * src[7];
 	tmp[0] = src[2] * src[7];
 	tmp[1] = src[3] * src[6];
 	tmp[1] = src[3] * src[6];
 	tmp[2] = src[1] * src[7];
 	tmp[2] = src[1] * src[7];
@@ -178,7 +173,7 @@ void Matrix4::Invert()
 	tmp[9] = src[2] * src[4];
 	tmp[9] = src[2] * src[4];
 	tmp[10] = src[0] * src[5];
 	tmp[10] = src[0] * src[5];
 	tmp[11] = src[1] * src[4];
 	tmp[11] = src[1] * src[4];
-	/* calculate second 8 elements (cofactors) */
+	
 	dst[8] = tmp[0] * src[13] + tmp[3] * src[14] + tmp[4] * src[15];
 	dst[8] = tmp[0] * src[13] + tmp[3] * src[14] + tmp[4] * src[15];
 	dst[8] -= tmp[1] * src[13] + tmp[2] * src[14] + tmp[5] * src[15];
 	dst[8] -= tmp[1] * src[13] + tmp[2] * src[14] + tmp[5] * src[15];
 	dst[9] = tmp[1] * src[12] + tmp[6] * src[14] + tmp[9] * src[15];
 	dst[9] = tmp[1] * src[12] + tmp[6] * src[14] + tmp[9] * src[15];
@@ -195,12 +190,16 @@ void Matrix4::Invert()
 	dst[14] -= tmp[10] * src[11] + tmp[2] * src[8] + tmp[7] * src[9];
 	dst[14] -= tmp[10] * src[11] + tmp[2] * src[8] + tmp[7] * src[9];
 	dst[15] = tmp[10] * src[10] + tmp[4] * src[8] + tmp[9] * src[9];
 	dst[15] = tmp[10] * src[10] + tmp[4] * src[8] + tmp[9] * src[9];
 	dst[15] -= tmp[8] * src[9] + tmp[11] * src[10] + tmp[5] * src[8];
 	dst[15] -= tmp[8] * src[9] + tmp[11] * src[10] + tmp[5] * src[8];
-	/* calculate determinant */
+	
+	// Calculate determinant
 	det = src[0] * dst[0] + src[1] * dst[1] + src[2] * dst[2] + src[3] * dst[3];
 	det = src[0] * dst[0] + src[1] * dst[1] + src[2] * dst[2] + src[3] * dst[3];
-	/* calculate matrix inverse */
+	
+	// Inverse of matrix is divided by determinant
 	det = 1 / det;
 	det = 1 / det;
 	for (int j = 0; j < 16; j++)
 	for (int j = 0; j < 16; j++)
+	{
 		dst[j] *= det;
 		dst[j] *= det;
+	}
 
 
 	// Set it back
 	// Set it back
 	for (int i = 0; i < 4; i++)
 	for (int i = 0; i < 4; i++)