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

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -