Stuck - target with mouse - similar to Codemonkeys pool demo
JamesZeppelin
Member Posts: 1,927
So i have a game that uses the slingshot style firing system
basically you pull back to aim release to fire
Its a fast pased shooter so i need two guns...
i doubled up on all 8 attributes required for a proper sling aim system however i hit a wall with mouse position??
I'm using the magnitude between the firing point and where my finger is to aim.
I was thinking some sort of work around with game.touch but since you would be pulling and firing left and right i dont know how to have the device know which touch is which
the closest example would be Code Monkey's pool game
being able to fire off two cue balls at once...
its a little different but the aiming principle is the same
basically you pull back to aim release to fire
Its a fast pased shooter so i need two guns...
i doubled up on all 8 attributes required for a proper sling aim system however i hit a wall with mouse position??
I'm using the magnitude between the firing point and where my finger is to aim.
I was thinking some sort of work around with game.touch but since you would be pulling and firing left and right i dont know how to have the device know which touch is which
the closest example would be Code Monkey's pool game
being able to fire off two cue balls at once...
its a little different but the aiming principle is the same
Comments
if that is correct you could qualify which touch should control the sling based on where it s located, then execute the rules specific to the correct touch.
assuming gameplay is landscape and the guns are on either side of the center of the scene, you could do something like the following in each gun.
Rules in leftmost gun:
`
Rule: if game.touch1.Position.X <= 240
---Aim using touch1-based logic
Otherwise
---Rule: if game.touch2.Position.X <= 240
-----Aim using touch2-based logic
`
Rules in rightmost gun:
`
Rule: if game.touch1.Position.X > 240
---Aim using touch1-based logic
Otherwise
---Rule: if game.touch2.Position.X > 240
-----Aim using touch2-based logic
`
So that basically will define what touch1 is vs touch2?
thanks
Just needed to define touch 1 and touch 2