Skip to content
Browse files

No need for multitasking + some cleanup

  • Loading branch information...
1 parent b9a378e commit 4bc2bdb35ddfc9335e9ca5ed6406c115630f44c3 @oscardelben committed May 6, 2011
View
2 Readme
@@ -1 +1 @@
-Coming Soon...
+Proof of concept snake implementation for iPhone. Game created just for learning purposes
View
6 Snake4iPhone.xcodeproj/project.pbxproj
@@ -121,7 +121,6 @@
557249E4136EBE8800046EAC /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 557249E3136EBE8800046EAC /* main.m */; };
557249E7136EBE8800046EAC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 557249E6136EBE8800046EAC /* AppDelegate.m */; };
557249EA136EBE8800046EAC /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 557249E9136EBE8800046EAC /* RootViewController.m */; };
- 557249ED136EBE8800046EAC /* HelloWorldLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 557249EC136EBE8800046EAC /* HelloWorldLayer.m */; };
557249F6136EBFAD00046EAC /* SnakeLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 557249F5136EBFAD00046EAC /* SnakeLayer.m */; };
557249F8136EC0C200046EAC /* snake-body.png in Resources */ = {isa = PBXBuildFile; fileRef = 557249F7136EC0C200046EAC /* snake-body.png */; };
557249FE136EDF9600046EAC /* background.png in Resources */ = {isa = PBXBuildFile; fileRef = 557249FD136EDF9600046EAC /* background.png */; };
@@ -360,8 +359,6 @@
557249E6136EBE8800046EAC /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
557249E8136EBE8800046EAC /* RootViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = "<group>"; };
557249E9136EBE8800046EAC /* RootViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RootViewController.m; sourceTree = "<group>"; };
- 557249EB136EBE8800046EAC /* HelloWorldLayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HelloWorldLayer.h; sourceTree = "<group>"; };
- 557249EC136EBE8800046EAC /* HelloWorldLayer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HelloWorldLayer.m; sourceTree = "<group>"; };
557249EE136EBE8800046EAC /* GameConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GameConfig.h; sourceTree = "<group>"; };
557249F4136EBFAD00046EAC /* SnakeLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SnakeLayer.h; sourceTree = "<group>"; };
557249F5136EBFAD00046EAC /* SnakeLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SnakeLayer.m; sourceTree = "<group>"; };
@@ -431,8 +428,6 @@
557249E6136EBE8800046EAC /* AppDelegate.m */,
557249E8136EBE8800046EAC /* RootViewController.h */,
557249E9136EBE8800046EAC /* RootViewController.m */,
- 557249EB136EBE8800046EAC /* HelloWorldLayer.h */,
- 557249EC136EBE8800046EAC /* HelloWorldLayer.m */,
557249EE136EBE8800046EAC /* GameConfig.h */,
557249F4136EBFAD00046EAC /* SnakeLayer.h */,
557249F5136EBFAD00046EAC /* SnakeLayer.m */,
@@ -881,7 +876,6 @@
557249E4136EBE8800046EAC /* main.m in Sources */,
557249E7136EBE8800046EAC /* AppDelegate.m in Sources */,
557249EA136EBE8800046EAC /* RootViewController.m in Sources */,
- 557249ED136EBE8800046EAC /* HelloWorldLayer.m in Sources */,
557249F6136EBFAD00046EAC /* SnakeLayer.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
View
21 Snake4iPhone/HelloWorldLayer.h
@@ -1,21 +0,0 @@
-//
-// HelloWorldLayer.h
-// Snake4iPhone
-//
-// Created by Oscar Del Ben on 5/2/11.
-// Copyright DibiStore 2011. All rights reserved.
-//
-
-
-// When you import this file, you import all the cocos2d classes
-#import "cocos2d.h"
-
-// HelloWorldLayer
-@interface HelloWorldLayer : CCLayer
-{
-}
-
-// returns a CCScene that contains the HelloWorldLayer as the only child
-+(CCScene *) scene;
-
-@end
View
63 Snake4iPhone/HelloWorldLayer.m
@@ -1,63 +0,0 @@
-//
-// HelloWorldLayer.m
-// Snake4iPhone
-//
-// Created by Oscar Del Ben on 5/2/11.
-// Copyright DibiStore 2011. All rights reserved.
-//
-
-
-// Import the interfaces
-#import "HelloWorldLayer.h"
-
-// HelloWorldLayer implementation
-@implementation HelloWorldLayer
-
-+(CCScene *) scene
-{
- // 'scene' is an autorelease object.
- CCScene *scene = [CCScene node];
-
- // 'layer' is an autorelease object.
- HelloWorldLayer *layer = [HelloWorldLayer node];
-
- // add layer as a child to scene
- [scene addChild: layer];
-
- // return the scene
- return scene;
-}
-
-// on "init" you need to initialize your instance
--(id) init
-{
- // always call "super" init
- // Apple recommends to re-assign "self" with the "super" return value
- if( (self=[super init])) {
-
- // create and initialize a Label
- CCLabelTTF *label = [CCLabelTTF labelWithString:@"Hello World" fontName:@"Marker Felt" fontSize:64];
-
- // ask director the the window size
- CGSize size = [[CCDirector sharedDirector] winSize];
-
- // position the label on the center of the screen
- label.position = ccp( size.width /2 , size.height/2 );
-
- // add the label as a child to this Layer
- [self addChild: label];
- }
- return self;
-}
-
-// on "dealloc" you need to release all your retained objects
-- (void) dealloc
-{
- // in case you have something to dealloc, do it in this method
- // in this particular example nothing needs to be released.
- // cocos2d will automatically release all the children (Label)
-
- // don't forget to call "super dealloc"
- [super dealloc];
-}
-@end
View
2 Snake4iPhone/Resources/Info.plist
@@ -48,5 +48,7 @@
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
+ <key>UIApplicationExitsOnSuspend</key>
+ <true/>
</dict>
</plist>

0 comments on commit 4bc2bdb

Please sign in to comment.
Something went wrong with that request. Please try again.