摘要:通信技术的发展,促使智能手机得到快速的发展。基于智能手机平台的软件如雨后春笋般喷涌而出。智能手机的软件服务覆盖着生活的各个各面,手机的增值业务已经成为通信公司的一个重要的组成部分,近年的发展手机的游戏业务已经成为一个非常庞大的产业链。随着3G、4G业务的不断扩展,智能手机的游戏业务也必将得到更大的推广,手机游戏也必将带来巨大的市场空间和经济价值。
本课题是针对苹果公司推出的新的智能手机操作系统iOS。iOS是由苹果公司为iPhone开发的操作系统。它主要是给iPhone、iPod touch以及iPad使用。就像其基于的Mac OS X操作系统一样,它也是以Darwin为基础的。原本这个系统名为iPhone OS,直到2010年6月7日WWDC大会上宣布改名为iOS。iOS的系统架构分为四个层次:核心操作系统层(the Core OS layer),核心服务层(the Core Services layer),媒体层(the Media layer),可轻触层(the Cocoa Touch layer)。
本课题是在cocos2d基础上进行游戏开发,进行UI设计,动画设计,SQLite数据库设计,并最终完成手机游戏。然后在模拟器上进行模拟并最终能实际应用于手机,供用户娱乐消遣。
下面着重把菜单的实现部分代码写出,希望大家可以共同学习。
switch (menu) {
[J1] case kWorldMap: {
WorldMapLayer* world = [ selfaddWorld ];
[[ MainMenuUIinst]debugEnable:YES ];
if ( [MyTutorial curID] ==TUTOT_QUEST_FT1-1 || [ MyTutorial curID] == TUTOR_QUEST_FT3-1 ) {
//
if ( [WorldMapLayerMY_QUEST] == 32004 || [ WorldMapLayer MY_QUEST] == 32006 ) {
[ MyTutorialremoveAll];
// [ MyTutorial nextSection ];
[world executeQuest];
[world pause];
}
}
break;
}
case kCardLib: {
if ( [ MyTutorial curID] ==TUTOR_Deck2-1 ) {
[ MyTutorial removeAll];
[ MyTutorial nextSection];
[ self switchToFormation];
} else {
className =@"CardLibraryMenu";
#ifdef VER_R2
arr = [NSArrayarrayWithObjects:LangWords(TextID_UI_Deck_Button_DeckManage),LangWords(TextID_UI_Deck_Button_Handbook),LangWords(TextID_UI_Deck_Button_Strengthen),LangWords(TextID_UI_Deck_Button_Merge),LangWords(@"TextID_UI_RedeemCode_Title"), nil];
#else
arr=[NSArray arrayWithObjects:LangWords(TextID_UI_Deck_Button_DeckManage),LangWords(TextID_UI_Deck_Button_Handbook),LangWords(TextID_UI_Deck_Button_Strengthen),LangWords(TextID_UI_Deck_Button_Merge), @"媒体邀请码", nil];
#endif
type = @"牌库";
}
break;
}
case kPVP: {
className =@"PVPMenu";
arr = [NSArrayarrayWithObjects:LangWords(TextID_UI_PVP_Button_Defense), LangWords(TextID_UI_PVP_Button_Free),LangWords(TextID_UI_PVP_Button_Friend), LangWords(TextID_UI_PVP_Button_Arena),LangWords(TextID_UI_PVP_Button_Rank), nil];
type = @"对战";
break;
}
case kShop: {
if (!SHOP_INDEX) {
SHOP_INDEX = 1;
}
[ self initShop:SHOP_INDEX ];
break;
}
case kReport: {
className =@"ReportMenu";
arr = [NSArrayarrayWithObjects:LangWords(TextID_UI_Report_Button_Log),LangWords(TextID_UI_Report_Button_FriendApply),LangWords(TextID_UI_EventReward_Describe_Invite),nil];
type = @"战报";
break;
}
case kSetting: {
className = @"SettingMenu";
arr = [NSArrayarrayWithObjects:LangWords(TextID_UI_Setting_Button_Account),LangWords(TextID_UI_Setting_Button_System),LangWords(TextID_UI_Setting_Button_Member),LangWords(TextID_UI_BattleResult_Button_Forum), nil];
type = @"信息";
break;
}
default:
break;
}