Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Swipe move sprite

Author
Message
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 10th Nov 2011 23:15
I'm starting on a swipe move routine for my game, as I don't really like virtual joysticks (not AGK's fault) as I don't think some arcade games can work well with a VJ.

I`m sure this will be a useful routine (providing I can get it to work how I want) and I'll post it in the snippets section if I think it's worthy of re-use, as I`m sure people will want something like this.

Anyone experimented / done this yet?

bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 10th Nov 2011 23:32
Sounds like an interesting & useful piece of code
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 10th Nov 2011 23:40
Considering there's no examples nor that that help is complete (event type returns) this will be interesting..

Trisect Development
21
Years of Service
User Offline
Joined: 8th Sep 2002
Location: Denmark
Posted: 11th Nov 2011 10:46
Sounds great!
Let us know when you have something.

iOS Apps from Trisect Development.
Click here.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 11th Nov 2011 13:43 Edited at: 11th Nov 2011 13:45
I guess the question is what kind of movement are you looking to have when you swipe your finger over the screen... I have posted some code that does something along those lines.

I started a simple menu for a project that does something like what you are saying but there are many ways a sprite can react to your "swipe", do you want it to bounce around the screen, spin like crazy or just follow your finger?

Here's a link to my swipe menu: https://forumfiles.thegamecreators.com/download/2253408

Basically you just use the "Pointer" commands to find out what the user is doing.


...in between you can save "getPointerX()" and "getPointerY()" and "timer()" data to find out where they touch the screen and for how long. What you do with that data is then up to you.

I hope that helps

EDIT: The link I posted is from this thread: http://forum.thegamecreators.com/?m=forum_view&t=188978&b=8

nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 11th Nov 2011 23:50
Well, that looks simple.. can this method handle multi-touch events?

So I was planning to use GetRawFirstTouchEvent() and similar commands.. I guess I still will have to for multi-touch?

nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 12th Nov 2011 01:18 Edited at: 12th Nov 2011 01:19
Update: Yes, I needed to use the event sequence and have got something working now for multi-event. Need to prise the xoom off my mrs to test it tomorrow, but looks good.

To answer your other question baxslash, I wasn't happy with the response from the virtual joystick for moving my character and wanted to see if swiping him around would work better. I would move him in a particular direction if the angle of the swipe was sufficient and could extend the "force" of his movement if the swipe angle was more acute... also, I may need to face him one way or another without moving and I think swiping would work well..

Oh.. and I have a fire button, so multi-event is essential really. I did think about the old android devices that don't have multi-touch and they will get auto-fire

Login to post a reply

Server time is: 2024-04-20 06:33:19
Your offset time is: 2024-04-20 06:33:19