Thanks,i try to see if i understand.
b\x1 & b\x2 are the coordinates from i'm shooting.
b\x2 & b\y2 are the coordinates at what i'm shooting at.
The function "newBullet" is called everytime i fire a bullet,so i create a new instance of the bullet each with it's own variable.
When i call the "updateBullet" function i compare the two position and add or subtract 1 (if i want movement of one pixel),and when the two position variable are equal i call an explosion or anything else.
I've understand right?
b\x1 & b\x2 are the coordinates from i'm shooting.
b\x2 & b\y2 are the coordinates at what i'm shooting at.
The function "newBullet" is called everytime i fire a bullet,so i create a new instance of the bullet each with it's own variable.
When i call the "updateBullet" function i compare the two position and add or subtract 1 (if i want movement of one pixel),and when the two position variable are equal i call an explosion or anything else.
I've understand right?