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 / get pointer pressed issue / touch

Author
Message
Cor
AGK Developer
13
Years of Service
User Offline
Joined: 19th Dec 2010
Location: Its a trap!
Posted: 4th Dec 2012 20:50
Hello,

I am currently working on a new ios app that is using get pointer pressed to detect if a user has tapped the screen. The issue I am having is that when I test the app on my devices the Ipad seems to struggle with detecting the get pointer pressed command. (sometimes it will work then randomly it doesnt detect the press.) Has anyone else had any problems with touches?

The app is running at 59/60 frames on the Ipad.

AGK version: 1076
AGK player version: 1076

Thank you for your time!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Dec 2012 21:12
It would help to see the code you are using to detect the pointer press.

It's hard to tell what is happening without knowing how you are trying to do what you are doing.

I use the pointer quite actively in my app and it works fine. I use GetPointerReleased to determine when the player touches (presses and releases) on the screen.

Cheers,
Ancient Lady
AGK Community Tester
Cor
AGK Developer
13
Years of Service
User Offline
Joined: 19th Dec 2010
Location: Its a trap!
Posted: 4th Dec 2012 21:22 Edited at: 4th Dec 2012 21:27
Sorry about not posting the code...
Here it is, the code is for my player jumping



normally it wouldnt be that big of a deal because it only stops working every once in awhile. However since the game is very fast paced it is bad when you miss a jump and face plant into a spike.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Dec 2012 21:42
The order of commands is what is messing you up. Try this (I put comments on a separate line for better readability):


This code does the minimum amount of work to accomplish your goal (as it appears in your code). The repeated calls to getpointerpressed were what was messing you up.

Cheers,
Ancient Lady
AGK Community Tester
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Dec 2012 21:49 Edited at: 4th Dec 2012 21:54
You also might trying using the commands GetContactSpriteID1 and GetContactSpriteID2 instead of the loop:


EDIT: fixed usage a bit and removed the loop, since you only need to check if the id is in range.

Cheers,
Ancient Lady
AGK Community Tester
Cor
AGK Developer
13
Years of Service
User Offline
Joined: 19th Dec 2010
Location: Its a trap!
Posted: 4th Dec 2012 21:58
doh thanks a bunch! I will put that in when i have some time and post back later on how it works!

Login to post a reply

Server time is: 2024-11-24 03:39:50
Your offset time is: 2024-11-24 03:39:50