Mouse Movement with Speed and Smoothing Control

Post your own tutorials, guides and demos.

Post » Mon Aug 16, 2010 11:16 pm

Mouse Movement with Speed and Smoothing control

http://dl.dropbox.com/u/1010927/Mousemovement.cap

download the .cap, its fairly straightforward

the 'speed' variable controls the movement speed of the mouses as a decimal from ]0 , 8[

0.5= half real speed, 1= real speed, 2= double real speed etc.

the 'smoothscalar' variable controls the smoothing speed of the mouses as a value from ]0 , 1]

1= no smoothing, 0.8= fast smoothing, 0.5=medium smoothing, 0.2=slow smoothing etc.

using 0 will break both of them, don't. Using a value larger than 1 for smoothing just messes it up, since its relying on division, don't do this aswell.

The Only Event required for this to work is the first Always event, The order of the actions DOES matter, so pay mind to them when you're putting this into your game.

Hope this was Useful!

~Quazi
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Wed Aug 18, 2010 2:03 am

Something is going wrong when i run this Quazi, the cursor dot(sprite) is constantly drifting to the left.
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Wed Aug 18, 2010 3:12 am

I think Its some problem with the window object handling the caption size, it should work well with caption in application properties turned off though.

what windows are you using? it works fine with my vista version, but perhaps on XP it doesnt, since the caption is a different size?

Whoever changed/fixed the window object probably neglected to realize this?
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Wed Aug 18, 2010 5:29 pm

Cant open it in version 09991, because it was saved in a newer version. Something wrong or do i just need the unstable build?
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Thu Aug 19, 2010 4:13 am

[quote="Attan":2ozx1vvn]Cant open it in version 09991, because it was saved in a newer version. Something wrong or do i just need the unstable build?[/quote:2ozx1vvn]

afraid so
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Fri Aug 20, 2010 6:08 am

nice!
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Tue Aug 24, 2010 12:03 am

new plugin to use directinput mouse movement detection to save yourself the trouble:
[url:1i0mieyd]http://www.scirra.com/forum/viewtopic.php?f=2&t=7111[/url:1i0mieyd]
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Tue Aug 24, 2010 2:45 am

Cheers Lucid.

Also, yeah Quazi, I am on Xp, and turning the caption off made it work perfectly.
B
9
S
2
G
4
Posts: 346
Reputation: 2,726


Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 0 guests