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 / [SOLVED] Move sprite, Mouse to fast, Suggestions? (Source Included)

Author
Message
DannyD
7
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 24th Apr 2019 06:27
Hi Guys
I try to figure out how to implement a rotate and drag with the same button to cater for touch screens.
The follow code work kind of ok, but when dragging to fast, I loose the sprite.(Stop dragging)
Any suggestions? or much better ideas?

Attachments

Login to view attachments

The author of this post has marked a post as an answer.

Go to answer

xtremi
6
Years of Service
User Offline
Joined: 26th Aug 2018
Location:
Posted: 24th Apr 2019 07:18 Edited at: 24th Apr 2019 08:57
So I had a look, and I think its because you're calling getspritehit every frame, which slows things down.

I added in the beginning of your do loop:



and when you reset your timer:



Full code:



It looks like it works, have a try
DannyD
7
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 24th Apr 2019 08:52
This post has been marked by the post author as the answer.
Thank a million @xtremi

Appreciate the help

Cheers

Login to post a reply

Server time is: 2024-11-22 21:38:27
Your offset time is: 2024-11-22 21:38:27