Game Development Community

Score for AI kill

by none · in Torque Game Engine · 01/16/2012 (3:32 pm) · 2 replies

Hi, I've looked all over the forums and found many topics but none that work. How do I award the player a point for killing an ai just as it is awarded to a player for killing another player?

#1
01/16/2012 (7:04 pm)
That depends on the way you kill the ai player.......For me what i did was manually awarded the player the score....
My player uses a weapon btw not a gun so i coded the onCollision of the staticShape mounted on the player to check if the %col(object that collided with my staticShape mounted) getDamage() is < 0. If so, enemy has died and i awarded that player points....
But if you are using a weapon the projectileData::onCollision will do the same thing except that the projectile will have to recieve the id of the player before it is launched in order to give that player the points.....

Well if i'm wrong correct me cause im pretty new to this myself..... :)
#2
01/16/2012 (7:11 pm)
I actually figured it out a different way, I guess theres tons of ways to do it. I did a check in player.cs to see if on armor damage the person damaged was an ai or player. seems to have worked thus far!