how to get a value at runtime

This topic is 3363 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

I am making a game in c sharp XNA. i want to get a value at the runtime that is the player's position in the form of vector. how will i do that. plus i have an xyz plane value .how will i convert it to an integer value.

Share on other sites
If you want the position of the player, you need to keep up with that in your code... there is no intrinsic "player position" in XNA.

I'm not sure what you are talking, regarding the integer/plane question.

Share on other sites

the syntax in C sharp.

Share on other sites
and the second question is

that i have an xyz plane. i want to compare its value to an integer or apply ">" operator on it. how will i do it.

Share on other sites
Quote:
 Original post by meherzadand the second question is that i have an xyz plane. i want to compare its value to an integer or apply ">" operator on it. how will i do it.
What does comparing a plane with an integer mean?? When is an integer greater than a plane? Is an apple less than an orange?

Share on other sites
bool Compare(Plane p, int i){  throw new Exception("WTF is this shit?");}

That should do what you want.

Share on other sites
Quote:
 Original post by meherzadI am making a game in c sharp XNA. i want to get a value at the runtime that is the player's position in the form of vector. how will i do that.

This isn't something you read, this is something you set.

Quote:
 i have an xyz plane value .how will i convert it to an integer value.

I'm more curious about what problem you believe this is a solution to - maybe we can find a method that makes sense.

Share on other sites
Quote:
 Original post by meherzadand the second question is that i have an xyz plane. i want to compare its value to an integer or apply ">" operator on it. how will i do it.

Planes cannot be "ordered", because they can (and in fact, almost always do) intersect (meaning that you can't meaningfully say one is "less than" the other). Why do you want to do this comparison? What do you think it will help you do?

Share on other sites
My guess is that he wants to calculate the closest/perpendicular distance to the plane from the player's position. (So he can make test like if(dist < 0) { /*position is under ground */ }.

And I guess he means scalar and not integer..

1. 1
Rutin
26
2. 2
3. 3
JoeJ
20
4. 4
5. 5

• 10
• 9
• 9
• 46
• 41
• Forum Statistics

• Total Topics
631750
• Total Posts
3002067
×