自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(40)
  • 资源 (39)
  • 收藏
  • 关注

原创 解决滚屏背景/拼接地图有黑边(缝隙)

如果解决拼接裂缝问题利用下面这行代码还是不给力的话 :[sprite.texture setAliasTexParameters];那么请继续利用下面这行代码:(放在AppDelegate.m 的applicationDidFinishLaunching方法中最后即可)[[CCDirector sharedDirector] setProjection:kC

2020-08-10 10:34:00 670

原创 release class under ARC

if u find [dealloc] was not called, check below:1/ set delegate = nil;2/ set some ivar = nil; ie:action & block

2020-08-10 10:30:57 453

原创 912sy浅析xcode 4.5 new feature __ ios6 新特性

上两周看了wwdc 2012 developer session 400 - 412的视频,下面总结一下xcode4.5的新特性。(部分参考onevcat的文章,在此感谢。)@synthesize by default(属性自动绑定)在xcode4.4以前,当我们想为类添加一个新的属性,一般都要对应写实例变量和相应的synthesis,但是在Xcode 4.4之后,sy

2020-08-10 10:30:25 483

原创 子弹跟踪算法

首先,本文讨论的是很简单的算法。高手莫入。在飞行射击游戏中,恐怕没有一个游戏不用到跟踪算法的。比如在玩街机的时候,是不是经常挂于BOSS的“跟踪弹”?这是怎样实现的呢?很简单,只要有高中的一点数学知识就行了!首先回忆几个三角函数sin,cos,tan(tg),arctan(arctg)sin(x)—对边/斜边。在1,2项限为正,3,4项限为负cos(x)—邻边/斜边

2020-08-10 10:28:42 3526 1

原创 Rockets to face in the direction it‘s going

I've been wondering, is there a feature where you can, like for my example, set the rotation of sprites depending on the direction it is going?For example :When i shoot the rocket upwards, it

2020-08-10 10:28:24 584

原创 How to make enemies follow your hero (seeking missiles)

I have seen some people looking for ways to create seeking missiles, or have enemies continually go towards the hero even if it is moving. I have seen people give solutions such as using boids (flocki

2020-08-10 10:28:00 418

原创 Heat-Seeking Missile Game Physics

We’re working on an iPhone game using the excellent cocos2d library. The game has a heat-seeking missile that attempts to collide with a game object. The initial implementation was one that just tra

2020-08-10 10:27:41 590

原创 seeking missile

Finally, what I did was just make a method that used the Pythagorean theorem to make the missile move the same distance to the banana every time the missileMove selector was called.I also made the

2020-08-10 10:27:24 507

原创 TMX Retina Display

For anyone trying to make this retina-compatible, here's what I did:1) You'll need 2 sets of files. Cocos2d will automatically use the HD files if they are named properly:TileMap.tmx (50x5

2020-08-10 10:27:05 804

原创 如何优化cocos2d程序的内存使用和程序大小:part-1

译者:在我完成第一个游戏项目的时候,我深切地意识到“使用cocos2d来制作游戏的开发者们,他们大多会被cocos2d的内存问题所困扰”。而我刚开始接触cocos2d的时候,社区里面的人们讨论了一个非常有意义的话题:“请简单地讲述你认为新手cocos2d程序员在他开始编码之前,最应该先知道,或者应该关注和注意的事项。”这个问题的答案很多,有人讲是“如何加载和保存游戏数据”,有人讲的是“如何实现

2020-08-10 10:26:29 617

原创 如何优化cocos2d程序的内存使用和程序大小:part-2

减少你的程序的大小把纹理的颜色位深度减少到16位,不仅可以减少内存压力,还可以有效地减少程序的体积。但是,我们还有其它方法可以更进一步地减少程序的大小。TexturePacker PNG 图片优化如果你有某些原因,让你坚持要使用PNG文件格式而不是我之前极力向你推荐的pvr.ccz文件格式,那么TexturePacker有一个选项,叫做“Png Opt Level

2020-08-10 10:25:19 541

原创 Box2D V2.x中SetAsEdge的替代方法

// Define the ground body.b2BodyDef groundBodyDef;groundBodyDef.position.Set(0,0);// bottom-left corner// Call the body factory which allocates memory for the ground body// from a po

2020-08-10 10:24:56 926

原创 912sy浅析Undefined symbols for architecture i386 ...

You can get this type of error if your class' .m file is not listed under the "Compile Sources" step of the "Build Phases" tab of your target. Normally Xcode does this for you, but sometimes it lose

2020-08-10 10:24:43 428

原创 Recursively removing XCode build directories

In Terminal,cdto the repository directory to be checked into SVNrm -rf `find . -type d -name build`This will remove all the build directories in all the sub directories e.g. when trunk c

2020-08-10 10:24:29 520

原创 如何将app打包成ipa文件,提供给客户测试(越狱机)

方法:a. 新建Payload资料夹b. 将编译生成.app放入Payload中c. 右键生成压缩档,将.zip后缀名改为.ipad. 连接jailbreak的iPod或iPhone,双击.ipa文件,同步即可安装成功

2020-08-10 10:24:04 1043

原创 “Header Search Paths” vs. “User Header Search Paths” in XCode?

Use the User Header Search Paths for paths you want searched for#include "..."and use the Header Search Paths for#include .Of course, if you check the option to Always Search User Paths,

2020-08-10 10:23:54 679

原创 Error: "lexical or preprocessor issue file not found" in Xcode 4

NB: The steps below will solve 90% of your Xcode archive issues however, from the comments it is suggested you tryquitting Xcodefirst. This may save you hours of setting tweaking.Check the

2020-08-10 10:23:38 3154

原创 CocosBuilder & iPhone 5 Resolution

CocosBuilder and cocos2d-iphone both now have support for the new iPhone 5 resolution, but when using CocosBuilder and fixed sized background images you still need to do a little custom coding as coco

2020-08-10 10:23:22 1312

原创 mac隐藏/显示文件

在 Mac 系统下最简单最方便的隐藏文件/文件夹的方法,就是一条终端的命令: chflags hidden (文件/文件夹的相对或绝对路径) 例如:chflags hidden /Users/Jay/Dropbox 重新显示已经隐藏的文件夹命令: chflags nohidden (文件/文件夹的相对或绝对路径) 例如:chflags nohidden /Users/Jay

2020-08-10 10:22:45 489

原创 BOX2D 自然的旋转到一个指定角度

最近在自己第一个游戏项目里面碰到一个看似简单却花了我2天时间才解决的问题特地发出来分享一下在BOX2D 中如何控制body 自然的旋转到一个指定角度?这个问题在许多游戏中控制角度时都会遇到,但是在BOX2D中,你必须考虑到如果转动中与其他body碰撞等物理因素。能够想到的解决方案有三种:1 在update方法里不断更改body的角度,使他接近于要设

2020-08-10 10:20:31 516

原创 BOX2D 自然的移动到一个指定速度

接着上次的文章在很多BOX2D游戏中同样会遇到这样一个问题:如何使一个body自然的按照一个指定速度移动?方法同上次所说的有三种:1-直接设定body的线速度这是最直接的方法,但是同样的,并不是在box2d中最好的方法b2body *body;// the body you want to conrollb2Vec2 vel;// the

2020-08-10 10:20:02 487

原创 CCprogressTimer

Lets talk about the major changes:Instantiation:+ (id) progressWithSprite:(CCSprite*) sprite;- (id) initWithSprite:(CCSprite*) sprite;You can now do that by passing a sprite and that sprit

2020-08-10 10:19:44 519

原创 how to hide dock of running app on mac

open info.plist of app, add boolean valueLSUIElement true.

2020-08-10 10:19:20 645

原创 MAC OS 暗黑世界服务器端环境搭建(适合用MAC系统的亲们)

之前搭配环境时记下来的笔记,搭建过程蛮累人的,希望能帮到有需要的亲。Mac相关操作篇1、显示Mac隐藏文件 显示Mac隐藏文件的命令:defaults write com.apple.finder AppleShowAllFiles -bool true 隐藏Mac隐藏文件的命令:defaults write com.apple.finder Apple

2020-08-10 10:18:44 750

原创 mac上部署firefly服务器(linux同可参考) 口袋仙侠服务器客户端

新人第一次假设 遇到很多问题 自己百度查阅之后搞定 成功后来分享经验 截图见 前十获得rpg那个贴子;linux下完全可以参考 只是安装命令不一样 需要安装的东西是一样的1.python下载 htt去掉这几个字ps://ww去掉这几个字w.python.org/download/releases/2.7.6/ 我用的是MacOS X 64-bit/32-bit x86-6

2020-08-10 10:18:16 682

原创 在MAC下调试运行暗黑世界客户端及部分代码注解

一、先是基于coco2d-x的客户端1、最快的方式是,先在mac安装xcode,我这用xcode4.6,然后下载cocos2d-x安装包,我这用2.1.5,直接解压到documents得到cocos2d-x-2.1.5,不用着急装他的模板,接着下载暗黑世界coco2d-x客户端,我的是1.4版本,居然200多M,解压后,得到一个叫tsDemo的文件夹,在cocos2d-x-2.1.5新建一

2020-08-10 10:16:46 1231

原创 暗黑世界1.4客户端+1.6服务器在Mac系统下的搭建步骤

环境:系统:Mac 10.9开发工具:Xcode 5.0.1客户端游戏引擎:cocos2d-x 2.1.4服务端框架:firefly 1.2.2python版本:2.7客户端搭建步骤:1、将客户端工程代码tsDemo解压到cocos2d-x2.1.4->projects下面2、用Xcode打开工程后,找到SocketManager.cpp文件,在第40行, _s

2020-08-10 10:16:15 752

原创 Mac下暗黑服务器搭建(完全攻略,一个菜鸟的搭建之路)

1.我选择了首先安装数据库,mysql数据库的安装与配置,参照(请原谅,由于本人身份卑微,无权发布链接)大鸡蛋补充:http://www.cnblogs.com/macro-cheng/archive/2011/10/25/mysql-001.html2.我们知道Firefly是基于python语言,twisted框架构建的。那么在机器上配置python基础环境就必不可少。原

2020-08-10 10:15:45 663

原创 MAC下安装firefly新手教程

1.下载FireFlyGithub:FireFly2.安装第三方库安装前请确保已安装mysql数据库!使用python包管理工具esay_install,依次安装以下依赖包:sudo easy_installtwistedsudo easy_installpython-memcachedsudo easy_install DBUtilssudo easy

2020-08-10 10:15:05 550

原创 How to: Get Spotlight processes back under control when CPU usage goes crazy

If you’re finding that your Mac fans are running a lot more than they used to, you might want to check out whether a couple of Spotlight processes are consuming more than their fair share of CPU cycle

2020-08-10 10:13:31 677

原创 912sy浅析C++数据类型取值范围

C++数据类型是用来存储值的所在处;它们有名字和数据类型,变量的数据类型决定了如何将代表这些值的位存储到计算机的内存中,变量名允许的最大长度随编译器的不同而不同。而在C++数据类型,则必须先声明变量类型再使用变量:int x1 = 1;int x = 1000;float y = 3.14;long z = 457000;这样,编译器就可以进行类型检查,确保程序运行时一切顺利。数据类型使用

2020-08-08 15:11:38 113

原创 912sy讲解如何删除cocos2d-x模板

老版本的cocos2d-x都是把模板安装到xcode里,现在用的是Python模板,所有如何把以前的模板删除呢?很简单,1、找到路径:/Users/xxxxxx/Library/Developer/Xcode/Templates,xxxxxx是你的名字,把模板中cocos2d的内容删去即可。如果找不到这个路径,是由于文件隐藏所致,可以在终端敲入:defaults write com.a

2018-07-08 20:57:40 138

原创 [MAC OS X] mds_stores 100% CPU usage

Today the CPU usage and sound of the system fan drove me crazy. The evil was the mds_stores process.mds_stores is a part of Spotlight and it’s indexing engine.After a small amount of time i decide

2014-05-23 06:02:27 2869

原创 912sy浅析linux 下查看文件个数及大小

ls -l |grep "^-"|wc -l或find ./company -type f | wc -l查看某文件夹下文件的个数,包括子文件夹里的。ls -lR|grep "^-"|wc -l查看某文件夹下文件夹的个数,包括子文件夹里的。ls -lR|grep "^d"|wc -l说明:ls -l长列表输出该目录下文件信息(

2014-05-22 16:36:38 480

原创 EXTENDING COCOS2D CCSPRITE TO HANDLE TOUCHES

Extending CCSprite Makes My Life EasierWhile developing a couple of games that I am currently working on I ended up finding a need to have a CCSprite that would trigger a particular selector. I wa

2013-06-01 18:49:57 560

原创 利用CCProgressTimer 实现自定义游戏血量条

这几天在做自己游戏项目中的血量条,分享下我自己的血量条插件通过翻查网站,发现COCOS2D已经提供了一个接近效果的封装,CCProgressTimer首先介绍下CCProgressTimer它是一个基础进度条,能够支持若干种进度条样式,包括圆形进度条,条形进度条,根据一个百分比属性,实现显示/隐藏进度条的部分,达到图形化显示进度的作用。优点:- 继承自CCN

2013-05-20 16:57:30 836

原创 iOS-WAV sound files don't play

First of all, the preferred sound format for iPhone is LE formatted CAF, or mp3 for music. You can convert a wav to caf with the built in terminal utility:afconvert -f caff -d LEI16 crash.wav crash.

2013-04-25 14:54:26 725

原创 Use Retina Graphics In iPad

Very easy:in ccFileUtils.m search for+(NSString*) getDoubleResolutionImage:(NSString*)pathand change the lineif( CC_CONTENT_SCALE_FACTOR() == 2)for the lineif( CC_CONTENT_SCALE_FACTO

2013-04-24 19:13:26 627

原创 一种快速求点到线段距离的算法

点到直线的距离可以直接做垂线求取,但线段是有首尾点的,若要求距离则要考虑首尾点。    点和线段的关系大致可以有下面几种:有特殊情况,是P点和A或B重合,否则,根据∠PAB或∠PBA的角度可以有图1、图2、图4三种情况(包括点在AB之间,算是零度角)。    我做的算法可以快速、简洁地判断角度是钝角还是锐角。    在求垂线距离时,用海伦公式取代三角函数

2013-04-24 18:59:06 575

原创 iOS之ARC下的Block

【ARC的特性】  ARC下,所有NSObject类型指针,  1. 默认为__strong类型  2. 可以显示的指定为__weak类型,__weak类型指针在所指向对象销毁后会自动置为nil  3. __autorelesing类型用于inout参数类型  ARC下,当一个函数返回一个NSObject指针时,编译器会帮我们实现autorelease调用。

2013-04-24 18:56:10 509

Cocos Creator源码开发 天天么么哒 神烧脑 源码 cocoscreator

Cocos Creator源码开发 天天么么哒 神烧脑 源码 cocoscreator

2021-06-09

Cocos Creator源码v2.2.2开发 枪神之神源码 cocoscreator

Cocos Creator源码v2.2.2开发 枪神之神源码 cocoscreator

2021-06-09

Cocos Creator v2.1.1开发源码 火柴人密室逃脱cocoscreator源码

Cocos Creator v2.1.1开发源码 火柴人密室逃脱cocoscreator源码

2021-06-09

【 iPhone Device APIs,Location, Accelerometer etc.】[PDF] [iPhone/iPad/iOS]

【 iPhone Device APIs,Location, Accelerometer & Camera etc.】[PDF] [iPhone/iPad/iOS]

2013-11-05

【Introduction to Mac OS X and Cocoa Touch】[PDF] [iPhone/iPad/iOS]

【Introduction to Mac OS X and Cocoa Touch】[PDF] [iPhone/iPad/iOS]

2013-11-05

【Interface Builder, Controls, Target-Action】[PDF] [iPhone/iPad/iOS]

【Interface Builder, Controls, Target-Action】[PDF] [iPhone/iPad/iOS]

2013-11-05

【Foundation Framework Reference】[PDF] [iPhone/iPad/iOS]

【Foundation Framework Reference】[PDF] [iPhone/iPad/iOS]

2013-07-05

【Debugging Tips, Searching, Notifications, KVC,KVO】[PDF] [iPhone/iPad/iOS]

【Debugging Tips, Searching, Notifications, KVC,KVO】[PDF] [iPhone/iPad/iOS]

2013-07-05

【Dealing with Data, User Defaults, SQLite, Web Services】[PDF] [iPhone/iPad/iOS]

【Dealing with Data, User Defaults, SQLite, Web Services】[PDF] [iPhone/iPad/iOS]

2013-07-05

【Custom Classes, Memory Management, and ObjC Properties】[PDF] [iPhone/iPad/iOS]

【Custom Classes, Memory Management, and ObjC Properties】[PDF] [iPhone/iPad/iOS]

2013-07-05

【Creating New Expressive Social Mediums on the iPhone】[PDF] [iPhone/iPad/iOS]

【Creating New Expressive Social Mediums on the iPhone】[PDF] [iPhone/iPad/iOS]

2013-07-05

【Audio APIs, Video Playback, Displaying Web Content...】[PDF] [iPhone/iPad/iOS]

【Audio APIs, Video Playback, Displaying Web Content, Settings】[PDF] [iPhone/iPad/iOS]

2013-07-05

【Address Book Putting People in Your App】[PDF] [iPhone/iPad/iOS]

【Address Book Putting People in Your App】[PDF] [iPhone/iPad/iOS]

2013-07-05

【Beginning iPhone Development】[PDF] [iPhone/iPad/iOS]

【Beginning iPhone Development】[PDF] [iPhone/iPad/iOS]

2013-04-25

【知易Cocos2D-iPhone开发教程】[PDF+源代码] [iPhone/iPad/iOS]

【知易Cocos2D-iPhone开发教程】[PDF+源代码] [iPhone/iPad/iOS]

2013-04-25

【Xcode 4 Unleashed 2nd Edition】[PDF+源代码] [iPhone/iPad/iOS]

【Xcode 4 Unleashed 2nd Edition】[PDF+源代码] [iPhone/iPad/iOS]

2013-04-25

【Programming.iOS.5.2nd.Edition】[PDF+源代码] [iPhone/iPad/iOS]

【Programming.iOS.5.2nd.Edition】[PDF+源代码] [iPhone/iPad/iOS]

2013-04-25

【Pro.OpenGL.ES.for.iOS】[PDF+源代码] [iPhone/iPad/iOS]

【Pro.OpenGL.ES.for.iOS】[PDF+源代码] [iPhone/iPad/iOS]

2013-04-24

【Pro.iOS.Apps.Performance.Optimization】[PDF+源代码] [iPhone/iPad/iOS]

【Pro.iOS.Apps.Performance.Optimization】[PDF+源代码] [iPhone/iPad/iOS]

2013-04-24

【Pro.iOS.5.Tools】[PDF+源代码] [iPhone/iPad/iOS]

【Pro.iOS.5.Tools】[PDF+源代码] [iPhone/iPad/iOS]

2013-04-24

【Pro.Core.Data.for.iOS.2nd.Edition】[PDF+源代码] [iPhone/iPad/iOS]

【Pro.Core.Data.for.iOS.2nd.Edition】[PDF+源代码] [iPhone/iPad/iOS]

2013-04-24

【Objective-C.Phrasebook.2nd.Edition】[PDF+源代码] [iPhone/iPad/iOS]

Objective-C.Phrasebook.2nd.Edition

2013-04-24

【Objective-C.Fundamentals】[PDF+源代码] [iPhone/iPad/iOS]

【Objective-C.Fundamentals】[PDF+源代码] [iPhone/iPad/iOS]

2013-04-24

【Objective-C.for.Absolute.Beginners.2nd.Edition】[PDF+源代码] [iPhone/iPad/iOS]

【Objective-C.for.Absolute.Beginners.2nd.Edition】[PDF+源代码] [iPhone/iPad/iOS]

2013-04-24

【Objective-C Recipes】[PDF+源代码] [iPhone/iPad/iOS]

【Objective-C Recipes】[PDF+源代码] [iPhone/iPad/iOS]

2013-04-24

【iPhone.User.Interface.Cookbook】[PDF+源代码] [iPhone/iPad/iOS]

【iPhone.User.Interface.Cookbook】[PDF+源代码] [iPhone/iPad/iOS]

2013-04-24

【iPhone.Applications.Tune-Up】[PDF+源代码] [iPhone/iPad/iOS]

【iPhone.Applications.Tune-Up】[PDF+源代码] [iPhone/iPad/iOS]

2013-04-24

【iOS.Programming.The.Big.Nerd.Ranch.Guide.3rd】[PDF+源代码] [iPhone/iPad/iOS]

【iOS.Programming.The.Big.Nerd.Ranch.Guide.3rd】[PDF+源代码] [iPhone/iPad/iOS]

2013-04-24

【iOS.5.Programming.Cookbook】[PDF+源代码] [iPhone/iPad/iOS]

【iOS.5.Programming.Cookbook】[PDF+源代码] [iPhone/iPad/iOS]

2013-04-24

【iOS.5.Essentials】[PDF+源代码] [iPhone/iPad/iOS]

【iOS.5.Essentials】[PDF+源代码] [iPhone/iPad/iOS]

2013-04-24

【iOS SDK Programming A Beginners Guide】[PDF+源代码] [iPhone/iPad/iOS]

【iOS SDK Programming A Beginners Guide】[PDF+源代码] [iPhone/iPad/iOS]

2013-04-15

【Hacking.and.Securing.iOS.Applications】[PDF+源代码] [iPhone/iPad/iOS]

【Hacking.and.Securing.iOS.Applications】[PDF+源代码] [iPhone/iPad/iOS]

2013-04-15

【From Idea to App+code】[PDF+源代码] [iPhone/iPad/iOS]

【From Idea to App+code】[PDF+源代码] [iPhone/iPad/iOS]

2013-04-15

【Concurrent Programming in Mac OS X and iOS】[PDF+源代码] [iPhone/iPad/Mac]

【Concurrent Programming in Mac OS X and iOS】[PDF+源代码] [iPhone/iPad/Mac]

2013-04-15

【iOSGameCenter和GameKit编程入门】[PDF+源代码] [iPhone/iPad/Mac]

【iOSGameCenter和GameKit编程入门】[PDF+源代码] [iPhone/iPad/Mac] 书名:Beginning.iOS.Game.Center.and.Game.Kit.Nov.2011

2013-04-15

【利用html和JS开发iOS应用程序入门】[PDF+源代码] [iPhone/iPad/Mac]

【iOS虚幻游戏引擎编程入门】[PDF+源代码] [iPhone/iPad/Mac] 书名:Beginning.iOS.Application.Development.with.HTML.and.JavaScript

2013-04-15

【iOS5 SDK开发探索实录】[PDF+源代码] [iPhone/iPad/Mac]

【iOS5开发探索实录】[PDF+源代码] [iPhone/iPad/Mac] 书名:Beginning.iOS.5.Development.Exploring.the.iOS.SDK

2013-04-15

【iOS虚幻游戏引擎编程入门】[PDF+源代码] [iPhone/iPad/Mac]

【iOS虚幻游戏引擎编程入门】[PDF+源代码] 书名:Beginning.iOS.3D.Unreal.Games.Development.Apr.2012

2013-04-15

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除