Kobold2Dで始めるゲーム開発

16,533 views

Published on

iPhone Dev Sap, Kobold2dによるゲーム開発

Published in: Technology, News & Politics
0 Comments
12 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
16,533
On SlideShare
0
From Embeds
0
Number of Embeds
9,726
Actions
Shares
0
Downloads
25
Comments
0
Likes
12
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • 現代アート 趣味悪い\n
  • \n
  • \n
  • 新規作成時のコード量 ゴミのようだ\n
  • スクリプト、設定ファイルとか plist使わなくて良い!!!\n
  • \n
  • タッチジェスチャー\nタッチ、だぶるたっち、ピンチ、ローテーション、スワイプなどが簡単に取得できる!\n
  • 外部ライブラリSneakyInput\n\n
  • \n
  • 音ならすだけなら簡単\n複雑なこともできます\n
  • Kawaz所属 興味あったら来てください!\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • いきなりですが、皆様、Newsstandを利用されている方がいましたら、挙手をお願いします\n\n少ないですね。\n
  • おそらく、概ねこういう結果になるのではないかと思います。\n\nこの調査結果は、僕の脳内調べですが、Google先生に聞いてみると\n
  • こういう結果が出てくるのが全てを物語っています。\n
  • Newsstandはいらない子\n
  • \n
  • iOSユーザーである賢明な皆様であれば、このようないらないフォルダを作成されていることと思います。\n「友達を探す」アプリとかも隠せて、探す友達いない我々も安心ですね\n
  • \n
  • このように、非常にシビアなので、試されても上手くいかなかった方が多いと思いますが、10分ぐらい練習したら百発百中になったので\n\n今回はiPhone技術勉強会と言うことなので「Newsstand」をフォルダに突っ込む技術についてお話しします。\n
  • \n
  • \n
  • 動画をキャプチャしたので、見にくくて恐縮ですが\n
  • \n
  • 練習してどうするんだって感じですけどね\n
  • マトリョシカみたい!\n
  • \n
  • Kobold2Dで始めるゲーム開発

    1. 1. 1Monday, January 16, 12
    2. 2. 2Monday, January 16, 12
    3. 3. 3Monday, January 16, 12
    4. 4. 4Monday, January 16, 12
    5. 5. cocos2d for iPhone 5Monday, January 16, 12
    6. 6. 6Monday, January 16, 12
    7. 7. 7Monday, January 16, 12
    8. 8. 8Monday, January 16, 12
    9. 9. 9Monday, January 16, 12
    10. 10. 10Monday, January 16, 12
    11. 11. 11Monday, January 16, 12
    12. 12. 12Monday, January 16, 12
    13. 13. 13Monday, January 16, 12
    14. 14. 14Monday, January 16, 12
    15. 15. 15Monday, January 16, 12
    16. 16. 16Monday, January 16, 12
    17. 17. /* // // AppDelegate.m // Demo // * Kobold2D™ --- http://www.kobold2d.org // Created by on 1/14/12. // Copyright Kawaz 2012. All rights reserved. // * #import "cocos2d.h" #import "AppDelegate.h" #import "GameConfig.h" * Copyright (c) 2010-2011 Steffen Itterheim. #import "HelloWorldLayer.h" #import "RootViewController.h" @implementation AppDelegate @synthesize window; - (void) removeStartupFlicker * Released under MIT License in Germany (LICENSE-Kobold2D.txt). */ { // // THIS CODE REMOVES THE STARTUP FLICKER // // Uncomment the following code if you Application only supports landscape mode // #if GAME_AUTOROTATION == kGameAutorotationUIViewController #import "AppDelegate.h" // CC_ENABLE_DEFAULT_GL_STATES(); // CCDirector *director = [CCDirector sharedDirector]; // CGSize size = [director winSize]; // CCSprite *sprite = [CCSprite spriteWithFile:@"Default.png"]; // sprite.position = ccp(size.width/2, size.height/2); // sprite.rotation = -90; // [sprite visit]; // [[director openGLView] swapBuffers]; @implementation AppDelegate // CC_ENABLE_DEFAULT_GL_STATES(); #endif // GAME_AUTOROTATION == kGameAutorotationUIViewController } - (void) applicationDidFinishLaunching:(UIApplication*)application { // Init the window window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Try to use CADisplayLink director // if it fails (SDK < 3.1) use the default director if( ! [CCDirector setDirectorType:kCCDirectorTypeDisplayLink] ) -(void) initializationComplete { [CCDirector setDirectorType:kCCDirectorTypeDefault]; CCDirector *director = [CCDirector sharedDirector]; // Init the View Controller viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil]; viewController.wantsFullScreenLayout = YES; #ifdef KK_ARC_ENABLED // // Create the EAGLView manually // 1. Create a RGB565 format. Alternative: RGBA8 CCLOG(@"ARC is enabled"); #else // 2. depth format of 0 bit. Use 16 or 24 bit for 3d effects, like CCPageTurnTransition // // CCLOG(@"ARC is either not available or not enabled"); EAGLView *glView = [EAGLView viewWithFrame:[window bounds] pixelFormat:kEAGLColorFormatRGB565 // kEAGLColorFormatRGBA8 #endif depthFormat: 0 // GL_DEPTH_COMPONENT16_OES } ]; // attach the openglView to the director [director setOpenGLView:glView]; // // Enables High Res mode (Retina Display) on iPhone 4 and maintains low res on all other devices // if( ! [director enableRetinaDisplay:YES] ) -(id) alternateRootViewController // CCLOG(@"Retina Display Not supported"); // // VERY IMPORTANT: { // If the rotation is going to be controlled by a UIViewController // then the device orientation should be "Portrait". // // IMPORTANT: return nil; // By default, this template only supports Landscape orientations. // Edit the RootViewController.m file to edit the supported orientations. // #if GAME_AUTOROTATION == kGameAutorotationUIViewController } [director setDeviceOrientation:kCCDeviceOrientationPortrait]; #else [director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft]; #endif [director setAnimationInterval:1.0/60]; [director setDisplayFPS:YES]; // make the OpenGLView a child of the view controller [viewController setView:glView]; -(id) alternateView { // make the View Controller a child of the main window [window addSubview: viewController.view]; [window makeKeyAndVisible]; // Default texture format for PNG/BMP/TIFF/JPEG/GIF images // It can be RGBA8888, RGBA4444, RGB5_A1, RGB565 // You can change anytime. return nil; } [CCTexture2D setDefaultAlphaPixelFormat:kCCTexture2DPixelFormat_RGBA8888]; // Removes the startup flicker [self removeStartupFlicker]; // Run the intro Scene [[CCDirector sharedDirector] runWithScene: [HelloWorldLayer scene]]; @end } - (void)applicationWillResignActive:(UIApplication *)application { [[CCDirector sharedDirector] pause]; } - (void)applicationDidBecomeActive:(UIApplication *)application { [[CCDirector sharedDirector] resume]; } - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { [[CCDirector sharedDirector] purgeCachedData]; } -(void) applicationDidEnterBackground:(UIApplication*)application { [[CCDirector sharedDirector] stopAnimation]; } -(void) applicationWillEnterForeground:(UIApplication*)application { } [[CCDirector sharedDirector] startAnimation]; - (void)applicationWillTerminate:(UIApplication *)application { 17 CCDirector *director = [CCDirector sharedDirector]; [[director openGLView] removeFromSuperview];Monday, January 16, 12 [viewController release];
    18. 18. local config = { KKStartupConfig = { -- load first scene from a class with this name, or from a Lua script with this name with .lua appended FirstSceneClassName = "HelloWorldLayer", -- set the director type, and the fallback in case the first isnt available DirectorType = DirectorType.DisplayLink, DirectorTypeFallback = DirectorType.NSTimer, MaxFrameRate = 60, DisplayFPS = YES, EnableUserInteraction = YES, EnableMultiTouch = NO, -- ~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ } return config int fps = [[KKStartupConfig config] maxFrameRate]; 18Monday, January 16, 12
    19. 19. 19Monday, January 16, 12
    20. 20. KKInput* input = [KKInput sharedInput]; input.accelerometerActive = YES; if (input.acceleration) { KKAcceleration* acceleration = input.acceleration; NSLog(@"%f, %f", acceleration.smoothedX, acceleration.smoothedY); } KKInput* input = [KKInput sharedInput]; input.gestureRotationEnabled = YES; input.gesturePinchEnabled = YES; if (input.gesturesAvailable) { NSLog(@"%f, %f", input.gestureRotationAngle, input.gesturePinchScale); } 20Monday, January 16, 12
    21. 21. 21Monday, January 16, 12
    22. 22. -- iAd setup EnableAdBanner = YES, PlaceBannerOnBottom = YES, LoadOnlyPortraitBanners = NO, LoadOnlyLandscapeBanners = NO, AdProviders = "iAd, AdMob", -- comma seperated list -> "iAd, AdMob" means: use iAd if available, otherwise AdMob AdMobRefreshRate = 15, AdMobFirstAdDelay = 5, AdMobPublisherID = "YOUR_ADMOB_PUBLISHER_ID", -- how to get an AdMob Publisher ID: http://developer.admob.com/wiki/PublisherSetup AdMobTestMode = YES, 22Monday, January 16, 12
    23. 23. [[OALSimpleAudio sharedInstance] playBg:@"bgm.caf" loop:YES]; 23Monday, January 16, 12
    24. 24. 24Monday, January 16, 12
    25. 25. 25Monday, January 16, 12
    26. 26. 26Monday, January 16, 12
    27. 27. 27Monday, January 16, 12
    28. 28. 28Monday, January 16, 12
    29. 29. 29Monday, January 16, 12
    30. 30. 30Monday, January 16, 12
    31. 31. 31Monday, January 16, 12
    32. 32. 9% 3% 88% 32Monday, January 16, 12
    33. 33. 33Monday, January 16, 12
    34. 34. (´ ω ) 34Monday, January 16, 12
    35. 35. 35Monday, January 16, 12
    36. 36. 36Monday, January 16, 12
    37. 37. 37Monday, January 16, 12
    38. 38. 38Monday, January 16, 12
    39. 39. 39Monday, January 16, 12
    40. 40. 40Monday, January 16, 12
    41. 41. 41Monday, January 16, 12
    42. 42. 42Monday, January 16, 12
    43. 43. 43Monday, January 16, 12
    44. 44. 44Monday, January 16, 12
    45. 45. 45Monday, January 16, 12

    ×