Hello all.
I am trying to figure out how to script the mechanic (C#) from “Bowman 2” (web game), where your angle of leftMouseDown to leftMouseUp == player’s firing arc, and the distance between leftMouseDown and leftMouseUp is the amount of force (AddForce?) applied to arrow. I’m sure it’s not that hard, but I am very new to programming.
I was playing around with a Spring Joint2d, but I can’t figure out how, and when to instantiate Arrow upon leftMouseDown vs leftMouseClickUp. Like, if I instantiate Arrow upon release (after the drag of the mouse), then how could the spring be stretched during the drag, and then be applied to the Arrow, if at that point the Arrow hadn’t been created yet? Also, in a game with multiple Arrows shot by a moving character, it doesn’t seem like I would want SpringJoints?!?
Maybe SpringJoint2D is a bad idea, but I’m trying…
Even just an explanation of an approach would be helpful. i.e. Thank you very much for your time!