You do not have a basic understanding of C#. You have a basic understanding of what the equal sign does in C#.
The reason you cannot just move a line like that is because code is context sensitive. The entire reason this line of code worked in the first place is because in its original place, the code had access to an object named player (probably of type Player or something similar). When you take the line out of this place and move it to another file, you are removing it from the context and thus that object no longer is available to modify. You have to somehow pass the reference to the new place.
Your best bet to answering this problem is to buy a C# book and learn Object Oriented Programming. It is near impossible to learn how to program just by modifying someone else's game.
__________________
John Sedlak
Microsoft Xna / DirectX MVP
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
|