Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to program a ball that will go all right, left, right or back ?

iCLSn0wiCLSn0w Posts: 34Registered Users
edited April 2012 in Tutorial Requests
Hello,
I found un code for the ball go all right :
Code:
enemy.center = CGPointMake(enemy.center.x, enemy.center.y + pos.y);
    if (enemy.center.x > 320 || enemy.center.x < 0) {
        pos.x = -pos.x;
    }
    if (enemy.center.y > 430 || enemy.center.y < 0) {
        pos.y = -pos.y;
    }
Can you help with left, right , back ?
thanks you very much
Sign In or Register to comment.