Swipe And Fling Object

Thanks in advance can anyone point me in the right direction or help me out with a code snippet? Im trying to swipe an object in 4 directions Up, Down, Left, Right and if you swipe in any of these directions the object will shoot that direction. I tried looking at sample codes and previous forum post and could not come across anything to help me with this type of game. Once again thanks in advance! [import]uid: 30314 topic_id: 19004 reply_id: 319004[/import]

Perhaps a modification of MultiPuck might be what you want? Have you checked that out yet?

Peach :slight_smile: [import]uid: 52491 topic_id: 19004 reply_id: 73425[/import]

@ peach pellen

Hi peach yea I have used Multi Puck on some other projects not sure if modifying it will give the results im after I basically know how to shoot the object once you swipe with your finger the problem for me is how to create a swipe function and how can it tell if you swiped down, up, left, right. I hope it makes sense and im not confusing people what im trying to accomplish. Incase I lost anyone who read this post To explain it in a simple method would be to have 4 arrows (buttons) Left,Right,Up,Down and when you touch one of those buttons the object shoots on that direction. I can accomplish that but what if you were to eliminate the buttons and instead use your finger to swipe on screen?

Thanks in advance [import]uid: 30314 topic_id: 19004 reply_id: 73454[/import]

OK, yeah, MultiPuck would not be right then.

This however looks like it could be very suitable; http://developer.anscamobile.com/code/mark

Peach :slight_smile: [import]uid: 52491 topic_id: 19004 reply_id: 73459[/import]

@ peach pellen

Wow peach thanks so much for that link! It does exactly what im after and with some tweaking Its doing exactly what I needed. You really deserve to be an Ansca Staff as you are by far the person who helps out the most even before you were an Ansca Staff. Thanks again and Happy Holidays! [import]uid: 30314 topic_id: 19004 reply_id: 73722[/import]

I’m very happy to have been able to help :slight_smile:

Thanks so much for that high praise - I really appreciate it and I hope you have a happy holidays as well.

Peach :slight_smile: [import]uid: 52491 topic_id: 19004 reply_id: 73865[/import]

This might sound obvious, but can I replace the “runtime” event listener with an “object”. I need to detect the swipe direction with a cube object.

Thanks. [import]uid: 8780 topic_id: 19004 reply_id: 130146[/import]

This might sound obvious, but can I replace the “runtime” event listener with an “object”. I need to detect the swipe direction with a cube object.

Thanks. [import]uid: 8780 topic_id: 19004 reply_id: 130146[/import]

Yes. You can just as easily use “object:addEventListener” as “Runtime:addEventListener.”

C [import]uid: 147322 topic_id: 19004 reply_id: 130171[/import]

Yes. You can just as easily use “object:addEventListener” as “Runtime:addEventListener.”

C [import]uid: 147322 topic_id: 19004 reply_id: 130171[/import]