cocos2d                HungryMasterxionchannel software
cocos2d                HungryMasterxionchannel software
twitter: @ajinotatakiemail: xionchannel@gmail.comSolid Dots, ElectroMaster,HungryMaster
…              CCLayer         CCLayerCCMenu
http://xionchannel.no-ip.org/
http://xionchannel.no-ip.org/
OverTopLayer
OverTopLayer
OverTopLayer
OverTopLayer
OverTopLayer
OverTopLayer
OverTopLayerCCScene                 CCLayerCCScene                 CCLayer          touch event
CCScene                 CCLayerCCScene   LayerBelow          OverTopLayer
CCScene                 CCLayerCCScene   LayerBelow          OverTopLayer
CCScene   CCLayer
CCScene   CCLayer
CCScene   CCLayer
CCScene                                    CCLayer+(MainScene*)sceneWithLayerTop:(CCLayer*)layerTop           layerBelow:(...
CCLayer- (BOOL)transitionFadeWithLayer:(CCLayer*)layer               duration:(ccTime)d;- (BOOL)transitionFlowerWithLayer:...
touch event
emFontProportional
emFontProportional
emFontProportional
emFontProportionalplist                    pngSplitter        plist                …
plist
pngSplitter
plist        →
…@”This is <B>blue<> and <G>green<>.”→“This is blue and green.”- (void) setColor:(ccColor3B)_color;- (void) setCentering:(...
emScrollLayer
touch moved
- (void)setScrollAreaWithMinPosition:(CGPoint)min                 maxPosition:(CGPoint)max;- (void)setVerticalScrollEnable...
CGPoint uiViewPos = [myTouch locationInView:[myTouch view]];CGPoint cocosPos = [[CCDirector sharedDirector] convertToGL:ui...
emMenuCCMenuemFontProportional
CCMenuCCMenuItemsAlign              selector
CCMenu
CCMenu
CCMenu
emFontProportionalNSString *txt[] = { @"0:                                  ", @"1:                   ", @"2: Third Item",...
emFontProportionalCGPoint uiViewPos = [myTouch locationInView:[myTouch view]];CGPoint cocosPos = [[CCDirector sharedDirect...
+ (emMenu*)menuWithCursor:(CCNode*)tcursor;- (void)addItem:(id)item;- (void)addItem:(id)item enable:(BOOL)isEnable;- (int)...
iPhone
Target PointElectroMasterMMOemChara
Virtual Pad RelativeemChara
Virtual Pad Fixed
One more thing...
One more thing...
iCadeiCade    BluetoothKeyDown, KeyUpSDK            delegate
iCade@protocol iCadeEventDelegate <NSObject>@optional- (void)stateChanged:(iCadeState)state;- (void)buttonDown:(iCadeState...
iCadetypedef enum iCadeState {   iCadeJoystickNone    = 0x000,   iCadeJoystickUp     = 0x001,   iCadeJoystickRight  = 0x00...
iCadeiCadeState s = iCadeControl.iCadeState;if (s) { CGPoint acc = ccp(0,0); if (s & iCadeJoystickUp) acc.y = 0.25f; if (s...
cocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装から
cocos2d 事例編 HungryMasterの実装から
Upcoming SlideShare
Loading in …5
×

cocos2d 事例編 HungryMasterの実装から

3,666 views

Published on

Published in: Technology, Business

cocos2d 事例編 HungryMasterの実装から

  1. 1. cocos2d HungryMasterxionchannel software
  2. 2. cocos2d HungryMasterxionchannel software
  3. 3. twitter: @ajinotatakiemail: xionchannel@gmail.comSolid Dots, ElectroMaster,HungryMaster
  4. 4. … CCLayer CCLayerCCMenu
  5. 5. http://xionchannel.no-ip.org/
  6. 6. http://xionchannel.no-ip.org/
  7. 7. OverTopLayer
  8. 8. OverTopLayer
  9. 9. OverTopLayer
  10. 10. OverTopLayer
  11. 11. OverTopLayer
  12. 12. OverTopLayer
  13. 13. OverTopLayerCCScene CCLayerCCScene CCLayer touch event
  14. 14. CCScene CCLayerCCScene LayerBelow OverTopLayer
  15. 15. CCScene CCLayerCCScene LayerBelow OverTopLayer
  16. 16. CCScene CCLayer
  17. 17. CCScene CCLayer
  18. 18. CCScene CCLayer
  19. 19. CCScene CCLayer+(MainScene*)sceneWithLayerTop:(CCLayer*)layerTop layerBelow:(CCLayer*)layerBelow{ MainScene *scene = [MainScene node]; layerTop.tag = kLayerTop; layerBelow.tag = kLayerBelow; [scene addChild:layerBelow z:0]; [scene addChild:layerTop z:2]; return scene;}
  20. 20. CCLayer- (BOOL)transitionFadeWithLayer:(CCLayer*)layer duration:(ccTime)d;- (BOOL)transitionFlowerWithLayer:(CCLayer*)layer duration:(ccTime)d;
  21. 21. touch event
  22. 22. emFontProportional
  23. 23. emFontProportional
  24. 24. emFontProportional
  25. 25. emFontProportionalplist pngSplitter plist …
  26. 26. plist
  27. 27. pngSplitter
  28. 28. plist →
  29. 29. …@”This is <B>blue<> and <G>green<>.”→“This is blue and green.”- (void) setColor:(ccColor3B)_color;- (void) setCentering:(CGPoint)center;- (void) setRighting:(CGPoint)right;- (BOOL) isHitByPosition:(CGPoint)pos;- (void) transferAllChildrenToNewParent:(CCNode*)node;- (void) transferAllChildrenToNewParent:(CCNode*)node z:(int)z;- (void) runEachNodeWithAction:(id)action;
  30. 30. emScrollLayer
  31. 31. touch moved
  32. 32. - (void)setScrollAreaWithMinPosition:(CGPoint)min maxPosition:(CGPoint)max;- (void)setVerticalScrollEnable:(BOOL)enable;- (void)setHorizontalScrollEnable:(BOOL)enable;
  33. 33. CGPoint uiViewPos = [myTouch locationInView:[myTouch view]];CGPoint cocosPos = [[CCDirector sharedDirector] convertToGL:uiViewPos];//cocosPos = ccpSub(cocosPos, self.position); if ([nextButton isHitByPosition:cocosPos]) { //}
  34. 34. emMenuCCMenuemFontProportional
  35. 35. CCMenuCCMenuItemsAlign selector
  36. 36. CCMenu
  37. 37. CCMenu
  38. 38. CCMenu
  39. 39. emFontProportionalNSString *txt[] = { @"0: ", @"1: ", @"2: Third Item", @"3: 4th Item",};for(int i=0; i<4; i++) { f = [emFontProportional fontWithText:txt[i]]; f.position = ccp(size.width/2-80, size.height/2-i*32); [self addChild:f]; [menu addItem:f];}[menu selectMenuWithNumber:0];
  40. 40. emFontProportionalCGPoint uiViewPos = [myTouch locationInView:[myTouch view]];CGPoint cocosPos = [[CCDirector sharedDirector] convertToGL:uiViewPos];int num = [menu getHitItemNumberWithPosition:cocosPos];[selectedNumberText setText: [NSString stringWithFormat:@"Selected Number: %d",num]];
  41. 41. + (emMenu*)menuWithCursor:(CCNode*)tcursor;- (void)addItem:(id)item;- (void)addItem:(id)item enable:(BOOL)isEnable;- (int)getHitItemNumberWithPosition:(CGPoint)pos;- (int)getHitItemNumberWithPosition:(CGPoint)pos withSelection:(BOOL)selection;- (void)selectMenuWithNumber:(int)num;
  42. 42. iPhone
  43. 43. Target PointElectroMasterMMOemChara
  44. 44. Virtual Pad RelativeemChara
  45. 45. Virtual Pad Fixed
  46. 46. One more thing...
  47. 47. One more thing...
  48. 48. iCadeiCade BluetoothKeyDown, KeyUpSDK delegate
  49. 49. iCade@protocol iCadeEventDelegate <NSObject>@optional- (void)stateChanged:(iCadeState)state;- (void)buttonDown:(iCadeState)button;- (void)buttonUp:(iCadeState)button;@end
  50. 50. iCadetypedef enum iCadeState { iCadeJoystickNone = 0x000, iCadeJoystickUp = 0x001, iCadeJoystickRight = 0x002, iCadeJoystickDown = 0x004, iCadeJoystickLeft = 0x008, iCadeJoystickUpRight = iCadeJoystickUp | iCadeJoystickRight, iCadeJoystickDownRight = iCadeJoystickDown | iCadeJoystickRight, iCadeJoystickUpLeft = iCadeJoystickUp | iCadeJoystickLeft, iCadeJoystickDownLeft = iCadeJoystickDown | iCadeJoystickLeft, iCadeButtonA = 0x010, iCadeButtonB = 0x020, iCadeButtonC = 0x040, iCadeButtonD = 0x080, iCadeButtonE = 0x100, iCadeButtonF = 0x200, iCadeButtonG = 0x400, iCadeButtonH = 0x800,} iCadeState;
  51. 51. iCadeiCadeState s = iCadeControl.iCadeState;if (s) { CGPoint acc = ccp(0,0); if (s & iCadeJoystickUp) acc.y = 0.25f; if (s & iCadeJoystickDown) acc.y = -0.25f; if (s & iCadeJoystickLeft) acc.x = -0.25f; if (s & iCadeJoystickRight) acc.x = 0.25f; CGPoint vec = ccpMult(ccpNormalize(acc), 40); if (acc.x==0 && acc.y==0) { controlArrowDirection.visible = NO; } else { if (controlMethod==kControlVirtualPadFixed) { controlArrowDirection.visible = YES; controlArrowDirection.position = ccpAdd(vec, controlArrow.position); } [chara setCharaAccelVector:vec]; }}

×