How to catch a value that changes all the time?
Hi guys ^_^
I'm wondering how to catch a value before it changes?
in another word, how to save a specific value so that when it changes, my saved value doesn't change?
for example:
if I have:
and I want to save the value of it(10) in another varible.
so that when y changes(to 15 for example), x doesn't change.
another example:
Code:
int x = pistolX2 + 10;
int y = pistolY2 + 2;
here i'm developing a game and I want to save the coordinate of the pistol so that the bullet fired from the right place.
the problem is, when the bullet fired, and the character moved, pistolX&Y will change, and that will effect the direction of the bullet (since it's dependent on the pistol X&Y).
So, how to make my x&y independent from pistolX&Y?
thanks. :)