SlideShare ist ein Scribd-Unternehmen logo
1 von 45
Downloaden Sie, um offline zu lesen
1
Monday, January 16, 12
2
Monday, January 16, 12
3
Monday, January 16, 12
4
Monday, January 16, 12
cocos2d for iPhone




                                              5
Monday, January 16, 12
6
Monday, January 16, 12
7
Monday, January 16, 12
8
Monday, January 16, 12
9
Monday, January 16, 12
10
Monday, January 16, 12
11
Monday, January 16, 12
12
Monday, January 16, 12
13
Monday, January 16, 12
14
Monday, January 16, 12
15
Monday, January 16, 12
16
Monday, January 16, 12
/*
                         //
                         //   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];
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 isn't
                         available
                             DirectorType = DirectorType.DisplayLink,
                             DirectorTypeFallback = DirectorType.NSTimer,

                               MaxFrameRate = 60,
                               DisplayFPS = YES,

                               EnableUserInteraction = YES,
                               EnableMultiTouch = NO,
                                -- ~~~~~~~~~~~~~~~~~~~~~    ~~~~~~~~~~~~~~~~~~~~~
                         }

                         return config


                             int fps = [[KKStartupConfig config] maxFrameRate];

                                                                                                      18
Monday, January 16, 12
19
Monday, January 16, 12
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);
                         }




                                                                                                    20
Monday, January 16, 12
21
Monday, January 16, 12
-- 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,




                                                                                                     22
Monday, January 16, 12
[[OALSimpleAudio sharedInstance] playBg:@"bgm.caf" loop:YES];




                                                                                         23
Monday, January 16, 12
24
Monday, January 16, 12
25
Monday, January 16, 12
26
Monday, January 16, 12
27
Monday, January 16, 12
28
Monday, January 16, 12
29
Monday, January 16, 12
30
Monday, January 16, 12
31
Monday, January 16, 12
9% 3%




                            88%




                                  32
Monday, January 16, 12
33
Monday, January 16, 12
(´   ω   )




                                      34
Monday, January 16, 12
35
Monday, January 16, 12
36
Monday, January 16, 12
37
Monday, January 16, 12
38
Monday, January 16, 12
39
Monday, January 16, 12
40
Monday, January 16, 12
41
Monday, January 16, 12
42
Monday, January 16, 12
43
Monday, January 16, 12
44
Monday, January 16, 12
45
Monday, January 16, 12

Weitere ähnliche Inhalte

Was ist angesagt?

Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Opersys inc.
 
Inside Android's UI at AnDevCon VI
Inside Android's UI at AnDevCon VIInside Android's UI at AnDevCon VI
Inside Android's UI at AnDevCon VI
Opersys inc.
 

Was ist angesagt? (11)

Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013Inside Android's UI / ABS 2013
Inside Android's UI / ABS 2013
 
Embedded Android Workshop at ELC Europe
Embedded Android Workshop at ELC EuropeEmbedded Android Workshop at ELC Europe
Embedded Android Workshop at ELC Europe
 
Gdg san diego android 11 meetups what's new in android - ui and dev tools
Gdg san diego android 11 meetups  what's new in android  - ui and dev toolsGdg san diego android 11 meetups  what's new in android  - ui and dev tools
Gdg san diego android 11 meetups what's new in android - ui and dev tools
 
Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3
 
Android Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and ResourcesAndroid Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and Resources
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
Native Android Userspace part of the Embedded Android Workshop at Linaro Conn...
 
DIY Uber
DIY UberDIY Uber
DIY Uber
 
Inside Android's UI at AnDevCon VI
Inside Android's UI at AnDevCon VIInside Android's UI at AnDevCon VI
Inside Android's UI at AnDevCon VI
 

Andere mochten auch (6)

はてな技術勉強会 #4LT「札幌ゲーム制作者コミュニティKawaz」について
はてな技術勉強会 #4LT「札幌ゲーム制作者コミュニティKawaz」についてはてな技術勉強会 #4LT「札幌ゲーム制作者コミュニティKawaz」について
はてな技術勉強会 #4LT「札幌ゲーム制作者コミュニティKawaz」について
 
はてなインターンシップ2011、ワークショップ発表プレゼン
はてなインターンシップ2011、ワークショップ発表プレゼンはてなインターンシップ2011、ワークショップ発表プレゼン
はてなインターンシップ2011、ワークショップ発表プレゼン
 
TDDBC 札幌 2.0自己紹介スライド
TDDBC 札幌 2.0自己紹介スライドTDDBC 札幌 2.0自己紹介スライド
TDDBC 札幌 2.0自己紹介スライド
 
【TDDBC2.1】やる夫で学ぶTDD
【TDDBC2.1】やる夫で学ぶTDD【TDDBC2.1】やる夫で学ぶTDD
【TDDBC2.1】やる夫で学ぶTDD
 
cocos2d入門
cocos2d入門cocos2d入門
cocos2d入門
 
Lemonade-original keynote theme.
Lemonade-original keynote theme.Lemonade-original keynote theme.
Lemonade-original keynote theme.
 

Ähnlich wie Kobold2Dで始めるゲーム開発

Android Platform Debugging and Development at ELCE 2013
Android Platform Debugging and Development at ELCE 2013Android Platform Debugging and Development at ELCE 2013
Android Platform Debugging and Development at ELCE 2013
Opersys inc.
 
Quickly function add by Eclipse Monkey
Quickly function add by Eclipse MonkeyQuickly function add by Eclipse Monkey
Quickly function add by Eclipse Monkey
bose999
 
Android Platform Debugging and Development at ABS 2014
Android Platform Debugging and Development at ABS 2014Android Platform Debugging and Development at ABS 2014
Android Platform Debugging and Development at ABS 2014
Opersys inc.
 
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2DIphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
creagamers
 
Quick Start to iOS Development
Quick Start to iOS DevelopmentQuick Start to iOS Development
Quick Start to iOS Development
Jussi Pohjolainen
 

Ähnlich wie Kobold2Dで始めるゲーム開発 (20)

AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS Architecture
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS Internal
 
iOS
iOSiOS
iOS
 
Android Platform Debugging and Development at ELCE 2013
Android Platform Debugging and Development at ELCE 2013Android Platform Debugging and Development at ELCE 2013
Android Platform Debugging and Development at ELCE 2013
 
Quickly function add by Eclipse Monkey
Quickly function add by Eclipse MonkeyQuickly function add by Eclipse Monkey
Quickly function add by Eclipse Monkey
 
How to build the Web
How to build the WebHow to build the Web
How to build the Web
 
Code to DI For - Dependency Injection for Modern Applications
Code to DI For - Dependency Injection for Modern ApplicationsCode to DI For - Dependency Injection for Modern Applications
Code to DI For - Dependency Injection for Modern Applications
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Android Platform Debugging and Development at ABS 2014
Android Platform Debugging and Development at ABS 2014Android Platform Debugging and Development at ABS 2014
Android Platform Debugging and Development at ABS 2014
 
Hacking the Codename One Source Code - Part V - Transcript.pdf
Hacking the Codename One Source Code - Part V - Transcript.pdfHacking the Codename One Source Code - Part V - Transcript.pdf
Hacking the Codename One Source Code - Part V - Transcript.pdf
 
Android Platform Debugging & Development
Android Platform Debugging & Development Android Platform Debugging & Development
Android Platform Debugging & Development
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
 
Developing and deploying applications with Spring Boot and Docker (@oakjug)
Developing and deploying applications with Spring Boot and Docker (@oakjug)Developing and deploying applications with Spring Boot and Docker (@oakjug)
Developing and deploying applications with Spring Boot and Docker (@oakjug)
 
Iphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2DIphone and Ipad development Game with Cocos2D
Iphone and Ipad development Game with Cocos2D
 
LISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsLISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial Handouts
 
Quick Start to iOS Development
Quick Start to iOS DevelopmentQuick Start to iOS Development
Quick Start to iOS Development
 
GDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWSGDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWS
 
JavaScript, React Native and Performance at react-europe 2016
JavaScript, React Native and Performance at react-europe 2016JavaScript, React Native and Performance at react-europe 2016
JavaScript, React Native and Performance at react-europe 2016
 
Titanium appcelerator best practices
Titanium appcelerator best practicesTitanium appcelerator best practices
Titanium appcelerator best practices
 
How to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDKHow to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDK
 

Mehr von Kohki Miki

Decksetがよかった話
Decksetがよかった話Decksetがよかった話
Decksetがよかった話
Kohki Miki
 
VOXCHRONICLE企画草案
VOXCHRONICLE企画草案VOXCHRONICLE企画草案
VOXCHRONICLE企画草案
Kohki Miki
 
〜ゲーム制作を始めてみよう〜 Kawaz入会希望者向けスライド
〜ゲーム制作を始めてみよう〜 Kawaz入会希望者向けスライド〜ゲーム制作を始めてみよう〜 Kawaz入会希望者向けスライド
〜ゲーム制作を始めてみよう〜 Kawaz入会希望者向けスライド
Kohki Miki
 

Mehr von Kohki Miki (17)

watchOS 2でゲーム作ってみた話
watchOS 2でゲーム作ってみた話watchOS 2でゲーム作ってみた話
watchOS 2でゲーム作ってみた話
 
cocos2d-consoleでパッケージ管理
cocos2d-consoleでパッケージ管理cocos2d-consoleでパッケージ管理
cocos2d-consoleでパッケージ管理
 
エターナらないゲーム開発
エターナらないゲーム開発エターナらないゲーム開発
エターナらないゲーム開発
 
ゲームコミュニティサミット2014に参加してきた話
ゲームコミュニティサミット2014に参加してきた話ゲームコミュニティサミット2014に参加してきた話
ゲームコミュニティサミット2014に参加してきた話
 
ゲームコミュニティサミット2014「*いどのなかにいる*」
ゲームコミュニティサミット2014「*いどのなかにいる*」ゲームコミュニティサミット2014「*いどのなかにいる*」
ゲームコミュニティサミット2014「*いどのなかにいる*」
 
札幌ゲーム製作者コミュニティKawaz「いどのなかにいる」
札幌ゲーム製作者コミュニティKawaz「いどのなかにいる」札幌ゲーム製作者コミュニティKawaz「いどのなかにいる」
札幌ゲーム製作者コミュニティKawaz「いどのなかにいる」
 
Kawaz Hipchat超入門
Kawaz Hipchat超入門Kawaz Hipchat超入門
Kawaz Hipchat超入門
 
Kawaz Third Impact
Kawaz Third ImpactKawaz Third Impact
Kawaz Third Impact
 
Decksetがよかった話
Decksetがよかった話Decksetがよかった話
Decksetがよかった話
 
Unite Japanに参加してきた話
Unite Japanに参加してきた話Unite Japanに参加してきた話
Unite Japanに参加してきた話
 
nomad-cliの紹介
nomad-cliの紹介nomad-cliの紹介
nomad-cliの紹介
 
cocos2d-x 3.0 + C++11で始めるゲーム開発超入門
cocos2d-x 3.0 + C++11で始めるゲーム開発超入門cocos2d-x 3.0 + C++11で始めるゲーム開発超入門
cocos2d-x 3.0 + C++11で始めるゲーム開発超入門
 
VOXCHRONICLE企画草案
VOXCHRONICLE企画草案VOXCHRONICLE企画草案
VOXCHRONICLE企画草案
 
〜ゲーム制作を始めてみよう〜 Kawaz入会希望者向けスライド
〜ゲーム制作を始めてみよう〜 Kawaz入会希望者向けスライド〜ゲーム制作を始めてみよう〜 Kawaz入会希望者向けスライド
〜ゲーム制作を始めてみよう〜 Kawaz入会希望者向けスライド
 
Kawaz的jQuery入門
Kawaz的jQuery入門Kawaz的jQuery入門
Kawaz的jQuery入門
 
cocos2で始める iPhoneゲーム開発入門
cocos2で始める iPhoneゲーム開発入門cocos2で始める iPhoneゲーム開発入門
cocos2で始める iPhoneゲーム開発入門
 
PyGame入門
PyGame入門PyGame入門
PyGame入門
 

Kürzlich hochgeladen

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

Kobold2Dで始めるゲーム開発

  • 5. cocos2d for iPhone 5 Monday, January 16, 12
  • 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. 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 isn't available DirectorType = DirectorType.DisplayLink, DirectorTypeFallback = DirectorType.NSTimer, MaxFrameRate = 60, DisplayFPS = YES, EnableUserInteraction = YES, EnableMultiTouch = NO, -- ~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ } return config int fps = [[KKStartupConfig config] maxFrameRate]; 18 Monday, January 16, 12
  • 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); } 20 Monday, January 16, 12
  • 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, 22 Monday, January 16, 12
  • 23. [[OALSimpleAudio sharedInstance] playBg:@"bgm.caf" loop:YES]; 23 Monday, January 16, 12
  • 32. 9% 3% 88% 32 Monday, January 16, 12
  • 34. ω ) 34 Monday, January 16, 12

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. &amp;#x73FE;&amp;#x4EE3;&amp;#x30A2;&amp;#x30FC;&amp;#x30C8;&amp;#x3000;&amp;#x8DA3;&amp;#x5473;&amp;#x60AA;&amp;#x3044;\n
  14. \n
  15. \n
  16. &amp;#x65B0;&amp;#x898F;&amp;#x4F5C;&amp;#x6210;&amp;#x6642;&amp;#x306E;&amp;#x30B3;&amp;#x30FC;&amp;#x30C9;&amp;#x91CF;&amp;#x3000;&amp;#x30B4;&amp;#x30DF;&amp;#x306E;&amp;#x3088;&amp;#x3046;&amp;#x3060;\n
  17. &amp;#x30B9;&amp;#x30AF;&amp;#x30EA;&amp;#x30D7;&amp;#x30C8;&amp;#x3001;&amp;#x8A2D;&amp;#x5B9A;&amp;#x30D5;&amp;#x30A1;&amp;#x30A4;&amp;#x30EB;&amp;#x3068;&amp;#x304B; plist&amp;#x4F7F;&amp;#x308F;&amp;#x306A;&amp;#x304F;&amp;#x3066;&amp;#x826F;&amp;#x3044;&amp;#xFF01;&amp;#xFF01;&amp;#xFF01;\n
  18. \n
  19. &amp;#x30BF;&amp;#x30C3;&amp;#x30C1;&amp;#x30B8;&amp;#x30A7;&amp;#x30B9;&amp;#x30C1;&amp;#x30E3;&amp;#x30FC;\n&amp;#x30BF;&amp;#x30C3;&amp;#x30C1;&amp;#x3001;&amp;#x3060;&amp;#x3076;&amp;#x308B;&amp;#x305F;&amp;#x3063;&amp;#x3061;&amp;#x3001;&amp;#x30D4;&amp;#x30F3;&amp;#x30C1;&amp;#x3001;&amp;#x30ED;&amp;#x30FC;&amp;#x30C6;&amp;#x30FC;&amp;#x30B7;&amp;#x30E7;&amp;#x30F3;&amp;#x3001;&amp;#x30B9;&amp;#x30EF;&amp;#x30A4;&amp;#x30D7;&amp;#x306A;&amp;#x3069;&amp;#x304C;&amp;#x7C21;&amp;#x5358;&amp;#x306B;&amp;#x53D6;&amp;#x5F97;&amp;#x3067;&amp;#x304D;&amp;#x308B;&amp;#xFF01;\n
  20. &amp;#x5916;&amp;#x90E8;&amp;#x30E9;&amp;#x30A4;&amp;#x30D6;&amp;#x30E9;&amp;#x30EA;SneakyInput\n\n
  21. \n
  22. &amp;#x97F3;&amp;#x306A;&amp;#x3089;&amp;#x3059;&amp;#x3060;&amp;#x3051;&amp;#x306A;&amp;#x3089;&amp;#x7C21;&amp;#x5358;\n&amp;#x8907;&amp;#x96D1;&amp;#x306A;&amp;#x3053;&amp;#x3068;&amp;#x3082;&amp;#x3067;&amp;#x304D;&amp;#x307E;&amp;#x3059;\n
  23. Kawaz&amp;#x6240;&amp;#x5C5E;&amp;#x3000;&amp;#x8208;&amp;#x5473;&amp;#x3042;&amp;#x3063;&amp;#x305F;&amp;#x3089;&amp;#x6765;&amp;#x3066;&amp;#x304F;&amp;#x3060;&amp;#x3055;&amp;#x3044;&amp;#xFF01;\n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. &amp;#x3044;&amp;#x304D;&amp;#x306A;&amp;#x308A;&amp;#x3067;&amp;#x3059;&amp;#x304C;&amp;#x3001;&amp;#x7686;&amp;#x69D8;&amp;#x3001;Newsstand&amp;#x3092;&amp;#x5229;&amp;#x7528;&amp;#x3055;&amp;#x308C;&amp;#x3066;&amp;#x3044;&amp;#x308B;&amp;#x65B9;&amp;#x304C;&amp;#x3044;&amp;#x307E;&amp;#x3057;&amp;#x305F;&amp;#x3089;&amp;#x3001;&amp;#x6319;&amp;#x624B;&amp;#x3092;&amp;#x304A;&amp;#x9858;&amp;#x3044;&amp;#x3057;&amp;#x307E;&amp;#x3059;\n\n&amp;#x5C11;&amp;#x306A;&amp;#x3044;&amp;#x3067;&amp;#x3059;&amp;#x306D;&amp;#x3002;\n
  31. &amp;#x304A;&amp;#x305D;&amp;#x3089;&amp;#x304F;&amp;#x3001;&amp;#x6982;&amp;#x306D;&amp;#x3053;&amp;#x3046;&amp;#x3044;&amp;#x3046;&amp;#x7D50;&amp;#x679C;&amp;#x306B;&amp;#x306A;&amp;#x308B;&amp;#x306E;&amp;#x3067;&amp;#x306F;&amp;#x306A;&amp;#x3044;&amp;#x304B;&amp;#x3068;&amp;#x601D;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n\n&amp;#x3053;&amp;#x306E;&amp;#x8ABF;&amp;#x67FB;&amp;#x7D50;&amp;#x679C;&amp;#x306F;&amp;#x3001;&amp;#x50D5;&amp;#x306E;&amp;#x8133;&amp;#x5185;&amp;#x8ABF;&amp;#x3079;&amp;#x3067;&amp;#x3059;&amp;#x304C;&amp;#x3001;Google&amp;#x5148;&amp;#x751F;&amp;#x306B;&amp;#x805E;&amp;#x3044;&amp;#x3066;&amp;#x307F;&amp;#x308B;&amp;#x3068;\n
  32. &amp;#x3053;&amp;#x3046;&amp;#x3044;&amp;#x3046;&amp;#x7D50;&amp;#x679C;&amp;#x304C;&amp;#x51FA;&amp;#x3066;&amp;#x304F;&amp;#x308B;&amp;#x306E;&amp;#x304C;&amp;#x5168;&amp;#x3066;&amp;#x3092;&amp;#x7269;&amp;#x8A9E;&amp;#x3063;&amp;#x3066;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  33. Newsstand&amp;#x306F;&amp;#x3044;&amp;#x3089;&amp;#x306A;&amp;#x3044;&amp;#x5B50;\n
  34. \n
  35. iOS&amp;#x30E6;&amp;#x30FC;&amp;#x30B6;&amp;#x30FC;&amp;#x3067;&amp;#x3042;&amp;#x308B;&amp;#x8CE2;&amp;#x660E;&amp;#x306A;&amp;#x7686;&amp;#x69D8;&amp;#x3067;&amp;#x3042;&amp;#x308C;&amp;#x3070;&amp;#x3001;&amp;#x3053;&amp;#x306E;&amp;#x3088;&amp;#x3046;&amp;#x306A;&amp;#x3044;&amp;#x3089;&amp;#x306A;&amp;#x3044;&amp;#x30D5;&amp;#x30A9;&amp;#x30EB;&amp;#x30C0;&amp;#x3092;&amp;#x4F5C;&amp;#x6210;&amp;#x3055;&amp;#x308C;&amp;#x3066;&amp;#x3044;&amp;#x308B;&amp;#x3053;&amp;#x3068;&amp;#x3068;&amp;#x601D;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n&amp;#x300C;&amp;#x53CB;&amp;#x9054;&amp;#x3092;&amp;#x63A2;&amp;#x3059;&amp;#x300D;&amp;#x30A2;&amp;#x30D7;&amp;#x30EA;&amp;#x3068;&amp;#x304B;&amp;#x3082;&amp;#x96A0;&amp;#x305B;&amp;#x3066;&amp;#x3001;&amp;#x63A2;&amp;#x3059;&amp;#x53CB;&amp;#x9054;&amp;#x3044;&amp;#x306A;&amp;#x3044;&amp;#x6211;&amp;#x3005;&amp;#x3082;&amp;#x5B89;&amp;#x5FC3;&amp;#x3067;&amp;#x3059;&amp;#x306D;\n
  36. \n
  37. &amp;#x3053;&amp;#x306E;&amp;#x3088;&amp;#x3046;&amp;#x306B;&amp;#x3001;&amp;#x975E;&amp;#x5E38;&amp;#x306B;&amp;#x30B7;&amp;#x30D3;&amp;#x30A2;&amp;#x306A;&amp;#x306E;&amp;#x3067;&amp;#x3001;&amp;#x8A66;&amp;#x3055;&amp;#x308C;&amp;#x3066;&amp;#x3082;&amp;#x4E0A;&amp;#x624B;&amp;#x304F;&amp;#x3044;&amp;#x304B;&amp;#x306A;&amp;#x304B;&amp;#x3063;&amp;#x305F;&amp;#x65B9;&amp;#x304C;&amp;#x591A;&amp;#x3044;&amp;#x3068;&amp;#x601D;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x304C;&amp;#x3001;10&amp;#x5206;&amp;#x3050;&amp;#x3089;&amp;#x3044;&amp;#x7DF4;&amp;#x7FD2;&amp;#x3057;&amp;#x305F;&amp;#x3089;&amp;#x767E;&amp;#x767A;&amp;#x767E;&amp;#x4E2D;&amp;#x306B;&amp;#x306A;&amp;#x3063;&amp;#x305F;&amp;#x306E;&amp;#x3067;\n\n&amp;#x4ECA;&amp;#x56DE;&amp;#x306F;iPhone&amp;#x6280;&amp;#x8853;&amp;#x52C9;&amp;#x5F37;&amp;#x4F1A;&amp;#x3068;&amp;#x8A00;&amp;#x3046;&amp;#x3053;&amp;#x3068;&amp;#x306A;&amp;#x306E;&amp;#x3067;&amp;#x300C;Newsstand&amp;#x300D;&amp;#x3092;&amp;#x30D5;&amp;#x30A9;&amp;#x30EB;&amp;#x30C0;&amp;#x306B;&amp;#x7A81;&amp;#x3063;&amp;#x8FBC;&amp;#x3080;&amp;#x6280;&amp;#x8853;&amp;#x306B;&amp;#x3064;&amp;#x3044;&amp;#x3066;&amp;#x304A;&amp;#x8A71;&amp;#x3057;&amp;#x3057;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  38. \n
  39. \n
  40. &amp;#x52D5;&amp;#x753B;&amp;#x3092;&amp;#x30AD;&amp;#x30E3;&amp;#x30D7;&amp;#x30C1;&amp;#x30E3;&amp;#x3057;&amp;#x305F;&amp;#x306E;&amp;#x3067;&amp;#x3001;&amp;#x898B;&amp;#x306B;&amp;#x304F;&amp;#x304F;&amp;#x3066;&amp;#x6050;&amp;#x7E2E;&amp;#x3067;&amp;#x3059;&amp;#x304C;\n
  41. \n
  42. &amp;#x7DF4;&amp;#x7FD2;&amp;#x3057;&amp;#x3066;&amp;#x3069;&amp;#x3046;&amp;#x3059;&amp;#x308B;&amp;#x3093;&amp;#x3060;&amp;#x3063;&amp;#x3066;&amp;#x611F;&amp;#x3058;&amp;#x3067;&amp;#x3059;&amp;#x3051;&amp;#x3069;&amp;#x306D;\n
  43. &amp;#x30DE;&amp;#x30C8;&amp;#x30EA;&amp;#x30E7;&amp;#x30B7;&amp;#x30AB;&amp;#x307F;&amp;#x305F;&amp;#x3044;&amp;#xFF01;\n
  44. \n