Sunday, December 9, 2012

Move-to-touch position iPhoneGameKit


Testing iPad programming – making the joypad follow the player as he moves from the center of the screen to the edges. This is complicated because the map is twice as large as the screen and the coordiantes must be converted. It was solved in lower left by assigning the joypad.position = [[self getPlayer] position] when the player.position is less than 1/2 the screen size (because player is always in screen centre unless near edges). In upper right, you must do: screenWidth-(mapWidth-player.position.x);


Source : iphonedevx[dot]com

0 comments:

Post a Comment