Wheel inventing

videgoame room 8 So, because I am a bad(?) person, I am putting a virtual D-Pad into my next game. I know. I know. I hate myself too. I will get over it if I can just release this game and then work on porting it elsewhere. Gotta build up my library first, right?

I began messing with making my own virtual D-pad, as I did not want to just import a library. I found this and used it as a base. A simple start, but I have already added the ability to speed up the character based on how much you slide in a direction.

I hated having it fixed in place, but the solution came to me fairly quickly. All I had to do was pop this into ccTouchBegan:

if (!_isHeld) {
    self.position = location;
    _isHeld = YES;
    return YES;

Boom. If you are touching the screen, sliding around moves smoothly and if you are just tapping, you can gently caress the character into the tighter spots. A lot of tweaking is needed to get this where I want it, but I am pleased with this start. Oh yeah, the "d-pad" also fades out over time when you are not using it. Stays out of the way when you are trying to look at the puzzle.