1. CCArray is replaced with Vector<T>.
Vector is clearly faster than CCArray. No need to cast type and preserve the data. Easy to manipulate with overriding functions.
2. std::string + operator
int index = 23;
std::string name = "testSprite" + Value(index).asString() + ".png";
Sprite* spt = Sprite::create(name.c_str());
This works fine on iOS. But it crashes 1 out of 20 times on Android.
3. setUserData
You don't want to cast something to (Void*). It takes too long to cast. The performance will be very lowered. And few more problems will occur like Vector not recognizes it.
4. MotionStreak
It still takes some CPU resources. Don't use it too much.
5. Check my game.
Mr Boss
https://play.google.com/store/apps/details?id=com.magmon.MrBoss
2014년 7월 10일 목요일
cocos2d-x [Tile Map] How to load tmx tile map. TMXTileMap, Value, ValueMap and GID
TMXTileMap* tileMap = TMXTileMap::create("LegendDary_1_1.tmx");
int tileGID = 0;
Value properties = tileMap->getPropertiesForGID(tileGID);
ValueMap map = properties.asValueMap();
std::string name = map.at("Enemy").asString();
if(name.compare("Wolf") == 0){
CCLOG("Wolf loaded");
}
Check out my game :p
Mr Boss
https://play.google.com/store/apps/details?id=com.magmon.MrBoss
int tileGID = 0;
Value properties = tileMap->getPropertiesForGID(tileGID);
ValueMap map = properties.asValueMap();
std::string name = map.at("Enemy").asString();
if(name.compare("Wolf") == 0){
CCLOG("Wolf loaded");
}
Check out my game :p
Mr Boss
https://play.google.com/store/apps/details?id=com.magmon.MrBoss
2011년 8월 17일 수요일
[Game Center] How to post a score to the Game Center? Here is is!
For using game center, your app should be on the Itunesconnect and enable Game Cener.
If you did that, here is what you have to do now.
It is very simple. Try the following codes.
GKScore* score = [[[GKScore alloc] initWithCategory:@"game category name"]autorelease];
score.value = totalTime*100;
[score reportScoreWithCompletionHandler:^(NSError* error)
{
if(error != NULL)
{
}
}];
It it very easy to post your score but... not much players want to even create account on GameCenter;;
I myself in My App am using both GameCenter and Cocoslive leader boards.
Result?
2000 people in cocoslive leader board.
and
2 people in GameCenter leader board including me.
Have a good day~ :p
2011년 8월 16일 화요일
[IPhone Dev]"This game is not recognized by Game Center" Problem
Straight to the point.
When get "This game is not recognized by Game Center" alert view when you are trying to add Game Center in you app on the device
but works on the simulator, well you are in no problem.
Just remove your app from the device and run on the device again.
It will work. Just got the problem and solved this problem after looked at this thread.
Thanks to Paul.
Mayday Timeattack - Free on Appstore
and now small talk :p
i used cocos2d and cocoslive for my game.
But i decided to go for Game Center.
I haven't tried the "Campaign" from the admob site but i will try it layer.
Anyway looks like somehow they promote itself by "friends thing".
So.. i will update it with Game Center and see how it goes :p
Good day guys~
When get "This game is not recognized by Game Center" alert view when you are trying to add Game Center in you app on the device
but works on the simulator, well you are in no problem.
Just remove your app from the device and run on the device again.
It will work. Just got the problem and solved this problem after looked at this thread.
Thanks to Paul.
Mayday Timeattack - Free on Appstore
and now small talk :p
i used cocos2d and cocoslive for my game.
But i decided to go for Game Center.
I haven't tried the "Campaign" from the admob site but i will try it layer.
Anyway looks like somehow they promote itself by "friends thing".
So.. i will update it with Game Center and see how it goes :p
Good day guys~
피드 구독하기:
글 (Atom)
