Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Assume a shooting game for iPhone that the character shoot toward where player has touched.

But as we know, There may be fault in touching screen by player and it conclude to bad game play and low fun.

So, How can I correct shooting method ?

share|improve this question
    
you could try using 3D picking to detect what object the pixel at the point touched belongs to. Since fingers aren't the size of individual pixels you might want to check for a group of pixels around the touch point, maybe a radius of 5 would work. –  Benjamin Danger Johnson Oct 31 '12 at 21:16
    
When you the touch screen at (X,Y), you need to projectile the point to 3D world, and then it gives you an origin point(the cone top) and a vector of direction. And the problem is about this direction vector. You said to check all of some close point to (X,Y) and It's a solution too. But It cost more, because you should do Trace action for more point ( many point needed to get a good result ). –  EmAdpres Oct 31 '12 at 21:21
add comment

1 Answer

up vote 1 down vote accepted

I think when player touch a point, he target some thing that will place in a cone as below picture show.

enter image description here

So, we just need to check collision of objects in this cone, and if any exist, the player most probably decided to shoot at it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.