├── .gitignore ├── ExampleEngine.xcodeproj └── project.pbxproj └── ExampleEngine ├── AccelerationScene.h ├── AccelerationScene.m ├── BeachBallScene.h ├── BeachBallScene.m ├── ColorChangeScene.h ├── ColorChangeScene.m ├── ComplexAnimationScene.h ├── ComplexAnimationScene.m ├── EEAnimation.h ├── EEAnimation.m ├── EEAppDelegate.h ├── EEAppDelegate.m ├── EEEllipse.h ├── EEEllipse.m ├── EERectangle.h ├── EERectangle.m ├── EERegularPolygon.h ├── EERegularPolygon.m ├── EEScene.h ├── EEScene.m ├── EESceneController.h ├── EESceneController.m ├── EEShape.h ├── EEShape.m ├── EESprite.h ├── EESprite.m ├── EESpriteAnimation.h ├── EESpriteAnimation.m ├── EETriangle.h ├── EETriangle.m ├── EllipseScene.h ├── EllipseScene.m ├── ExampleEngine-Info.plist ├── ExampleEngine-Prefix.pch ├── ForestScene.h ├── ForestScene.m ├── HexagonScene.h ├── HexagonScene.m ├── LandscapeScene.h ├── LandscapeScene.m ├── ManuallyMovedTree.h ├── ManuallyMovedTree.m ├── OptimizedTree.h ├── OptimizedTree.m ├── PrettyAPIMoveScene.h ├── PrettyAPIMoveScene.m ├── RectangleScene.h ├── RectangleScene.m ├── RotatingTreeScene.h ├── RotatingTreeScene.m ├── SierpinskyTriangleScene.h ├── SierpinskyTriangleScene.m ├── SpriteScene.h ├── SpriteScene.m ├── Tree.h ├── Tree.m ├── TreeScene.h ├── TreeScene.m ├── TriangleScene.h ├── TriangleScene.m ├── VelocityScene.h ├── VelocityScene.m ├── WalkingAnimationScene.h ├── WalkingAnimationScene.m ├── ball.jpg ├── boy-sprite.png ├── en.lproj └── InfoPlist.strings ├── landscape.jpg ├── main.m ├── sierpinksy.jpg └── sprite animation ├── alfred0.png ├── alfred1.png ├── alfred2.png ├── alfred3.png ├── alfred4.png ├── alfred5.png ├── alfred6.png ├── alfred7.png ├── alfred8.png └── alfred9.png /.gitignore: -------------------------------------------------------------------------------- 1 | ExampleEngine.xcodeproj/project.xcworkspace/ 2 | ExampleEngine.xcodeproj/xcuserdata/ 3 | -------------------------------------------------------------------------------- /ExampleEngine.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3C1EF89B13FDA83900B0F2E3 /* OptimizedTree.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C1EF89A13FDA83900B0F2E3 /* OptimizedTree.m */; }; 11 | 3C69616C13FAC12600540465 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C69616B13FAC12600540465 /* UIKit.framework */; }; 12 | 3C69616E13FAC12600540465 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C69616D13FAC12600540465 /* Foundation.framework */; }; 13 | 3C69617413FAC12600540465 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3C69617213FAC12600540465 /* InfoPlist.strings */; }; 14 | 3C69617613FAC12600540465 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C69617513FAC12600540465 /* main.m */; }; 15 | 3C69617A13FAC12600540465 /* EEAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C69617913FAC12600540465 /* EEAppDelegate.m */; }; 16 | 3C69618213FAC73200540465 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C69618013FAC73200540465 /* GLKit.framework */; }; 17 | 3C69618313FAC73200540465 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C69618113FAC73200540465 /* OpenGLES.framework */; }; 18 | 3C69618513FAC73700540465 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C69618413FAC73700540465 /* QuartzCore.framework */; }; 19 | 3C69618913FAE0D000540465 /* EEScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C69618813FAE0D000540465 /* EEScene.m */; }; 20 | 3C69619C13FB06EC00540465 /* EESceneController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C69619B13FB06EC00540465 /* EESceneController.m */; }; 21 | 3C7657C213FC19D200D71342 /* EEShape.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C7657C113FC19D200D71342 /* EEShape.m */; }; 22 | 3C7657C913FC220D00D71342 /* EETriangle.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C7657C813FC220D00D71342 /* EETriangle.m */; }; 23 | 3C7657CD13FC26B500D71342 /* TriangleScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C7657CC13FC26B500D71342 /* TriangleScene.m */; }; 24 | 3C7657D013FC352600D71342 /* EERectangle.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C7657CF13FC352600D71342 /* EERectangle.m */; }; 25 | 3C7657D613FC38D900D71342 /* RectangleScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C7657D513FC38D900D71342 /* RectangleScene.m */; }; 26 | 3C7657D913FC480D00D71342 /* EEEllipse.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C7657D813FC480D00D71342 /* EEEllipse.m */; }; 27 | 3C7657DC13FC48B900D71342 /* EllipseScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C7657DB13FC48B900D71342 /* EllipseScene.m */; }; 28 | 3C7657DF13FC4DEA00D71342 /* EERegularPolygon.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C7657DE13FC4DEA00D71342 /* EERegularPolygon.m */; }; 29 | 3C7657E213FC4EB000D71342 /* HexagonScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C7657E113FC4EB000D71342 /* HexagonScene.m */; }; 30 | 3C953B7013FD5A01007803E4 /* landscape.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 3C953B6F13FD5A01007803E4 /* landscape.jpg */; }; 31 | 3C953B7713FD6076007803E4 /* LandscapeScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C953B7613FD6076007803E4 /* LandscapeScene.m */; }; 32 | 3C953B7A13FD6C25007803E4 /* BeachBallScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C953B7913FD6C24007803E4 /* BeachBallScene.m */; }; 33 | 3C953B7C13FD6C52007803E4 /* ball.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 3C953B7B13FD6C52007803E4 /* ball.jpg */; }; 34 | 3C953B7F13FD6E1D007803E4 /* SierpinskyTriangleScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C953B7E13FD6E1C007803E4 /* SierpinskyTriangleScene.m */; }; 35 | 3C953B8313FD6EF1007803E4 /* sierpinksy.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 3C953B8213FD6EF1007803E4 /* sierpinksy.jpg */; }; 36 | 3C953B8613FD7145007803E4 /* EESprite.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C953B8513FD7144007803E4 /* EESprite.m */; }; 37 | 3C953B8913FD7319007803E4 /* SpriteScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C953B8813FD7318007803E4 /* SpriteScene.m */; }; 38 | 3C953B8D13FD775D007803E4 /* boy-sprite.png in Resources */ = {isa = PBXBuildFile; fileRef = 3C953B8C13FD775D007803E4 /* boy-sprite.png */; }; 39 | 3CB9A2AD13FD8D09009288FA /* TreeScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CB9A2AC13FD8D09009288FA /* TreeScene.m */; }; 40 | 3CB9A2B113FDA08A009288FA /* Tree.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CB9A2B013FDA08A009288FA /* Tree.m */; }; 41 | 3CB9A2B413FDA0DC009288FA /* ForestScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CB9A2B313FDA0DC009288FA /* ForestScene.m */; }; 42 | 3CC7185913FEBEAD0051886C /* VelocityScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CC7185813FEBEAD0051886C /* VelocityScene.m */; }; 43 | 3CC7185D13FEC9EC0051886C /* AccelerationScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CC7185C13FEC9EC0051886C /* AccelerationScene.m */; }; 44 | 3CC7186013FECF080051886C /* RotatingTreeScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CC7185F13FECF080051886C /* RotatingTreeScene.m */; }; 45 | 3CC7186413FED7630051886C /* EEAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CC7186313FED7630051886C /* EEAnimation.m */; }; 46 | 3CC7186713FEDF2E0051886C /* ManuallyMovedTree.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CC7186613FEDF2E0051886C /* ManuallyMovedTree.m */; }; 47 | 3CC7186A13FEE61F0051886C /* ComplexAnimationScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CC7186913FEE61E0051886C /* ComplexAnimationScene.m */; }; 48 | 3CC7186D13FEECA60051886C /* PrettyAPIMoveScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CC7186C13FEECA50051886C /* PrettyAPIMoveScene.m */; }; 49 | 3CC7187113FEEE7F0051886C /* ColorChangeScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CC7187013FEEE7F0051886C /* ColorChangeScene.m */; }; 50 | 3CED17921402A90B00678E59 /* EESpriteAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CED17911402A90B00678E59 /* EESpriteAnimation.m */; }; 51 | 3CED17961402AD7F00678E59 /* WalkingAnimationScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CED17951402AD7F00678E59 /* WalkingAnimationScene.m */; }; 52 | 3CED17A11402AE8500678E59 /* alfred1.png in Resources */ = {isa = PBXBuildFile; fileRef = 3CED17981402AE8500678E59 /* alfred1.png */; }; 53 | 3CED17A21402AE8500678E59 /* alfred2.png in Resources */ = {isa = PBXBuildFile; fileRef = 3CED17991402AE8500678E59 /* alfred2.png */; }; 54 | 3CED17A31402AE8500678E59 /* alfred3.png in Resources */ = {isa = PBXBuildFile; fileRef = 3CED179A1402AE8500678E59 /* alfred3.png */; }; 55 | 3CED17A41402AE8500678E59 /* alfred4.png in Resources */ = {isa = PBXBuildFile; fileRef = 3CED179B1402AE8500678E59 /* alfred4.png */; }; 56 | 3CED17A51402AE8500678E59 /* alfred5.png in Resources */ = {isa = PBXBuildFile; fileRef = 3CED179C1402AE8500678E59 /* alfred5.png */; }; 57 | 3CED17A61402AE8500678E59 /* alfred6.png in Resources */ = {isa = PBXBuildFile; fileRef = 3CED179D1402AE8500678E59 /* alfred6.png */; }; 58 | 3CED17A71402AE8500678E59 /* alfred7.png in Resources */ = {isa = PBXBuildFile; fileRef = 3CED179E1402AE8500678E59 /* alfred7.png */; }; 59 | 3CED17A81402AE8500678E59 /* alfred8.png in Resources */ = {isa = PBXBuildFile; fileRef = 3CED179F1402AE8500678E59 /* alfred8.png */; }; 60 | 3CED17A91402AE8500678E59 /* alfred9.png in Resources */ = {isa = PBXBuildFile; fileRef = 3CED17A01402AE8500678E59 /* alfred9.png */; }; 61 | 3CED17AB1402AFC600678E59 /* alfred0.png in Resources */ = {isa = PBXBuildFile; fileRef = 3CED17AA1402AFC600678E59 /* alfred0.png */; }; 62 | /* End PBXBuildFile section */ 63 | 64 | /* Begin PBXFileReference section */ 65 | 3C1EF89913FDA83900B0F2E3 /* OptimizedTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OptimizedTree.h; sourceTree = ""; }; 66 | 3C1EF89A13FDA83900B0F2E3 /* OptimizedTree.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OptimizedTree.m; sourceTree = ""; }; 67 | 3C69616713FAC12600540465 /* ExampleEngine.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ExampleEngine.app; sourceTree = BUILT_PRODUCTS_DIR; }; 68 | 3C69616B13FAC12600540465 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 69 | 3C69616D13FAC12600540465 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 70 | 3C69617113FAC12600540465 /* ExampleEngine-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ExampleEngine-Info.plist"; sourceTree = ""; }; 71 | 3C69617313FAC12600540465 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 72 | 3C69617513FAC12600540465 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 73 | 3C69617713FAC12600540465 /* ExampleEngine-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ExampleEngine-Prefix.pch"; sourceTree = ""; }; 74 | 3C69617813FAC12600540465 /* EEAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EEAppDelegate.h; sourceTree = ""; }; 75 | 3C69617913FAC12600540465 /* EEAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EEAppDelegate.m; sourceTree = ""; }; 76 | 3C69618013FAC73200540465 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; 77 | 3C69618113FAC73200540465 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; 78 | 3C69618413FAC73700540465 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 79 | 3C69618713FAE0D000540465 /* EEScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EEScene.h; sourceTree = ""; }; 80 | 3C69618813FAE0D000540465 /* EEScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EEScene.m; sourceTree = ""; }; 81 | 3C69619A13FB06EC00540465 /* EESceneController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EESceneController.h; sourceTree = ""; }; 82 | 3C69619B13FB06EC00540465 /* EESceneController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EESceneController.m; sourceTree = ""; }; 83 | 3C7657C013FC19D200D71342 /* EEShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EEShape.h; sourceTree = ""; }; 84 | 3C7657C113FC19D200D71342 /* EEShape.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EEShape.m; sourceTree = ""; }; 85 | 3C7657C713FC220D00D71342 /* EETriangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EETriangle.h; sourceTree = ""; }; 86 | 3C7657C813FC220D00D71342 /* EETriangle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EETriangle.m; sourceTree = ""; }; 87 | 3C7657CB13FC26B500D71342 /* TriangleScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TriangleScene.h; sourceTree = ""; }; 88 | 3C7657CC13FC26B500D71342 /* TriangleScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TriangleScene.m; sourceTree = ""; }; 89 | 3C7657CE13FC352600D71342 /* EERectangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EERectangle.h; sourceTree = ""; }; 90 | 3C7657CF13FC352600D71342 /* EERectangle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EERectangle.m; sourceTree = ""; }; 91 | 3C7657D413FC38D900D71342 /* RectangleScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RectangleScene.h; sourceTree = ""; }; 92 | 3C7657D513FC38D900D71342 /* RectangleScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RectangleScene.m; sourceTree = ""; }; 93 | 3C7657D713FC480C00D71342 /* EEEllipse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EEEllipse.h; sourceTree = ""; }; 94 | 3C7657D813FC480D00D71342 /* EEEllipse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EEEllipse.m; sourceTree = ""; }; 95 | 3C7657DA13FC48B900D71342 /* EllipseScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EllipseScene.h; sourceTree = ""; }; 96 | 3C7657DB13FC48B900D71342 /* EllipseScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EllipseScene.m; sourceTree = ""; }; 97 | 3C7657DD13FC4DEA00D71342 /* EERegularPolygon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EERegularPolygon.h; sourceTree = ""; }; 98 | 3C7657DE13FC4DEA00D71342 /* EERegularPolygon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EERegularPolygon.m; sourceTree = ""; }; 99 | 3C7657E013FC4EB000D71342 /* HexagonScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HexagonScene.h; sourceTree = ""; }; 100 | 3C7657E113FC4EB000D71342 /* HexagonScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HexagonScene.m; sourceTree = ""; }; 101 | 3C953B6F13FD5A01007803E4 /* landscape.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = landscape.jpg; sourceTree = ""; }; 102 | 3C953B7513FD6076007803E4 /* LandscapeScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LandscapeScene.h; sourceTree = ""; }; 103 | 3C953B7613FD6076007803E4 /* LandscapeScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LandscapeScene.m; sourceTree = ""; }; 104 | 3C953B7813FD6C24007803E4 /* BeachBallScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BeachBallScene.h; sourceTree = ""; }; 105 | 3C953B7913FD6C24007803E4 /* BeachBallScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BeachBallScene.m; sourceTree = ""; }; 106 | 3C953B7B13FD6C52007803E4 /* ball.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = ball.jpg; sourceTree = ""; }; 107 | 3C953B7D13FD6E1C007803E4 /* SierpinskyTriangleScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SierpinskyTriangleScene.h; sourceTree = ""; }; 108 | 3C953B7E13FD6E1C007803E4 /* SierpinskyTriangleScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SierpinskyTriangleScene.m; sourceTree = ""; }; 109 | 3C953B8213FD6EF1007803E4 /* sierpinksy.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = sierpinksy.jpg; sourceTree = ""; }; 110 | 3C953B8413FD7144007803E4 /* EESprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EESprite.h; sourceTree = ""; }; 111 | 3C953B8513FD7144007803E4 /* EESprite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EESprite.m; sourceTree = ""; }; 112 | 3C953B8713FD7317007803E4 /* SpriteScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpriteScene.h; sourceTree = ""; }; 113 | 3C953B8813FD7318007803E4 /* SpriteScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SpriteScene.m; sourceTree = ""; }; 114 | 3C953B8C13FD775D007803E4 /* boy-sprite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "boy-sprite.png"; sourceTree = ""; }; 115 | 3CB9A2AB13FD8D09009288FA /* TreeScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TreeScene.h; sourceTree = ""; }; 116 | 3CB9A2AC13FD8D09009288FA /* TreeScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TreeScene.m; sourceTree = ""; }; 117 | 3CB9A2AF13FDA08A009288FA /* Tree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tree.h; sourceTree = ""; }; 118 | 3CB9A2B013FDA08A009288FA /* Tree.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Tree.m; sourceTree = ""; }; 119 | 3CB9A2B213FDA0DC009288FA /* ForestScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ForestScene.h; sourceTree = ""; }; 120 | 3CB9A2B313FDA0DC009288FA /* ForestScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ForestScene.m; sourceTree = ""; }; 121 | 3CC7185713FEBEAD0051886C /* VelocityScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VelocityScene.h; sourceTree = ""; }; 122 | 3CC7185813FEBEAD0051886C /* VelocityScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VelocityScene.m; sourceTree = ""; }; 123 | 3CC7185B13FEC9EB0051886C /* AccelerationScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccelerationScene.h; sourceTree = ""; }; 124 | 3CC7185C13FEC9EC0051886C /* AccelerationScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AccelerationScene.m; sourceTree = ""; }; 125 | 3CC7185E13FECF080051886C /* RotatingTreeScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RotatingTreeScene.h; sourceTree = ""; }; 126 | 3CC7185F13FECF080051886C /* RotatingTreeScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RotatingTreeScene.m; sourceTree = ""; }; 127 | 3CC7186213FED7630051886C /* EEAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EEAnimation.h; sourceTree = ""; }; 128 | 3CC7186313FED7630051886C /* EEAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EEAnimation.m; sourceTree = ""; }; 129 | 3CC7186513FEDF2D0051886C /* ManuallyMovedTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ManuallyMovedTree.h; sourceTree = ""; }; 130 | 3CC7186613FEDF2E0051886C /* ManuallyMovedTree.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ManuallyMovedTree.m; sourceTree = ""; }; 131 | 3CC7186813FEE61E0051886C /* ComplexAnimationScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ComplexAnimationScene.h; sourceTree = ""; }; 132 | 3CC7186913FEE61E0051886C /* ComplexAnimationScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ComplexAnimationScene.m; sourceTree = ""; }; 133 | 3CC7186B13FEECA50051886C /* PrettyAPIMoveScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrettyAPIMoveScene.h; sourceTree = ""; }; 134 | 3CC7186C13FEECA50051886C /* PrettyAPIMoveScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PrettyAPIMoveScene.m; sourceTree = ""; }; 135 | 3CC7186F13FEEE7E0051886C /* ColorChangeScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorChangeScene.h; sourceTree = ""; }; 136 | 3CC7187013FEEE7F0051886C /* ColorChangeScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ColorChangeScene.m; sourceTree = ""; }; 137 | 3CED17901402A90B00678E59 /* EESpriteAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EESpriteAnimation.h; sourceTree = ""; }; 138 | 3CED17911402A90B00678E59 /* EESpriteAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EESpriteAnimation.m; sourceTree = ""; }; 139 | 3CED17941402AD7F00678E59 /* WalkingAnimationScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WalkingAnimationScene.h; sourceTree = ""; }; 140 | 3CED17951402AD7F00678E59 /* WalkingAnimationScene.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WalkingAnimationScene.m; sourceTree = ""; }; 141 | 3CED17981402AE8500678E59 /* alfred1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = alfred1.png; path = "sprite animation/alfred1.png"; sourceTree = ""; }; 142 | 3CED17991402AE8500678E59 /* alfred2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = alfred2.png; path = "sprite animation/alfred2.png"; sourceTree = ""; }; 143 | 3CED179A1402AE8500678E59 /* alfred3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = alfred3.png; path = "sprite animation/alfred3.png"; sourceTree = ""; }; 144 | 3CED179B1402AE8500678E59 /* alfred4.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = alfred4.png; path = "sprite animation/alfred4.png"; sourceTree = ""; }; 145 | 3CED179C1402AE8500678E59 /* alfred5.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = alfred5.png; path = "sprite animation/alfred5.png"; sourceTree = ""; }; 146 | 3CED179D1402AE8500678E59 /* alfred6.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = alfred6.png; path = "sprite animation/alfred6.png"; sourceTree = ""; }; 147 | 3CED179E1402AE8500678E59 /* alfred7.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = alfred7.png; path = "sprite animation/alfred7.png"; sourceTree = ""; }; 148 | 3CED179F1402AE8500678E59 /* alfred8.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = alfred8.png; path = "sprite animation/alfred8.png"; sourceTree = ""; }; 149 | 3CED17A01402AE8500678E59 /* alfred9.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = alfred9.png; path = "sprite animation/alfred9.png"; sourceTree = ""; }; 150 | 3CED17AA1402AFC600678E59 /* alfred0.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = alfred0.png; path = "sprite animation/alfred0.png"; sourceTree = ""; }; 151 | /* End PBXFileReference section */ 152 | 153 | /* Begin PBXFrameworksBuildPhase section */ 154 | 3C69616413FAC12600540465 /* Frameworks */ = { 155 | isa = PBXFrameworksBuildPhase; 156 | buildActionMask = 2147483647; 157 | files = ( 158 | 3C69618513FAC73700540465 /* QuartzCore.framework in Frameworks */, 159 | 3C69618213FAC73200540465 /* GLKit.framework in Frameworks */, 160 | 3C69618313FAC73200540465 /* OpenGLES.framework in Frameworks */, 161 | 3C69616C13FAC12600540465 /* UIKit.framework in Frameworks */, 162 | 3C69616E13FAC12600540465 /* Foundation.framework in Frameworks */, 163 | ); 164 | runOnlyForDeploymentPostprocessing = 0; 165 | }; 166 | /* End PBXFrameworksBuildPhase section */ 167 | 168 | /* Begin PBXGroup section */ 169 | 3C69615C13FAC12600540465 = { 170 | isa = PBXGroup; 171 | children = ( 172 | 3C69616F13FAC12600540465 /* ExampleEngine */, 173 | 3C69616A13FAC12600540465 /* Frameworks */, 174 | 3C69616813FAC12600540465 /* Products */, 175 | ); 176 | sourceTree = ""; 177 | wrapsLines = 0; 178 | }; 179 | 3C69616813FAC12600540465 /* Products */ = { 180 | isa = PBXGroup; 181 | children = ( 182 | 3C69616713FAC12600540465 /* ExampleEngine.app */, 183 | ); 184 | name = Products; 185 | sourceTree = ""; 186 | }; 187 | 3C69616A13FAC12600540465 /* Frameworks */ = { 188 | isa = PBXGroup; 189 | children = ( 190 | 3C69618413FAC73700540465 /* QuartzCore.framework */, 191 | 3C69618013FAC73200540465 /* GLKit.framework */, 192 | 3C69618113FAC73200540465 /* OpenGLES.framework */, 193 | 3C69616B13FAC12600540465 /* UIKit.framework */, 194 | 3C69616D13FAC12600540465 /* Foundation.framework */, 195 | ); 196 | name = Frameworks; 197 | sourceTree = ""; 198 | }; 199 | 3C69616F13FAC12600540465 /* ExampleEngine */ = { 200 | isa = PBXGroup; 201 | children = ( 202 | 3C69618613FADEF800540465 /* Scenes */, 203 | 3C7657BE13FC19C300D71342 /* Shapes */, 204 | 3CC7186113FED7520051886C /* Animations */, 205 | 3C7657CA13FC26A100D71342 /* Example Game Code */, 206 | 3C953B6D13FD596F007803E4 /* Textures */, 207 | 3C69617813FAC12600540465 /* EEAppDelegate.h */, 208 | 3C69617913FAC12600540465 /* EEAppDelegate.m */, 209 | 3C69617013FAC12600540465 /* Supporting Files */, 210 | ); 211 | path = ExampleEngine; 212 | sourceTree = ""; 213 | }; 214 | 3C69617013FAC12600540465 /* Supporting Files */ = { 215 | isa = PBXGroup; 216 | children = ( 217 | 3C69617113FAC12600540465 /* ExampleEngine-Info.plist */, 218 | 3C69617213FAC12600540465 /* InfoPlist.strings */, 219 | 3C69617513FAC12600540465 /* main.m */, 220 | 3C69617713FAC12600540465 /* ExampleEngine-Prefix.pch */, 221 | ); 222 | name = "Supporting Files"; 223 | sourceTree = ""; 224 | }; 225 | 3C69618613FADEF800540465 /* Scenes */ = { 226 | isa = PBXGroup; 227 | children = ( 228 | 3C69619A13FB06EC00540465 /* EESceneController.h */, 229 | 3C69619B13FB06EC00540465 /* EESceneController.m */, 230 | 3C69618713FAE0D000540465 /* EEScene.h */, 231 | 3C69618813FAE0D000540465 /* EEScene.m */, 232 | ); 233 | name = Scenes; 234 | sourceTree = ""; 235 | }; 236 | 3C7657BE13FC19C300D71342 /* Shapes */ = { 237 | isa = PBXGroup; 238 | children = ( 239 | 3C7657C013FC19D200D71342 /* EEShape.h */, 240 | 3C7657C113FC19D200D71342 /* EEShape.m */, 241 | 3C7657C713FC220D00D71342 /* EETriangle.h */, 242 | 3C7657C813FC220D00D71342 /* EETriangle.m */, 243 | 3C7657CE13FC352600D71342 /* EERectangle.h */, 244 | 3C7657CF13FC352600D71342 /* EERectangle.m */, 245 | 3C7657D713FC480C00D71342 /* EEEllipse.h */, 246 | 3C7657D813FC480D00D71342 /* EEEllipse.m */, 247 | 3C7657DD13FC4DEA00D71342 /* EERegularPolygon.h */, 248 | 3C7657DE13FC4DEA00D71342 /* EERegularPolygon.m */, 249 | 3C953B8413FD7144007803E4 /* EESprite.h */, 250 | 3C953B8513FD7144007803E4 /* EESprite.m */, 251 | ); 252 | name = Shapes; 253 | sourceTree = ""; 254 | }; 255 | 3C7657CA13FC26A100D71342 /* Example Game Code */ = { 256 | isa = PBXGroup; 257 | children = ( 258 | 3C7657CB13FC26B500D71342 /* TriangleScene.h */, 259 | 3C7657CC13FC26B500D71342 /* TriangleScene.m */, 260 | 3C7657D413FC38D900D71342 /* RectangleScene.h */, 261 | 3C7657D513FC38D900D71342 /* RectangleScene.m */, 262 | 3C7657DA13FC48B900D71342 /* EllipseScene.h */, 263 | 3C7657DB13FC48B900D71342 /* EllipseScene.m */, 264 | 3C7657E013FC4EB000D71342 /* HexagonScene.h */, 265 | 3C7657E113FC4EB000D71342 /* HexagonScene.m */, 266 | 3C953B7513FD6076007803E4 /* LandscapeScene.h */, 267 | 3C953B7613FD6076007803E4 /* LandscapeScene.m */, 268 | 3C953B7813FD6C24007803E4 /* BeachBallScene.h */, 269 | 3C953B7913FD6C24007803E4 /* BeachBallScene.m */, 270 | 3C953B7D13FD6E1C007803E4 /* SierpinskyTriangleScene.h */, 271 | 3C953B7E13FD6E1C007803E4 /* SierpinskyTriangleScene.m */, 272 | 3C953B8713FD7317007803E4 /* SpriteScene.h */, 273 | 3C953B8813FD7318007803E4 /* SpriteScene.m */, 274 | 3CB9A2AB13FD8D09009288FA /* TreeScene.h */, 275 | 3CB9A2AC13FD8D09009288FA /* TreeScene.m */, 276 | 3CB9A2AF13FDA08A009288FA /* Tree.h */, 277 | 3CB9A2B013FDA08A009288FA /* Tree.m */, 278 | 3CB9A2B213FDA0DC009288FA /* ForestScene.h */, 279 | 3CB9A2B313FDA0DC009288FA /* ForestScene.m */, 280 | 3C1EF89913FDA83900B0F2E3 /* OptimizedTree.h */, 281 | 3C1EF89A13FDA83900B0F2E3 /* OptimizedTree.m */, 282 | 3CC7185713FEBEAD0051886C /* VelocityScene.h */, 283 | 3CC7185813FEBEAD0051886C /* VelocityScene.m */, 284 | 3CC7185B13FEC9EB0051886C /* AccelerationScene.h */, 285 | 3CC7185C13FEC9EC0051886C /* AccelerationScene.m */, 286 | 3CC7185E13FECF080051886C /* RotatingTreeScene.h */, 287 | 3CC7185F13FECF080051886C /* RotatingTreeScene.m */, 288 | 3CC7186513FEDF2D0051886C /* ManuallyMovedTree.h */, 289 | 3CC7186613FEDF2E0051886C /* ManuallyMovedTree.m */, 290 | 3CC7186813FEE61E0051886C /* ComplexAnimationScene.h */, 291 | 3CC7186913FEE61E0051886C /* ComplexAnimationScene.m */, 292 | 3CC7186B13FEECA50051886C /* PrettyAPIMoveScene.h */, 293 | 3CC7186C13FEECA50051886C /* PrettyAPIMoveScene.m */, 294 | 3CC7186F13FEEE7E0051886C /* ColorChangeScene.h */, 295 | 3CC7187013FEEE7F0051886C /* ColorChangeScene.m */, 296 | 3CED17941402AD7F00678E59 /* WalkingAnimationScene.h */, 297 | 3CED17951402AD7F00678E59 /* WalkingAnimationScene.m */, 298 | ); 299 | name = "Example Game Code"; 300 | sourceTree = ""; 301 | }; 302 | 3C953B6D13FD596F007803E4 /* Textures */ = { 303 | isa = PBXGroup; 304 | children = ( 305 | 3CED17971402AE7700678E59 /* Walking Sprite */, 306 | 3C953B8C13FD775D007803E4 /* boy-sprite.png */, 307 | 3C953B8213FD6EF1007803E4 /* sierpinksy.jpg */, 308 | 3C953B7B13FD6C52007803E4 /* ball.jpg */, 309 | 3C953B6F13FD5A01007803E4 /* landscape.jpg */, 310 | ); 311 | name = Textures; 312 | sourceTree = ""; 313 | }; 314 | 3CC7186113FED7520051886C /* Animations */ = { 315 | isa = PBXGroup; 316 | children = ( 317 | 3CC7186213FED7630051886C /* EEAnimation.h */, 318 | 3CC7186313FED7630051886C /* EEAnimation.m */, 319 | 3CED17901402A90B00678E59 /* EESpriteAnimation.h */, 320 | 3CED17911402A90B00678E59 /* EESpriteAnimation.m */, 321 | ); 322 | name = Animations; 323 | sourceTree = ""; 324 | }; 325 | 3CED17971402AE7700678E59 /* Walking Sprite */ = { 326 | isa = PBXGroup; 327 | children = ( 328 | 3CED17AA1402AFC600678E59 /* alfred0.png */, 329 | 3CED17981402AE8500678E59 /* alfred1.png */, 330 | 3CED17991402AE8500678E59 /* alfred2.png */, 331 | 3CED179A1402AE8500678E59 /* alfred3.png */, 332 | 3CED179B1402AE8500678E59 /* alfred4.png */, 333 | 3CED179C1402AE8500678E59 /* alfred5.png */, 334 | 3CED179D1402AE8500678E59 /* alfred6.png */, 335 | 3CED179E1402AE8500678E59 /* alfred7.png */, 336 | 3CED179F1402AE8500678E59 /* alfred8.png */, 337 | 3CED17A01402AE8500678E59 /* alfred9.png */, 338 | ); 339 | name = "Walking Sprite"; 340 | sourceTree = ""; 341 | }; 342 | /* End PBXGroup section */ 343 | 344 | /* Begin PBXNativeTarget section */ 345 | 3C69616613FAC12600540465 /* ExampleEngine */ = { 346 | isa = PBXNativeTarget; 347 | buildConfigurationList = 3C69617D13FAC12600540465 /* Build configuration list for PBXNativeTarget "ExampleEngine" */; 348 | buildPhases = ( 349 | 3C69616313FAC12600540465 /* Sources */, 350 | 3C69616413FAC12600540465 /* Frameworks */, 351 | 3C69616513FAC12600540465 /* Resources */, 352 | ); 353 | buildRules = ( 354 | ); 355 | dependencies = ( 356 | ); 357 | name = ExampleEngine; 358 | productName = ExampleEngine; 359 | productReference = 3C69616713FAC12600540465 /* ExampleEngine.app */; 360 | productType = "com.apple.product-type.application"; 361 | }; 362 | /* End PBXNativeTarget section */ 363 | 364 | /* Begin PBXProject section */ 365 | 3C69615E13FAC12600540465 /* Project object */ = { 366 | isa = PBXProject; 367 | attributes = { 368 | LastUpgradeCheck = 0420; 369 | ORGANIZATIONNAME = "Ian Terrell"; 370 | }; 371 | buildConfigurationList = 3C69616113FAC12600540465 /* Build configuration list for PBXProject "ExampleEngine" */; 372 | compatibilityVersion = "Xcode 3.2"; 373 | developmentRegion = English; 374 | hasScannedForEncodings = 0; 375 | knownRegions = ( 376 | en, 377 | ); 378 | mainGroup = 3C69615C13FAC12600540465; 379 | productRefGroup = 3C69616813FAC12600540465 /* Products */; 380 | projectDirPath = ""; 381 | projectRoot = ""; 382 | targets = ( 383 | 3C69616613FAC12600540465 /* ExampleEngine */, 384 | ); 385 | }; 386 | /* End PBXProject section */ 387 | 388 | /* Begin PBXResourcesBuildPhase section */ 389 | 3C69616513FAC12600540465 /* Resources */ = { 390 | isa = PBXResourcesBuildPhase; 391 | buildActionMask = 2147483647; 392 | files = ( 393 | 3C69617413FAC12600540465 /* InfoPlist.strings in Resources */, 394 | 3C953B7013FD5A01007803E4 /* landscape.jpg in Resources */, 395 | 3C953B7C13FD6C52007803E4 /* ball.jpg in Resources */, 396 | 3C953B8313FD6EF1007803E4 /* sierpinksy.jpg in Resources */, 397 | 3C953B8D13FD775D007803E4 /* boy-sprite.png in Resources */, 398 | 3CED17A11402AE8500678E59 /* alfred1.png in Resources */, 399 | 3CED17A21402AE8500678E59 /* alfred2.png in Resources */, 400 | 3CED17A31402AE8500678E59 /* alfred3.png in Resources */, 401 | 3CED17A41402AE8500678E59 /* alfred4.png in Resources */, 402 | 3CED17A51402AE8500678E59 /* alfred5.png in Resources */, 403 | 3CED17A61402AE8500678E59 /* alfred6.png in Resources */, 404 | 3CED17A71402AE8500678E59 /* alfred7.png in Resources */, 405 | 3CED17A81402AE8500678E59 /* alfred8.png in Resources */, 406 | 3CED17A91402AE8500678E59 /* alfred9.png in Resources */, 407 | 3CED17AB1402AFC600678E59 /* alfred0.png in Resources */, 408 | ); 409 | runOnlyForDeploymentPostprocessing = 0; 410 | }; 411 | /* End PBXResourcesBuildPhase section */ 412 | 413 | /* Begin PBXSourcesBuildPhase section */ 414 | 3C69616313FAC12600540465 /* Sources */ = { 415 | isa = PBXSourcesBuildPhase; 416 | buildActionMask = 2147483647; 417 | files = ( 418 | 3C69617613FAC12600540465 /* main.m in Sources */, 419 | 3C69617A13FAC12600540465 /* EEAppDelegate.m in Sources */, 420 | 3C69618913FAE0D000540465 /* EEScene.m in Sources */, 421 | 3C69619C13FB06EC00540465 /* EESceneController.m in Sources */, 422 | 3C7657C213FC19D200D71342 /* EEShape.m in Sources */, 423 | 3C7657C913FC220D00D71342 /* EETriangle.m in Sources */, 424 | 3C7657CD13FC26B500D71342 /* TriangleScene.m in Sources */, 425 | 3C7657D013FC352600D71342 /* EERectangle.m in Sources */, 426 | 3C7657D613FC38D900D71342 /* RectangleScene.m in Sources */, 427 | 3C7657D913FC480D00D71342 /* EEEllipse.m in Sources */, 428 | 3C7657DC13FC48B900D71342 /* EllipseScene.m in Sources */, 429 | 3C7657DF13FC4DEA00D71342 /* EERegularPolygon.m in Sources */, 430 | 3C7657E213FC4EB000D71342 /* HexagonScene.m in Sources */, 431 | 3C953B7713FD6076007803E4 /* LandscapeScene.m in Sources */, 432 | 3C953B7A13FD6C25007803E4 /* BeachBallScene.m in Sources */, 433 | 3C953B7F13FD6E1D007803E4 /* SierpinskyTriangleScene.m in Sources */, 434 | 3C953B8613FD7145007803E4 /* EESprite.m in Sources */, 435 | 3C953B8913FD7319007803E4 /* SpriteScene.m in Sources */, 436 | 3CB9A2AD13FD8D09009288FA /* TreeScene.m in Sources */, 437 | 3CB9A2B113FDA08A009288FA /* Tree.m in Sources */, 438 | 3CB9A2B413FDA0DC009288FA /* ForestScene.m in Sources */, 439 | 3C1EF89B13FDA83900B0F2E3 /* OptimizedTree.m in Sources */, 440 | 3CC7185913FEBEAD0051886C /* VelocityScene.m in Sources */, 441 | 3CC7185D13FEC9EC0051886C /* AccelerationScene.m in Sources */, 442 | 3CC7186013FECF080051886C /* RotatingTreeScene.m in Sources */, 443 | 3CC7186413FED7630051886C /* EEAnimation.m in Sources */, 444 | 3CC7186713FEDF2E0051886C /* ManuallyMovedTree.m in Sources */, 445 | 3CC7186A13FEE61F0051886C /* ComplexAnimationScene.m in Sources */, 446 | 3CC7186D13FEECA60051886C /* PrettyAPIMoveScene.m in Sources */, 447 | 3CC7187113FEEE7F0051886C /* ColorChangeScene.m in Sources */, 448 | 3CED17921402A90B00678E59 /* EESpriteAnimation.m in Sources */, 449 | 3CED17961402AD7F00678E59 /* WalkingAnimationScene.m in Sources */, 450 | ); 451 | runOnlyForDeploymentPostprocessing = 0; 452 | }; 453 | /* End PBXSourcesBuildPhase section */ 454 | 455 | /* Begin PBXVariantGroup section */ 456 | 3C69617213FAC12600540465 /* InfoPlist.strings */ = { 457 | isa = PBXVariantGroup; 458 | children = ( 459 | 3C69617313FAC12600540465 /* en */, 460 | ); 461 | name = InfoPlist.strings; 462 | sourceTree = ""; 463 | }; 464 | /* End PBXVariantGroup section */ 465 | 466 | /* Begin XCBuildConfiguration section */ 467 | 3C69617B13FAC12600540465 /* Debug */ = { 468 | isa = XCBuildConfiguration; 469 | buildSettings = { 470 | ALWAYS_SEARCH_USER_PATHS = NO; 471 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 472 | CLANG_ENABLE_OBJC_ARC = YES; 473 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 474 | COPY_PHASE_STRIP = NO; 475 | GCC_C_LANGUAGE_STANDARD = gnu99; 476 | GCC_DYNAMIC_NO_PIC = NO; 477 | GCC_OPTIMIZATION_LEVEL = 0; 478 | GCC_PREPROCESSOR_DEFINITIONS = ( 479 | "DEBUG=1", 480 | "$(inherited)", 481 | ); 482 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 483 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 484 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 485 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 486 | GCC_WARN_UNUSED_VARIABLE = YES; 487 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 488 | SDKROOT = iphoneos; 489 | TARGETED_DEVICE_FAMILY = "1,2"; 490 | }; 491 | name = Debug; 492 | }; 493 | 3C69617C13FAC12600540465 /* Release */ = { 494 | isa = XCBuildConfiguration; 495 | buildSettings = { 496 | ALWAYS_SEARCH_USER_PATHS = NO; 497 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 498 | CLANG_ENABLE_OBJC_ARC = YES; 499 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 500 | COPY_PHASE_STRIP = YES; 501 | GCC_C_LANGUAGE_STANDARD = gnu99; 502 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 503 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 504 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 505 | GCC_WARN_UNUSED_VARIABLE = YES; 506 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 507 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 508 | SDKROOT = iphoneos; 509 | TARGETED_DEVICE_FAMILY = "1,2"; 510 | VALIDATE_PRODUCT = YES; 511 | }; 512 | name = Release; 513 | }; 514 | 3C69617E13FAC12600540465 /* Debug */ = { 515 | isa = XCBuildConfiguration; 516 | buildSettings = { 517 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 518 | GCC_PREFIX_HEADER = "ExampleEngine/ExampleEngine-Prefix.pch"; 519 | INFOPLIST_FILE = "ExampleEngine/ExampleEngine-Info.plist"; 520 | PRODUCT_NAME = "$(TARGET_NAME)"; 521 | WRAPPER_EXTENSION = app; 522 | }; 523 | name = Debug; 524 | }; 525 | 3C69617F13FAC12600540465 /* Release */ = { 526 | isa = XCBuildConfiguration; 527 | buildSettings = { 528 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 529 | GCC_PREFIX_HEADER = "ExampleEngine/ExampleEngine-Prefix.pch"; 530 | INFOPLIST_FILE = "ExampleEngine/ExampleEngine-Info.plist"; 531 | PRODUCT_NAME = "$(TARGET_NAME)"; 532 | WRAPPER_EXTENSION = app; 533 | }; 534 | name = Release; 535 | }; 536 | /* End XCBuildConfiguration section */ 537 | 538 | /* Begin XCConfigurationList section */ 539 | 3C69616113FAC12600540465 /* Build configuration list for PBXProject "ExampleEngine" */ = { 540 | isa = XCConfigurationList; 541 | buildConfigurations = ( 542 | 3C69617B13FAC12600540465 /* Debug */, 543 | 3C69617C13FAC12600540465 /* Release */, 544 | ); 545 | defaultConfigurationIsVisible = 0; 546 | defaultConfigurationName = Release; 547 | }; 548 | 3C69617D13FAC12600540465 /* Build configuration list for PBXNativeTarget "ExampleEngine" */ = { 549 | isa = XCConfigurationList; 550 | buildConfigurations = ( 551 | 3C69617E13FAC12600540465 /* Debug */, 552 | 3C69617F13FAC12600540465 /* Release */, 553 | ); 554 | defaultConfigurationIsVisible = 0; 555 | defaultConfigurationName = Release; 556 | }; 557 | /* End XCConfigurationList section */ 558 | }; 559 | rootObject = 3C69615E13FAC12600540465 /* Project object */; 560 | } 561 | -------------------------------------------------------------------------------- /ExampleEngine/AccelerationScene.h: -------------------------------------------------------------------------------- 1 | // 2 | // AccelerationScene.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/19/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEScene.h" 10 | 11 | @interface AccelerationScene : EEScene 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ExampleEngine/AccelerationScene.m: -------------------------------------------------------------------------------- 1 | // 2 | // AccelerationScene.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/19/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "AccelerationScene.h" 10 | #import "EEEllipse.h" 11 | 12 | @implementation AccelerationScene 13 | 14 | -(id)init { 15 | self = [super init]; 16 | if (self) { 17 | EEEllipse *ball = [[EEEllipse alloc] init]; 18 | ball.radiusX = 0.2; 19 | ball.radiusY = 0.2; 20 | ball.color = GLKVector4Make(1, 0, 0, 1); 21 | ball.position = GLKVector2Make(-3,-2); 22 | ball.velocity = GLKVector2Make(1,2.5); 23 | ball.acceleration = GLKVector2Make(0,-1); 24 | 25 | [self.shapes addObject:ball]; 26 | } 27 | return self; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /ExampleEngine/BeachBallScene.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeachBallScene.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/18/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEScene.h" 10 | #import "EEEllipse.h" 11 | 12 | @interface BeachBallScene : EEScene { 13 | EEEllipse *ellipse; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ExampleEngine/BeachBallScene.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeachBallScene.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/18/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "BeachBallScene.h" 10 | 11 | @implementation BeachBallScene 12 | 13 | -(id)init { 14 | self = [super init]; 15 | if (self) { 16 | ellipse = [[EEEllipse alloc] init]; 17 | ellipse.radiusX = 1; 18 | ellipse.radiusY = 1; 19 | 20 | [ellipse setTextureImage:[UIImage imageNamed:@"ball.jpg"]]; 21 | float textureBallRadius = 0.5; 22 | float textureCenterOffset = 0.5; 23 | for (int i = 0; i < ellipse.numVertices; i++){ 24 | float theta = ((float)i) / ellipse.numVertices * M_TAU; 25 | ellipse.textureCoordinates[i] = GLKVector2Make(textureCenterOffset+cos(theta)*textureBallRadius, 26 | textureCenterOffset+sin(theta)*textureBallRadius); 27 | } 28 | } 29 | return self; 30 | } 31 | 32 | -(void)render { 33 | [super render]; 34 | [ellipse renderInScene:self]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /ExampleEngine/ColorChangeScene.h: -------------------------------------------------------------------------------- 1 | // 2 | // ColorChangeScene.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/19/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEScene.h" 10 | 11 | @interface ColorChangeScene : EEScene 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ExampleEngine/ColorChangeScene.m: -------------------------------------------------------------------------------- 1 | // 2 | // ColorChangeScene.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/19/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "ColorChangeScene.h" 10 | #import "EEEllipse.h" 11 | 12 | @implementation ColorChangeScene 13 | 14 | -(id)init { 15 | self = [super init]; 16 | if (self) { 17 | EEEllipse *ball = [[EEEllipse alloc] init]; 18 | ball.radiusX = 1; 19 | ball.radiusY = 1; 20 | ball.color = GLKVector4Make(0.9, 0.1, 0.1, 1); 21 | [ball animateWithDuration:3 animations:^() { 22 | ball.color = GLKVector4Make(0, 0.4, 0.9, 1); 23 | }]; 24 | [self.shapes addObject:ball]; 25 | } 26 | return self; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /ExampleEngine/ComplexAnimationScene.h: -------------------------------------------------------------------------------- 1 | // 2 | // ComplexAnimationScene.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/19/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEScene.h" 10 | 11 | @interface ComplexAnimationScene : EEScene 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ExampleEngine/ComplexAnimationScene.m: -------------------------------------------------------------------------------- 1 | // 2 | // ComplexAnimationScene.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/19/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "ComplexAnimationScene.h" 10 | #import "EERectangle.h" 11 | #import "EEAnimation.h" 12 | 13 | @implementation ComplexAnimationScene 14 | 15 | -(id)init { 16 | self = [super init]; 17 | if (self) { 18 | EERectangle *rectangle = [[EERectangle alloc] init]; 19 | rectangle.position = GLKVector2Make(-1, -1); 20 | rectangle.width = 2; 21 | rectangle.height = 1; 22 | rectangle.scale = GLKVector2Make(0.5, 1); 23 | rectangle.color = GLKVector4Make(1, 0, 0, 0); 24 | 25 | EEAnimation *complexAnimation = [[EEAnimation alloc] init]; 26 | complexAnimation.positionDelta = GLKVector2Make(2, 2); 27 | complexAnimation.scaleDelta = GLKVector2Make(1, -0.5); 28 | complexAnimation.rotationDelta = M_TAU; 29 | complexAnimation.colorDelta = GLKVector4Make(0, 0, 0, 1); 30 | complexAnimation.duration = 3; 31 | [rectangle.animations addObject:complexAnimation]; 32 | 33 | EEAnimation *secondAnimation = [[EEAnimation alloc] init]; 34 | secondAnimation.positionDelta = GLKVector2Make(-1,-1); 35 | secondAnimation.rotationDelta = M_TAU; 36 | secondAnimation.colorDelta = GLKVector4Make(0, 1, 0, 0); 37 | secondAnimation.duration = 2; 38 | [rectangle.animations addObject:secondAnimation]; 39 | 40 | [self.shapes addObject:rectangle]; 41 | } 42 | return self; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /ExampleEngine/EEAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // EEAnimation.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/19/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | #import "EEShape.h" 13 | 14 | @interface EEAnimation : NSObject { 15 | NSTimeInterval duration, elapsedTime; 16 | GLKVector2 positionDelta, scaleDelta; 17 | float rotationDelta; 18 | GLKVector4 colorDelta; 19 | } 20 | 21 | @property NSTimeInterval duration; 22 | @property(readonly) NSTimeInterval elapsedTime; 23 | @property GLKVector2 positionDelta, scaleDelta; 24 | @property float rotationDelta; 25 | @property GLKVector4 colorDelta; 26 | 27 | -(void)animateShape:(EEShape *)shape dt:(NSTimeInterval)dt; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /ExampleEngine/EEAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // EEAnimation.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/19/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEAnimation.h" 10 | 11 | @implementation EEAnimation 12 | 13 | @synthesize duration, elapsedTime, positionDelta, rotationDelta, scaleDelta, colorDelta; 14 | 15 | -(id)init { 16 | self = [super init]; 17 | if (self) { 18 | elapsedTime = 0; 19 | duration = 0; 20 | positionDelta = GLKVector2Make(0,0); 21 | rotationDelta = 0; 22 | scaleDelta = GLKVector2Make(0,0); 23 | colorDelta = GLKVector4Make(0,0,0,0); 24 | } 25 | return self; 26 | } 27 | 28 | -(void)animateShape:(EEShape *)shape dt:(NSTimeInterval)dt { 29 | elapsedTime += dt; 30 | 31 | if (elapsedTime > duration) 32 | dt -= elapsedTime - duration; 33 | 34 | float fractionOfDuration = dt/duration; 35 | 36 | GLKVector2 positionIncrement = GLKVector2MultiplyScalar(positionDelta, fractionOfDuration); 37 | shape.position = GLKVector2Add(shape.position, positionIncrement); 38 | 39 | GLKVector4 colorIncrement = GLKVector4MultiplyScalar(colorDelta, fractionOfDuration); 40 | shape.color = GLKVector4Add(shape.color, colorIncrement); 41 | 42 | GLKVector2 scaleIncrement = GLKVector2MultiplyScalar(scaleDelta, fractionOfDuration); 43 | shape.scale = GLKVector2Add(shape.scale, scaleIncrement); 44 | 45 | shape.rotation += rotationDelta * fractionOfDuration; 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /ExampleEngine/EEAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // EEAppDelegate.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/16/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "EEScene.h" 12 | 13 | @interface EEAppDelegate : UIResponder { 14 | EEScene *scene; 15 | } 16 | 17 | @property (strong, nonatomic) UIWindow *window; 18 | 19 | - (void) nextScene:(id) sender; 20 | @end 21 | -------------------------------------------------------------------------------- /ExampleEngine/EEAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // EEAppDelegate.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/16/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEAppDelegate.h" 10 | #import "EESceneController.h" 11 | #import "WalkingAnimationScene.h" 12 | #import "BeachBallScene.h" 13 | #import "PrettyAPIMoveScene.h" 14 | #import "AccelerationScene.h" 15 | #import "ColorChangeScene.h" 16 | #import "ComplexAnimationScene.h" 17 | #import "ForestScene.h" 18 | #import "HexagonScene.h" 19 | #import "LandscapeScene.h" 20 | #import "ManuallyMovedTree.h" 21 | #import "OptimizedTree.h" 22 | #import "PrettyAPIMoveScene.h" 23 | #import "RectangleScene.h" 24 | #import "RotatingTreeScene.h" 25 | #import "SierpinskyTriangleScene.h" 26 | #import "SpriteScene.h" 27 | #import "TreeScene.h" 28 | #import "TriangleScene.h" 29 | #import "VelocityScene.h" 30 | 31 | 32 | @implementation EEAppDelegate 33 | 34 | @synthesize window = _window; 35 | 36 | NSArray *arrayOfScenes; 37 | int indexOfScene; 38 | 39 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 40 | { 41 | EAGLContext *context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; 42 | [EAGLContext setCurrentContext:context]; 43 | 44 | GLKView *view = [[GLKView alloc] initWithFrame:[[UIScreen mainScreen] bounds] context:context]; 45 | view.delegate = self; 46 | 47 | EESceneController *controller = [[EESceneController alloc] init]; 48 | controller.delegate = self; 49 | controller.view = view; 50 | 51 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 52 | UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:controller]; 53 | self.window.rootViewController = nav; 54 | //[nav release]; 55 | 56 | controller.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] 57 | initWithTitle:@"Next" 58 | style:UIBarButtonItemStyleBordered 59 | target:self 60 | action:@selector(nextScene:)]; 61 | 62 | [self.window makeKeyAndVisible]; 63 | 64 | // setup arrayOfScenes 65 | indexOfScene = -1; 66 | arrayOfScenes = [NSArray arrayWithObjects:[[PrettyAPIMoveScene alloc] init], 67 | [[BeachBallScene alloc] init], 68 | [[WalkingAnimationScene alloc] init], 69 | [[AccelerationScene alloc] init], 70 | [[ColorChangeScene alloc] init], 71 | [[ComplexAnimationScene alloc] init], 72 | [[ForestScene alloc] init], 73 | [[LandscapeScene alloc] init], 74 | [[ManuallyMovedTree alloc] init], 75 | //[[OptimizedTree alloc] init], 76 | [[RotatingTreeScene alloc] init], 77 | [[SierpinskyTriangleScene alloc] init], 78 | [[SpriteScene alloc] init], 79 | [[TriangleScene alloc] init], 80 | [[VelocityScene alloc] init], 81 | [[HexagonScene alloc] init], 82 | [[PrettyAPIMoveScene alloc] init], 83 | [[RectangleScene alloc] init], 84 | nil]; 85 | 86 | [self nextScene:self]; 87 | return YES; 88 | } 89 | 90 | - (void) nextScene:(id) sender{ 91 | indexOfScene = (indexOfScene >= [arrayOfScenes count] -1) ? 0 : indexOfScene + 1; 92 | EEScene *newScene = [arrayOfScenes objectAtIndex:indexOfScene]; 93 | ((UINavigationController *)self.window.rootViewController).topViewController.title = NSStringFromClass([newScene class]); 94 | 95 | scene = newScene; 96 | scene.clearColor = GLKVector4Make(1,1,1,1); 97 | scene.left = -3; 98 | scene.right = 3; 99 | scene.bottom = -2; 100 | scene.top = 2; 101 | } 102 | 103 | - (void)glkViewControllerUpdate:(GLKViewController *)controller { 104 | // NSLog(@"in glkViewControllerUpdate"); 105 | [scene update:controller.timeSinceLastUpdate]; 106 | } 107 | 108 | - (void)glkView:(GLKView *)view drawInRect:(CGRect)rect { 109 | // NSLog(@"in glkView:drawInRect:"); 110 | [scene render]; 111 | } 112 | 113 | - (void)applicationWillResignActive:(UIApplication *)application 114 | { 115 | /* 116 | Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 117 | Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 118 | */ 119 | } 120 | 121 | - (void)applicationDidEnterBackground:(UIApplication *)application 122 | { 123 | /* 124 | Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 125 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 126 | */ 127 | } 128 | 129 | - (void)applicationWillEnterForeground:(UIApplication *)application 130 | { 131 | /* 132 | Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 133 | */ 134 | } 135 | 136 | - (void)applicationDidBecomeActive:(UIApplication *)application 137 | { 138 | /* 139 | Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 140 | */ 141 | } 142 | 143 | - (void)applicationWillTerminate:(UIApplication *)application 144 | { 145 | /* 146 | Called when the application is about to terminate. 147 | Save data if appropriate. 148 | See also applicationDidEnterBackground:. 149 | */ 150 | } 151 | 152 | @end 153 | -------------------------------------------------------------------------------- /ExampleEngine/EEEllipse.h: -------------------------------------------------------------------------------- 1 | // 2 | // EEEllipse.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/17/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEShape.h" 10 | 11 | @interface EEEllipse : EEShape { 12 | float radiusX, radiusY; 13 | } 14 | 15 | @property float radiusX, radiusY; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /ExampleEngine/EEEllipse.m: -------------------------------------------------------------------------------- 1 | // 2 | // EEEllipse.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/17/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEEllipse.h" 10 | 11 | #define EE_ELLIPSE_RESOLUTION 64 12 | 13 | @implementation EEEllipse 14 | 15 | -(int)numVertices { 16 | return EE_ELLIPSE_RESOLUTION; 17 | } 18 | 19 | -(void)updateVertices { 20 | for (int i = 0; i < EE_ELLIPSE_RESOLUTION; i++){ 21 | float theta = ((float)i) / EE_ELLIPSE_RESOLUTION * M_TAU; 22 | self.vertices[i] = GLKVector2Make(cos(theta)*radiusX, sin(theta)*radiusY); 23 | } 24 | } 25 | 26 | -(float)radiusX { 27 | return radiusX; 28 | } 29 | 30 | -(void)setRadiusX:(float)_radiusX { 31 | radiusX = _radiusX; 32 | [self updateVertices]; 33 | } 34 | 35 | -(float)radiusY { 36 | return radiusY; 37 | } 38 | 39 | -(void)setRadiusY:(float)_radiusY { 40 | radiusY = _radiusY; 41 | [self updateVertices]; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /ExampleEngine/EERectangle.h: -------------------------------------------------------------------------------- 1 | // 2 | // EERectangle.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/17/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEShape.h" 10 | 11 | @interface EERectangle : EEShape { 12 | float width, height; 13 | } 14 | 15 | @property float width, height; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /ExampleEngine/EERectangle.m: -------------------------------------------------------------------------------- 1 | // 2 | // EERectangle.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/17/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EERectangle.h" 10 | 11 | @implementation EERectangle 12 | 13 | -(int)numVertices { 14 | return 4; 15 | } 16 | 17 | -(void)updateVertices { 18 | self.vertices[0] = GLKVector2Make( width/2.0, -height/2.0); 19 | self.vertices[1] = GLKVector2Make( width/2.0, height/2.0); 20 | self.vertices[2] = GLKVector2Make(-width/2.0, height/2.0); 21 | self.vertices[3] = GLKVector2Make(-width/2.0, -height/2.0); 22 | } 23 | 24 | -(float)width { 25 | return width; 26 | } 27 | 28 | -(void)setWidth:(float)_width { 29 | width = _width; 30 | [self updateVertices]; 31 | } 32 | 33 | -(float)height { 34 | return height; 35 | } 36 | 37 | -(void)setHeight:(float)_height { 38 | height = _height; 39 | [self updateVertices]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /ExampleEngine/EERegularPolygon.h: -------------------------------------------------------------------------------- 1 | // 2 | // EERegularPolygon.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/17/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEShape.h" 10 | 11 | @interface EERegularPolygon : EEShape { 12 | int numSides; 13 | float radius; 14 | } 15 | 16 | @property(readonly) int numSides; 17 | @property float radius; 18 | 19 | -(id)initWithNumSides:(int)numSides; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /ExampleEngine/EERegularPolygon.m: -------------------------------------------------------------------------------- 1 | // 2 | // EERegularPolygon.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/17/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EERegularPolygon.h" 10 | 11 | @implementation EERegularPolygon 12 | 13 | @synthesize numSides; 14 | 15 | -(id)initWithNumSides:(int)_numSides { 16 | self = [super init]; 17 | if (self) { 18 | numSides = _numSides; 19 | } 20 | return self; 21 | } 22 | 23 | -(int)numVertices { 24 | return numSides; 25 | } 26 | 27 | -(void)updateVertices { 28 | for (int i = 0; i < numSides; i++){ 29 | float theta = ((float)i) / numSides * M_TAU; 30 | self.vertices[i] = GLKVector2Make(cos(theta)*radius, sin(theta)*radius); 31 | } 32 | } 33 | 34 | -(float)radius { 35 | return radius; 36 | } 37 | 38 | -(void)setRadius:(float)_radius { 39 | radius = _radius; 40 | [self updateVertices]; 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /ExampleEngine/EEScene.h: -------------------------------------------------------------------------------- 1 | // 2 | // EEScene.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/16/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface EEScene : NSObject { 13 | GLKVector4 clearColor; 14 | float left, right, bottom, top; 15 | 16 | NSMutableArray *shapes; 17 | } 18 | 19 | @property GLKVector4 clearColor; 20 | @property float left, right, bottom, top; 21 | @property(readonly) GLKMatrix4 projectionMatrix; 22 | @property(strong,readonly) NSMutableArray *shapes; 23 | 24 | -(void)update:(NSTimeInterval)dt; 25 | -(void)render; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /ExampleEngine/EEScene.m: -------------------------------------------------------------------------------- 1 | // 2 | // EEScene.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/16/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEScene.h" 10 | #import "EEShape.h" 11 | 12 | @implementation EEScene 13 | 14 | @synthesize clearColor; 15 | @synthesize left, right, bottom, top; 16 | @synthesize shapes; 17 | 18 | -(id)init { 19 | self = [super init]; 20 | if (self) { 21 | shapes = [[NSMutableArray alloc] init]; 22 | } 23 | return self; 24 | } 25 | 26 | -(void)update:(NSTimeInterval)dt { 27 | // NSLog(@"in EEScene's update"); 28 | [shapes enumerateObjectsUsingBlock:^(EEShape *shape, NSUInteger idx, BOOL *stop) { 29 | [shape update:dt]; 30 | }]; 31 | } 32 | 33 | -(void)render { 34 | // NSLog(@"in EEScene's render"); 35 | glClearColor(clearColor.r, clearColor.g, clearColor.b, clearColor.a); 36 | glClear(GL_COLOR_BUFFER_BIT); 37 | 38 | [shapes makeObjectsPerformSelector:@selector(renderInScene:) withObject:self]; 39 | } 40 | 41 | -(GLKMatrix4)projectionMatrix { 42 | return GLKMatrix4MakeOrtho(left, right, bottom, top, 1, -1); 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /ExampleEngine/EESceneController.h: -------------------------------------------------------------------------------- 1 | // 2 | // EESceneController.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/16/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface EESceneController : GLKViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ExampleEngine/EESceneController.m: -------------------------------------------------------------------------------- 1 | // 2 | // EESceneController.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/16/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EESceneController.h" 10 | 11 | @implementation EESceneController 12 | 13 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 14 | return UIInterfaceOrientationIsLandscape(toInterfaceOrientation); 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /ExampleEngine/EEShape.h: -------------------------------------------------------------------------------- 1 | // 2 | // EEShape.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/17/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "EEScene.h" 12 | #import "EESpriteAnimation.h" 13 | 14 | @interface EEShape : NSObject { 15 | NSMutableData *vertexData, *vertexColorData, *textureCoordinateData; 16 | GLKVector4 color; 17 | BOOL useConstantColor; 18 | 19 | GLKVector2 position, velocity, acceleration; 20 | float rotation, angularVelocity, angularAcceleration; 21 | GLKVector2 scale; 22 | 23 | GLKTextureInfo *texture; 24 | 25 | NSMutableArray *children; 26 | __weak EEShape *parent; 27 | 28 | NSMutableArray *animations; 29 | EESpriteAnimation *spriteAnimation; 30 | } 31 | 32 | @property(readonly) int numVertices; 33 | @property(readonly) GLKVector2 *vertices; 34 | @property(readonly) GLKVector4 *vertexColors; 35 | @property(readonly) GLKVector2 *textureCoordinates; 36 | @property GLKVector4 color; 37 | @property BOOL useConstantColor; 38 | @property GLKVector2 position, velocity, acceleration, scale; 39 | @property float rotation, angularVelocity, angularAcceleration; 40 | @property(strong, readonly) NSMutableArray *children; 41 | @property(weak) EEShape *parent; 42 | @property(readonly) GLKMatrix4 modelviewMatrix; 43 | @property(strong,readonly) GLKTextureInfo *texture; 44 | @property(strong, readonly) NSMutableArray *animations; 45 | @property(strong) EESpriteAnimation *spriteAnimation; 46 | 47 | -(void)update:(NSTimeInterval)dt; 48 | -(void)renderInScene:(EEScene *)scene; 49 | -(void)setTextureImage:(UIImage *)image; 50 | -(void)addChild:(EEShape *)child; 51 | -(void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animations; 52 | 53 | @end -------------------------------------------------------------------------------- /ExampleEngine/EEShape.m: -------------------------------------------------------------------------------- 1 | // 2 | // EEShape.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/17/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEShape.h" 10 | #import "EEAnimation.h" 11 | 12 | @implementation EEShape 13 | 14 | @synthesize color, useConstantColor, 15 | position, velocity, acceleration, 16 | rotation, angularVelocity, angularAcceleration, 17 | scale, 18 | children, parent, 19 | texture, 20 | animations, spriteAnimation; 21 | 22 | -(id)init { 23 | self = [super init]; 24 | if (self) { 25 | // Draw with the color white 26 | useConstantColor = YES; 27 | color = GLKVector4Make(1,1,1,1); 28 | 29 | // No texture 30 | texture = nil; 31 | 32 | // Center on the origin 33 | position = GLKVector2Make(0,0); 34 | 35 | // Don't rotate 36 | rotation = 0; 37 | 38 | // Scale to original size 39 | scale = GLKVector2Make(1,1); 40 | 41 | // No children by default 42 | children = [[NSMutableArray alloc] init]; 43 | 44 | // No animations by default 45 | animations = [[NSMutableArray alloc] init]; 46 | } 47 | return self; 48 | } 49 | 50 | -(int)numVertices { 51 | return 0; 52 | } 53 | 54 | - (GLKVector2 *)vertices { 55 | if (vertexData == nil) 56 | vertexData = [NSMutableData dataWithLength:sizeof(GLKVector2)*self.numVertices]; 57 | return [vertexData mutableBytes]; 58 | } 59 | 60 | - (GLKVector4 *)vertexColors { 61 | if (vertexColorData == nil) 62 | vertexColorData = [NSMutableData dataWithLength:sizeof(GLKVector4)*self.numVertices]; 63 | return [vertexColorData mutableBytes]; 64 | } 65 | 66 | - (GLKVector2 *)textureCoordinates { 67 | if (textureCoordinateData == nil) 68 | textureCoordinateData = [NSMutableData dataWithLength:sizeof(GLKVector2)*self.numVertices]; 69 | return [textureCoordinateData mutableBytes]; 70 | } 71 | 72 | -(GLKMatrix4)modelviewMatrix { 73 | GLKMatrix4 modelviewMatrix = GLKMatrix4Multiply(GLKMatrix4MakeTranslation(position.x, position.y, 0), 74 | GLKMatrix4MakeRotation(rotation, 0, 0, 1)); 75 | modelviewMatrix = GLKMatrix4Multiply(modelviewMatrix, GLKMatrix4MakeScale(scale.x, scale.y, 1)); 76 | 77 | if (parent != nil) 78 | modelviewMatrix = GLKMatrix4Multiply(parent.modelviewMatrix, modelviewMatrix); 79 | 80 | return modelviewMatrix; 81 | } 82 | 83 | -(void)update:(NSTimeInterval)dt { 84 | angularVelocity += angularAcceleration * dt; 85 | rotation += angularVelocity * dt; 86 | 87 | GLKVector2 changeInVelocity = GLKVector2MultiplyScalar(self.acceleration, dt); 88 | self.velocity = GLKVector2Add(self.velocity, changeInVelocity); 89 | 90 | GLKVector2 distanceTraveled = GLKVector2MultiplyScalar(self.velocity, dt); 91 | self.position = GLKVector2Add(self.position, distanceTraveled); 92 | 93 | [animations enumerateObjectsUsingBlock:^(EEAnimation *animation, NSUInteger idx, BOOL *stop) { 94 | [animation animateShape:self dt:dt]; 95 | }]; 96 | 97 | [animations filterUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(EEAnimation *animation, NSDictionary *bindings) { 98 | return animation.elapsedTime <= animation.duration; 99 | }]]; 100 | 101 | [spriteAnimation update:dt]; 102 | } 103 | 104 | -(void)renderInScene:(EEScene *)scene { 105 | // Set up our rendering effect 106 | GLKBaseEffect *effect = [[GLKBaseEffect alloc] init]; 107 | 108 | // Set up the constant color effect if set 109 | if (useConstantColor) { 110 | effect.useConstantColor = YES; 111 | effect.constantColor = self.color; 112 | } 113 | 114 | // Set up our texture effect if set 115 | if (self.texture != nil) { 116 | effect.texture2d0.envMode = GLKTextureEnvModeReplace; 117 | effect.texture2d0.target = GLKTextureTarget2D; 118 | if (self.spriteAnimation != nil) 119 | effect.texture2d0.name = [self.spriteAnimation currentFrame].name; 120 | else 121 | effect.texture2d0.name = self.texture.name; 122 | } 123 | 124 | // Create a modelview matrix to position and rotate the object 125 | effect.transform.modelviewMatrix = self.modelviewMatrix; 126 | 127 | // Set up the projection matrix to fit the scene's boundaries 128 | effect.transform.projectionMatrix = scene.projectionMatrix; 129 | 130 | // Tell OpenGL that we're going to use this effect for our upcoming drawing 131 | [effect prepareToDraw]; 132 | 133 | // Enable transparency 134 | glEnable(GL_BLEND); 135 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 136 | 137 | // Tell OpenGL that we'll be using vertex position data 138 | glEnableVertexAttribArray(GLKVertexAttribPosition); 139 | glVertexAttribPointer(GLKVertexAttribPosition, 2, GL_FLOAT, GL_FALSE, 0, self.vertices); 140 | 141 | // If we're using vertex coloring, tell OpenGL that we'll be using vertex color data 142 | if (!useConstantColor) { 143 | glEnableVertexAttribArray(GLKVertexAttribColor); 144 | glVertexAttribPointer(GLKVertexAttribColor, 4, GL_FLOAT, GL_FALSE, 0, self.vertexColors); 145 | } 146 | 147 | // If we have a texture, tell OpenGL that we'll be using texture coordinate data 148 | 149 | if (texture != nil) { 150 | glEnableVertexAttribArray(GLKVertexAttribTexCoord0); 151 | glVertexAttribPointer(GLKVertexAttribTexCoord0, 2, GL_FLOAT, GL_FALSE, 0, self.textureCoordinates); 152 | } 153 | 154 | // Draw our primitives! 155 | glDrawArrays(GL_TRIANGLE_FAN, 0, self.numVertices); 156 | 157 | // Cleanup: Done with position data 158 | glDisableVertexAttribArray(GLKVertexAttribPosition); 159 | 160 | // Cleanup: Done with color data (only if we used it) 161 | if (!useConstantColor) 162 | glDisableVertexAttribArray(GLKVertexAttribColor); 163 | 164 | // Cleanup: Done with texture data (only if we used it) 165 | if (self.texture != nil) 166 | glDisableVertexAttribArray(GLKVertexAttribTexCoord0); 167 | 168 | // Cleanup: Done with the current blend function 169 | glDisable(GL_BLEND); 170 | 171 | // Draw our children 172 | [children makeObjectsPerformSelector:@selector(renderInScene:) withObject:scene]; 173 | } 174 | 175 | -(void)setTextureImage:(UIImage *)image { 176 | NSError *error; 177 | texture = [GLKTextureLoader textureWithCGImage:image.CGImage options:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:GLKTextureLoaderOriginBottomLeft] error:&error]; 178 | if (error) { 179 | NSLog(@"Error loading texture from image: %@",error); 180 | } 181 | } 182 | 183 | -(void)addChild:(EEShape *)child { 184 | child.parent = self; 185 | [children addObject:child]; 186 | } 187 | 188 | -(void)animateWithDuration:(NSTimeInterval)duration animations:(void (^)(void))animationsBlock { 189 | GLKVector2 currentPosition = self.position; 190 | GLKVector2 currentScale = self.scale; 191 | GLKVector4 currentColor = self.color; 192 | float currentRotation = self.rotation; 193 | 194 | animationsBlock(); 195 | 196 | EEAnimation *animation = [[EEAnimation alloc] init]; 197 | animation.positionDelta = GLKVector2Subtract(self.position, currentPosition); 198 | animation.scaleDelta = GLKVector2Subtract(self.scale, currentScale); 199 | animation.rotationDelta = self.rotation - currentRotation; 200 | animation.colorDelta = GLKVector4Subtract(self.color, currentColor); 201 | animation.duration = duration; 202 | [self.animations addObject:animation]; 203 | 204 | self.position = currentPosition; 205 | self.scale = currentScale; 206 | self.color = currentColor; 207 | self.rotation = currentRotation; 208 | } 209 | 210 | @end 211 | -------------------------------------------------------------------------------- /ExampleEngine/EESprite.h: -------------------------------------------------------------------------------- 1 | // 2 | // EESprite.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/18/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EERectangle.h" 10 | 11 | @interface EESprite : EERectangle 12 | 13 | -(id)initWithImage:(UIImage*)image pointRatio:(float)ratio; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ExampleEngine/EESprite.m: -------------------------------------------------------------------------------- 1 | // 2 | // EESprite.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/18/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EESprite.h" 10 | 11 | @implementation EESprite 12 | 13 | -(id)initWithImage:(UIImage*)image pointRatio:(float)ratio { 14 | self = [super init]; 15 | if (self) { 16 | self.width = image.size.width/ratio; 17 | self.height = image.size.height/ratio; 18 | 19 | [self setTextureImage:image]; 20 | self.textureCoordinates[0] = GLKVector2Make(1,0); 21 | self.textureCoordinates[1] = GLKVector2Make(1,1); 22 | self.textureCoordinates[2] = GLKVector2Make(0,1); 23 | self.textureCoordinates[3] = GLKVector2Make(0,0); 24 | } 25 | return self; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /ExampleEngine/EESpriteAnimation.h: -------------------------------------------------------------------------------- 1 | // 2 | // EESpriteAnimation.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/22/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface EESpriteAnimation : NSObject { 13 | NSArray *frames; 14 | float timePerFrame, elapsedTime; 15 | } 16 | 17 | -(id)initWithTimePerFrame:(float)timePerFrame framesNamed:(NSArray *)frameNames; 18 | -(void)update:(NSTimeInterval)dt; 19 | -(GLKTextureInfo *)currentFrame; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /ExampleEngine/EESpriteAnimation.m: -------------------------------------------------------------------------------- 1 | // 2 | // EESpriteAnimation.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/22/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EESpriteAnimation.h" 10 | 11 | @implementation EESpriteAnimation 12 | 13 | -(id)initWithTimePerFrame:(float)time framesNamed:(NSArray *)frameNames { 14 | self = [super init]; 15 | if (self) { 16 | elapsedTime = 0; 17 | timePerFrame = time; 18 | frames = [NSMutableArray arrayWithCapacity:[frameNames count]]; 19 | for (NSString *name in frameNames) 20 | [(NSMutableArray*)frames addObject: 21 | [GLKTextureLoader textureWithCGImage:[UIImage imageNamed:name].CGImage 22 | options:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:GLKTextureLoaderOriginBottomLeft] 23 | error:nil]]; 24 | } 25 | return self; 26 | } 27 | 28 | -(void)update:(NSTimeInterval)dt { 29 | elapsedTime += dt; 30 | } 31 | 32 | -(GLKTextureInfo *)currentFrame { 33 | NSLog(@"index is %d", ((int)(elapsedTime/timePerFrame))%[frames count]); 34 | return [frames objectAtIndex:((int)(elapsedTime/timePerFrame))%[frames count]]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /ExampleEngine/EETriangle.h: -------------------------------------------------------------------------------- 1 | // 2 | // EETriangle.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/17/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEShape.h" 10 | 11 | @interface EETriangle : EEShape 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ExampleEngine/EETriangle.m: -------------------------------------------------------------------------------- 1 | // 2 | // EETriangle.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/17/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EETriangle.h" 10 | 11 | @implementation EETriangle 12 | 13 | -(int)numVertices { 14 | return 3; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /ExampleEngine/EllipseScene.h: -------------------------------------------------------------------------------- 1 | // 2 | // EllipseScene.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/17/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEScene.h" 10 | #import "EEEllipse.h" 11 | 12 | @interface EllipseScene : EEScene { 13 | EEEllipse *ellipse; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ExampleEngine/EllipseScene.m: -------------------------------------------------------------------------------- 1 | // 2 | // EllipseScene.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/17/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EllipseScene.h" 10 | 11 | @implementation EllipseScene 12 | 13 | -(id)init { 14 | self = [super init]; 15 | if (self) { 16 | ellipse = [[EEEllipse alloc] init]; 17 | ellipse.radiusX = 2; 18 | ellipse.radiusY = 1; 19 | } 20 | return self; 21 | } 22 | 23 | -(void)render { 24 | [super render]; 25 | [ellipse renderInScene:self]; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /ExampleEngine/ExampleEngine-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | CFBundleIdentifier 14 | com.ianterrell.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | UIStatusBarHidden 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationLandscapeRight 34 | UIInterfaceOrientationLandscapeLeft 35 | 36 | UISupportedInterfaceOrientations~ipad 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationPortraitUpsideDown 40 | UIInterfaceOrientationLandscapeLeft 41 | UIInterfaceOrientationLandscapeRight 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /ExampleEngine/ExampleEngine-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'ExampleEngine' target in the 'ExampleEngine' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iOS SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | 16 | #define M_TAU (2*M_PI) -------------------------------------------------------------------------------- /ExampleEngine/ForestScene.h: -------------------------------------------------------------------------------- 1 | // 2 | // ForestScene.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/18/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEScene.h" 10 | 11 | @interface ForestScene : EEScene 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ExampleEngine/ForestScene.m: -------------------------------------------------------------------------------- 1 | // 2 | // ForestScene.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/18/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "ForestScene.h" 10 | #import "OptimizedTree.h" 11 | 12 | @implementation ForestScene 13 | 14 | -(id)init { 15 | self = [super init]; 16 | if (self) { 17 | for (int i = 0; i < 10; i++) { 18 | for (int j = 0; j < 10; j++) { 19 | OptimizedTree *tree = [[OptimizedTree alloc] init]; 20 | tree.scale = GLKVector2Make(0.08+((i+j)%2)*0.04, 0.08+((i+j)%2)*0.04); 21 | tree.rotation = ((i+j)%12)/12.0*M_TAU; 22 | tree.position = GLKVector2Make(-2.7+i*0.6,-1.8+j*0.4); 23 | [self.shapes addObject:tree]; 24 | } 25 | } 26 | } 27 | return self; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /ExampleEngine/HexagonScene.h: -------------------------------------------------------------------------------- 1 | // 2 | // HexagonScene.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/17/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEScene.h" 10 | #import "EERegularPolygon.h" 11 | 12 | @interface HexagonScene : EEScene { 13 | EERegularPolygon *polygon; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ExampleEngine/HexagonScene.m: -------------------------------------------------------------------------------- 1 | // 2 | // HexagonScene.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/17/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "HexagonScene.h" 10 | 11 | @implementation HexagonScene 12 | 13 | -(id)init { 14 | self = [super init]; 15 | if (self) { 16 | polygon = [[EERegularPolygon alloc] initWithNumSides:6]; 17 | polygon.radius = 1; 18 | polygon.color = GLKVector4Make(0.9, 0.9, 0.1, 1.0); 19 | } 20 | return self; 21 | } 22 | 23 | -(void)render { 24 | [super render]; 25 | [polygon renderInScene:self]; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /ExampleEngine/LandscapeScene.h: -------------------------------------------------------------------------------- 1 | // 2 | // LandscapeScene.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/18/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEScene.h" 10 | #import "EERectangle.h" 11 | 12 | @interface LandscapeScene : EEScene { 13 | EERectangle *rectangle; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ExampleEngine/LandscapeScene.m: -------------------------------------------------------------------------------- 1 | // 2 | // LandscapeScene.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/18/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "LandscapeScene.h" 10 | 11 | @implementation LandscapeScene 12 | 13 | -(id)init { 14 | self = [super init]; 15 | if (self) { 16 | rectangle = [[EERectangle alloc] init]; 17 | rectangle.width = 6; 18 | rectangle.height = 4; 19 | 20 | [rectangle setTextureImage:[UIImage imageNamed:@"landscape.jpg"]]; 21 | rectangle.textureCoordinates[0] = GLKVector2Make(1,0); 22 | rectangle.textureCoordinates[1] = GLKVector2Make(1,0.88); 23 | rectangle.textureCoordinates[2] = GLKVector2Make(0,0.88); 24 | rectangle.textureCoordinates[3] = GLKVector2Make(0,0); 25 | } 26 | return self; 27 | } 28 | 29 | -(void)render { 30 | [super render]; 31 | [rectangle renderInScene:self]; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /ExampleEngine/ManuallyMovedTree.h: -------------------------------------------------------------------------------- 1 | // 2 | // ManuallyMovedTree.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/19/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEScene.h" 10 | 11 | @interface ManuallyMovedTree : EEScene 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ExampleEngine/ManuallyMovedTree.m: -------------------------------------------------------------------------------- 1 | // 2 | // ManuallyMovedTree.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/19/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "ManuallyMovedTree.h" 10 | #import "Tree.h" 11 | #import "EEAnimation.h" 12 | 13 | @implementation ManuallyMovedTree 14 | 15 | -(id)init { 16 | self = [super init]; 17 | if (self) { 18 | Tree *tree = [[Tree alloc] init]; 19 | tree.position = GLKVector2Make(-1.5,0); 20 | 21 | EEAnimation *moveRightAnimation = [[EEAnimation alloc] init]; 22 | moveRightAnimation.positionDelta = GLKVector2Make(3, 0); 23 | moveRightAnimation.duration = 3; 24 | [tree.animations addObject:moveRightAnimation]; 25 | 26 | [self.shapes addObject:tree]; 27 | } 28 | return self; 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /ExampleEngine/OptimizedTree.h: -------------------------------------------------------------------------------- 1 | // 2 | // OptimizedTree.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/18/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEShape.h" 10 | #import "EERectangle.h" 11 | #import "EETriangle.h" 12 | 13 | @interface OptimizedShape : EEShape { 14 | EEShape *prototype; 15 | } 16 | @end 17 | 18 | @interface OptimizedTrunk : OptimizedShape 19 | @end 20 | 21 | @interface OptimizedLeaves : OptimizedShape 22 | @end 23 | 24 | @interface OptimizedTree : EEShape 25 | @end 26 | -------------------------------------------------------------------------------- /ExampleEngine/OptimizedTree.m: -------------------------------------------------------------------------------- 1 | // 2 | // OptimizedTree.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/18/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "OptimizedTree.h" 10 | 11 | @implementation OptimizedShape 12 | -(int)numVertices { 13 | return prototype.numVertices; 14 | } 15 | - (GLKVector2 *)vertices { 16 | return prototype.vertices; 17 | } 18 | -(GLKVector4)color { 19 | return prototype.color; 20 | } 21 | - (GLKVector4 *)vertexColors { 22 | return prototype.vertexColors; 23 | } 24 | -(GLKTextureInfo *)texture { 25 | return prototype.texture; 26 | } 27 | - (GLKVector2 *)textureCoordinates { 28 | return prototype.textureCoordinates; 29 | } 30 | @end 31 | 32 | @implementation OptimizedTrunk 33 | -(id)init { 34 | self = [super init]; 35 | if (self) { 36 | prototype = [[EERectangle alloc] init]; 37 | ((EERectangle*)prototype).width = 0.4; 38 | ((EERectangle*)prototype).height = 1; 39 | prototype.position = GLKVector2Make(0, -1.25); 40 | prototype.color = GLKVector4Make(0.4, 0.1, 0, 1); 41 | } 42 | return self; 43 | } 44 | @end 45 | 46 | @implementation OptimizedLeaves 47 | -(id)init { 48 | self = [super init]; 49 | if (self) { 50 | prototype = [[EETriangle alloc] init]; 51 | prototype.vertices[0] = GLKVector2Make(-1, 0); 52 | prototype.vertices[1] = GLKVector2Make( 1, 0); 53 | prototype.vertices[2] = GLKVector2Make( 0, 3); 54 | prototype.position = GLKVector2Make(0,-1.2); 55 | prototype.color = GLKVector4Make(0, 0.5, 0, 1); 56 | } 57 | return self; 58 | } 59 | @end 60 | 61 | @implementation OptimizedTree 62 | -(id)init { 63 | self = [super init]; 64 | if (self) { 65 | [self addChild:[[OptimizedTrunk alloc] init]]; 66 | [self addChild:[[OptimizedLeaves alloc] init]]; 67 | } 68 | return self; 69 | } 70 | @end 71 | -------------------------------------------------------------------------------- /ExampleEngine/PrettyAPIMoveScene.h: -------------------------------------------------------------------------------- 1 | // 2 | // PrettyAPIMoveScene.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/19/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEScene.h" 10 | 11 | @interface PrettyAPIMoveScene : EEScene 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ExampleEngine/PrettyAPIMoveScene.m: -------------------------------------------------------------------------------- 1 | // 2 | // PrettyAPIMoveScene.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/19/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "PrettyAPIMoveScene.h" 10 | #import "Tree.h" 11 | 12 | @implementation PrettyAPIMoveScene 13 | 14 | -(id)init { 15 | self = [super init]; 16 | if (self) { 17 | Tree *tree = [[Tree alloc] init]; 18 | tree.position = GLKVector2Make(-1.5,0); 19 | [tree animateWithDuration:3 animations:^() { 20 | tree.position = GLKVector2Make(1.5,0); 21 | }]; 22 | [self.shapes addObject:tree]; 23 | } 24 | return self; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /ExampleEngine/RectangleScene.h: -------------------------------------------------------------------------------- 1 | // 2 | // RectangleScene.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/17/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEScene.h" 10 | #import "EERectangle.h" 11 | 12 | @interface RectangleScene : EEScene { 13 | EERectangle *rectangle; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ExampleEngine/RectangleScene.m: -------------------------------------------------------------------------------- 1 | // 2 | // RectangleScene.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/17/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "RectangleScene.h" 10 | 11 | @implementation RectangleScene 12 | 13 | -(id)init { 14 | self = [super init]; 15 | if (self) { 16 | rectangle = [[EERectangle alloc] init]; 17 | rectangle.width = 2; 18 | rectangle.height = 1; 19 | } 20 | return self; 21 | } 22 | 23 | -(void)render { 24 | [super render]; 25 | [rectangle renderInScene:self]; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /ExampleEngine/RotatingTreeScene.h: -------------------------------------------------------------------------------- 1 | // 2 | // RotatingTreeScene.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/19/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEScene.h" 10 | 11 | @interface RotatingTreeScene : EEScene 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ExampleEngine/RotatingTreeScene.m: -------------------------------------------------------------------------------- 1 | // 2 | // RotatingTreeScene.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/19/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "RotatingTreeScene.h" 10 | #import "Tree.h" 11 | 12 | @implementation RotatingTreeScene 13 | 14 | -(id)init { 15 | self = [super init]; 16 | if (self) { 17 | Tree *tree = [[Tree alloc] init]; 18 | tree.rotation = 0; 19 | tree.angularVelocity = M_TAU; 20 | tree.angularAcceleration = 0.1*M_TAU; 21 | [self.shapes addObject:tree]; 22 | } 23 | return self; 24 | } 25 | 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /ExampleEngine/SierpinskyTriangleScene.h: -------------------------------------------------------------------------------- 1 | // 2 | // SierpinskyTriangleScene.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/18/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEScene.h" 10 | #import "EETriangle.h" 11 | 12 | @interface SierpinskyTriangleScene : EEScene { 13 | EETriangle *triangle; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ExampleEngine/SierpinskyTriangleScene.m: -------------------------------------------------------------------------------- 1 | // 2 | // SierpinskyTriangleScene.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/18/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "SierpinskyTriangleScene.h" 10 | 11 | @implementation SierpinskyTriangleScene 12 | 13 | -(id)init { 14 | self = [super init]; 15 | if (self) { 16 | triangle = [[EETriangle alloc] init]; 17 | 18 | triangle.vertices[0] = GLKVector2Make(-1, -1); 19 | triangle.vertices[1] = GLKVector2Make( 1, -1); 20 | triangle.vertices[2] = GLKVector2Make( 0, -1+2*sin(M_TAU/6)); 21 | 22 | [triangle setTextureImage:[UIImage imageNamed:@"sierpinksy.jpg"]]; 23 | triangle.textureCoordinates[0] = GLKVector2Make( 0,0); 24 | triangle.textureCoordinates[1] = GLKVector2Make( 1,0); 25 | triangle.textureCoordinates[2] = GLKVector2Make(0.5,1); 26 | } 27 | return self; 28 | } 29 | 30 | -(void)render { 31 | [super render]; 32 | [triangle renderInScene:self]; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /ExampleEngine/SpriteScene.h: -------------------------------------------------------------------------------- 1 | // 2 | // SpriteScene.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/18/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEScene.h" 10 | #import "EESprite.h" 11 | 12 | @interface SpriteScene : EEScene { 13 | EESprite *sprite; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ExampleEngine/SpriteScene.m: -------------------------------------------------------------------------------- 1 | // 2 | // SpriteScene.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/18/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "SpriteScene.h" 10 | 11 | @implementation SpriteScene 12 | 13 | -(id)init { 14 | self = [super init]; 15 | if (self) { 16 | sprite = [[EESprite alloc] initWithImage:[UIImage imageNamed:@"boy-sprite.png"] pointRatio:100]; 17 | sprite.position = GLKVector2Make(2,-1); 18 | sprite.rotation = 0.25*M_TAU; 19 | sprite.scale = GLKVector2Make(0.5, 1.5); 20 | } 21 | return self; 22 | } 23 | 24 | -(void)render { 25 | [super render]; 26 | [sprite renderInScene:self]; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /ExampleEngine/Tree.h: -------------------------------------------------------------------------------- 1 | // 2 | // Tree.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/18/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEShape.h" 10 | 11 | @interface Tree : EEShape 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ExampleEngine/Tree.m: -------------------------------------------------------------------------------- 1 | // 2 | // Tree.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/18/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "Tree.h" 10 | #import "EETriangle.h" 11 | #import "EERectangle.h" 12 | 13 | @implementation Tree 14 | 15 | -(id)init { 16 | self = [super init]; 17 | if (self) { 18 | EETriangle *leaves = [[EETriangle alloc] init]; 19 | leaves.vertices[0] = GLKVector2Make(-1, 0); 20 | leaves.vertices[1] = GLKVector2Make( 1, 0); 21 | leaves.vertices[2] = GLKVector2Make( 0, 3); 22 | leaves.position = GLKVector2Make(0,-1.2); 23 | leaves.color = GLKVector4Make(0, 0.5, 0, 1); 24 | 25 | EERectangle *trunk = [[EERectangle alloc] init]; 26 | trunk.width = 0.4; 27 | trunk.height = 1; 28 | trunk.position = GLKVector2Make(0, -1.25); 29 | trunk.color = GLKVector4Make(0.4, 0.1, 0, 1); 30 | 31 | [self addChild:trunk]; 32 | [self addChild:leaves]; 33 | } 34 | return self; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /ExampleEngine/TreeScene.h: -------------------------------------------------------------------------------- 1 | // 2 | // TreeScene.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/18/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEScene.h" 10 | #import "EETriangle.h" 11 | #import "EERectangle.h" 12 | 13 | @interface TreeScene : EEScene 14 | @end 15 | -------------------------------------------------------------------------------- /ExampleEngine/TreeScene.m: -------------------------------------------------------------------------------- 1 | // 2 | // TreeScene.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/18/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "TreeScene.h" 10 | 11 | @implementation TreeScene 12 | 13 | -(id)init { 14 | self = [super init]; 15 | if (self) { 16 | EETriangle *leaves = [[EETriangle alloc] init]; 17 | leaves.vertices[0] = GLKVector2Make(-1, 0); 18 | leaves.vertices[1] = GLKVector2Make( 1, 0); 19 | leaves.vertices[2] = GLKVector2Make( 0, 3); 20 | leaves.position = GLKVector2Make(0,-1.2); 21 | leaves.color = GLKVector4Make(0, 0.5, 0, 1); 22 | 23 | EERectangle *trunk = [[EERectangle alloc] init]; 24 | trunk.width = 0.4; 25 | trunk.height = 1; 26 | trunk.position = GLKVector2Make(0, -1.25); 27 | trunk.color = GLKVector4Make(0.4, 0.1, 0, 1); 28 | 29 | EEShape *tree = [[EEShape alloc] init]; 30 | [tree addChild:trunk]; 31 | [tree addChild:leaves]; 32 | tree.scale = GLKVector2Make(0.5, 0.5); 33 | tree.position = GLKVector2Make(1,0); 34 | 35 | [self.shapes addObject:tree]; 36 | } 37 | return self; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /ExampleEngine/TriangleScene.h: -------------------------------------------------------------------------------- 1 | // 2 | // TriangleScene.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/17/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEScene.h" 10 | #import "EETriangle.h" 11 | 12 | @interface TriangleScene : EEScene { 13 | EETriangle *triangle; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ExampleEngine/TriangleScene.m: -------------------------------------------------------------------------------- 1 | // 2 | // TriangleScene.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/17/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "TriangleScene.h" 10 | 11 | @implementation TriangleScene 12 | 13 | -(id)init { 14 | self = [super init]; 15 | if (self) { 16 | triangle = [[EETriangle alloc] init]; 17 | 18 | triangle.vertices[0] = GLKVector2Make(-1, -1); 19 | triangle.vertices[1] = GLKVector2Make( 1, -1); 20 | triangle.vertices[2] = GLKVector2Make( 0, 1); 21 | 22 | triangle.useConstantColor = NO; 23 | triangle.vertexColors[0] = GLKVector4Make(1,0,0,1); 24 | triangle.vertexColors[1] = GLKVector4Make(0,1,0,1); 25 | triangle.vertexColors[2] = GLKVector4Make(0,0,1,1); 26 | } 27 | return self; 28 | } 29 | 30 | -(void)render { 31 | [super render]; 32 | [triangle renderInScene:self]; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /ExampleEngine/VelocityScene.h: -------------------------------------------------------------------------------- 1 | // 2 | // VelocityScene.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/19/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEScene.h" 10 | 11 | @interface VelocityScene : EEScene 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ExampleEngine/VelocityScene.m: -------------------------------------------------------------------------------- 1 | // 2 | // VelocityScene.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/19/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "VelocityScene.h" 10 | #import "Tree.h" 11 | 12 | @implementation VelocityScene 13 | 14 | -(id)init { 15 | self = [super init]; 16 | if (self) { 17 | Tree *tree = [[Tree alloc] init]; 18 | tree.scale = GLKVector2Make(0.5,0.5); 19 | tree.position = GLKVector2Make(-3,-2); 20 | tree.velocity = GLKVector2Make(1,0.75); 21 | [self.shapes addObject:tree]; 22 | } 23 | return self; 24 | } 25 | 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /ExampleEngine/WalkingAnimationScene.h: -------------------------------------------------------------------------------- 1 | // 2 | // WalkingAnimationScene.h 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/22/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "EEScene.h" 10 | 11 | @interface WalkingAnimationScene : EEScene 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ExampleEngine/WalkingAnimationScene.m: -------------------------------------------------------------------------------- 1 | // 2 | // WalkingAnimationScene.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/22/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import "WalkingAnimationScene.h" 10 | #import "EESprite.h" 11 | #import "EESpriteAnimation.h" 12 | 13 | @implementation WalkingAnimationScene 14 | 15 | -(id)init { 16 | self = [super init]; 17 | if (self) { 18 | EESprite *sprite = [[EESprite alloc] initWithImage:[UIImage imageNamed:@"alfred0.png"] pointRatio:100]; 19 | NSArray *frameNames = [NSArray arrayWithObjects:@"alfred1.png", @"alfred2.png", @"alfred3.png", @"alfred4.png", @"alfred5.png", @"alfred6.png", @"alfred7.png", @"alfred8.png", @"alfred9.png", nil]; 20 | sprite.spriteAnimation = [[EESpriteAnimation alloc] initWithTimePerFrame:1.0/9 framesNamed:frameNames]; 21 | 22 | sprite.position = GLKVector2Make(3, 0); 23 | sprite.velocity = GLKVector2Make(-1, 0); 24 | 25 | [self.shapes addObject:sprite]; 26 | } 27 | return self; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /ExampleEngine/ball.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ianterrell/ExampleEngine/3a722e94b2c38d9cd5c054fb78d049f063fbc592/ExampleEngine/ball.jpg -------------------------------------------------------------------------------- /ExampleEngine/boy-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ianterrell/ExampleEngine/3a722e94b2c38d9cd5c054fb78d049f063fbc592/ExampleEngine/boy-sprite.png -------------------------------------------------------------------------------- /ExampleEngine/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /ExampleEngine/landscape.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ianterrell/ExampleEngine/3a722e94b2c38d9cd5c054fb78d049f063fbc592/ExampleEngine/landscape.jpg -------------------------------------------------------------------------------- /ExampleEngine/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ExampleEngine 4 | // 5 | // Created by Ian Terrell on 8/16/11. 6 | // Copyright (c) 2011 Ian Terrell. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "EEAppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([EEAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ExampleEngine/sierpinksy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ianterrell/ExampleEngine/3a722e94b2c38d9cd5c054fb78d049f063fbc592/ExampleEngine/sierpinksy.jpg -------------------------------------------------------------------------------- /ExampleEngine/sprite animation/alfred0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ianterrell/ExampleEngine/3a722e94b2c38d9cd5c054fb78d049f063fbc592/ExampleEngine/sprite animation/alfred0.png -------------------------------------------------------------------------------- /ExampleEngine/sprite animation/alfred1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ianterrell/ExampleEngine/3a722e94b2c38d9cd5c054fb78d049f063fbc592/ExampleEngine/sprite animation/alfred1.png -------------------------------------------------------------------------------- /ExampleEngine/sprite animation/alfred2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ianterrell/ExampleEngine/3a722e94b2c38d9cd5c054fb78d049f063fbc592/ExampleEngine/sprite animation/alfred2.png -------------------------------------------------------------------------------- /ExampleEngine/sprite animation/alfred3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ianterrell/ExampleEngine/3a722e94b2c38d9cd5c054fb78d049f063fbc592/ExampleEngine/sprite animation/alfred3.png -------------------------------------------------------------------------------- /ExampleEngine/sprite animation/alfred4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ianterrell/ExampleEngine/3a722e94b2c38d9cd5c054fb78d049f063fbc592/ExampleEngine/sprite animation/alfred4.png -------------------------------------------------------------------------------- /ExampleEngine/sprite animation/alfred5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ianterrell/ExampleEngine/3a722e94b2c38d9cd5c054fb78d049f063fbc592/ExampleEngine/sprite animation/alfred5.png -------------------------------------------------------------------------------- /ExampleEngine/sprite animation/alfred6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ianterrell/ExampleEngine/3a722e94b2c38d9cd5c054fb78d049f063fbc592/ExampleEngine/sprite animation/alfred6.png -------------------------------------------------------------------------------- /ExampleEngine/sprite animation/alfred7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ianterrell/ExampleEngine/3a722e94b2c38d9cd5c054fb78d049f063fbc592/ExampleEngine/sprite animation/alfred7.png -------------------------------------------------------------------------------- /ExampleEngine/sprite animation/alfred8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ianterrell/ExampleEngine/3a722e94b2c38d9cd5c054fb78d049f063fbc592/ExampleEngine/sprite animation/alfred8.png -------------------------------------------------------------------------------- /ExampleEngine/sprite animation/alfred9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ianterrell/ExampleEngine/3a722e94b2c38d9cd5c054fb78d049f063fbc592/ExampleEngine/sprite animation/alfred9.png --------------------------------------------------------------------------------