2/21/2011 6:57:25 PM
Title:
Sniper Game for Touch Screens
Hi,
I hope someone can answer this for me.
Basically I'm creating a sniper game for the iPhone 4 using AS3 in Flash CS5. I want to be able to control the scope using my finger on the iPhone so I can see the red dot without my fingering covering the red dot. Is there code to offset the drag so I can see the red dot in the centre of the scope so when I move it with my finger, I should be able to see the red dot.
Any help would be much appreciated.
Cheers guys.
2/22/2011 7:17:41 AM
its quite simple. You just need to create your cross movieclip in such way that its center point is below the red dot by around 30 pixels x and y.
When you drag the object by snapping its center to mouse. Your object is placed exactly below mouse. So you need to draw the object in minus co-ordinates. Let me know if its not clear
2/22/2011 7:21:10 AM
double click your cross movieclip to enter inside it . Now shift the cross drawing upwards by some distance. Compile and see if now its visible when dragging or move it more.
2/22/2011 7:45:43 AM
I actually tried that before. I thought they would be another way to actually pan the scope around. Its just with that method, when you click to shoot, the mouse/touch goes back to where I moved the cross and then goes back to the normal position. I have to code it in a way that when I have the red dot over something, it shoots it.
I'll just have to work with that method. Thanks the help guys.