레이블이 How인 게시물을 표시합니다. 모든 게시물 표시
레이블이 How인 게시물을 표시합니다. 모든 게시물 표시

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

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 allocinitWithCategory:@"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

[Cocoslive] How to get a score from Cocoslive? Here it is!


I was gonna post it tomorrow but i decided to post it right now. why?

cause i dont have anything to do right now :p

Get to the point!


#import "CLScoreServerPost.h"

-(void) requestGlobalScore
{

    CLScoreServerRequest *request = [[CLScoreServerRequest alloc]initWithGameName:@"Mayday Timeattack" delegate:self];
  
    
    [request requestScores:kQueryAllTime limit:10 offset:currentScoreflags:kQueryFlagIgnore];

    [request release];
}
 
-(void) scoreRequestOk: (id) sender
{
    NSArray *scores = [sender parseScores]; 
    NSMutableArray * serverScore = [NSMutableArray arrayWithArray:scores];
}
 
 

Try the above lines then you will be find. 

If you have any questions, reply~