ios - Moving a sprite by touching anywhere on the screen -


in game 1 sprite responds touches. how can make mousejoint move sprite/body regardless of touch on screen?

- (void)cctouchesmoved:(nsset *)touches withevent:(uievent *)event { uitouch *touch = [touches anyobject];  cgpoint location = [touch locationinview: [touch view]];  location = [[ccdirector shareddirector] converttogl:location];  mysprite.position = location;  } 

make sure in initmethod self.istouchenabled = yes;


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -