Torque Combat Object Position
by Steven Turner · in Torque X 2D · 09/30/2007 (3:20 pm) · 0 replies
Hello,
I'm new to TorqueX and I am trying to understand the structure of how everything works. I've started with a Torque Combat game as a base and have been modifying as I go along to learn.
I understand that objects are registered in the object database, and also the 2dscenegraph.
I've written code for some basic AI and placed it in the AIPlayerControlComponent. My problem is this:
The code works if I simply specify a static position. However, I want the enemies to track the player. In the example of Torque Combat how would one do this?
I see the base PlayerCollections class contains "GetPlayerPosition(int playerNum)," but I can't seem to figure out how to reference and use this.
Thanks,
Steve
I'm new to TorqueX and I am trying to understand the structure of how everything works. I've started with a Torque Combat game as a base and have been modifying as I go along to learn.
I understand that objects are registered in the object database, and also the 2dscenegraph.
I've written code for some basic AI and placed it in the AIPlayerControlComponent. My problem is this:
The code works if I simply specify a static position. However, I want the enemies to track the player. In the example of Torque Combat how would one do this?
I see the base PlayerCollections class contains "GetPlayerPosition(int playerNum)," but I can't seem to figure out how to reference and use this.
Thanks,
Steve