the speed of the mouse pointer in Construct 2

Get help using Construct 2

Post » Fri Nov 20, 2015 2:24 pm

Hello Guys
i have one question.
How to change the speed of the mouse pointer in Construct 2
without changing the settings of the windows

thanks in advance
Last edited by zenox98 on Fri Nov 20, 2015 2:27 pm, edited 1 time in total.
Reason: Moved to a more appropriate section
B
3
Posts: 3
Reputation: 181

Post » Fri Nov 20, 2015 2:30 pm

cheaterman wrote:Hello Guys
i have one question.
How to change the speed of the mouse pointer in Construct 2
without changing the settings of the windows

thanks in advance



As far as I am aware you can't.

The mousemove events - so Google tells me - are generated by the browser, and so you are receiving them as fast as the browser is generating them.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
126
S
29
G
72
Posts: 5,030
Reputation: 51,370

Post » Fri Nov 20, 2015 3:20 pm

Although I think it would make the game less playable and intuitive you could always try something like this:

create a sprite that will represent your mouse-pointer, give it the bullet-behaviour and (turn of set angle) set the speed to the speed you want..

On start of layout set the mouse pointer style to none

Every tick
set the angle of motion to angle(sprite.x,sprite.y,mouse.x,mouse.y)
set the speed to your desired speed..


if distance(sprite.x,sprite.y,mouse.x,mouse.y) < a certain amount
set the postion of the sprite to mouse.x,mouse.y
set the bullet speed to 0
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
53
S
16
G
8
Posts: 6,157
Reputation: 19,744

Post » Fri Nov 20, 2015 3:28 pm

Just thinking out loud. If you wanted to slow the mouse down then you could hide the mouse, create a mouse sprite and have this sprite move towards the mouses position. I guess you would then have to write your own conditions e.g. if the mouse is clicked then you would have to check what the sprite was over rather than relying on the mouse conditions.

If you wanted it to go faster then I guess (definitely not tested) you could go through loop of remembering where the mouse was compared to when it is and then multiplying this distance by the required amount. You would then need to move the mouse to this new distance and start to loop again. No idea how jerky this would be.

Edit - I wish I could type faster. :-)
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
62
S
31
G
39
Posts: 1,194
Reputation: 26,512

Post » Fri Nov 20, 2015 3:44 pm

Example of @RamPackWobble and my suggestion
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
53
S
16
G
8
Posts: 6,157
Reputation: 19,744

Post » Fri Nov 20, 2015 4:22 pm

Ok, see if the sample solve in your case.
B
25
S
9
G
3
Posts: 251
Reputation: 4,017

Post » Fri Nov 20, 2015 6:25 pm

Thanks for the help, but it does not work as a standard mouse in windows OS. Sometimes she twitches and late. Before that I tried everything, from 8 directions, but the bullet etc ... But nothing has not worked. I am confused by the fact that the developers have not considered such an important thing in a plugin mouse. Sorry for my english :)
B
3
Posts: 3
Reputation: 181

Post » Fri Nov 20, 2015 7:07 pm

cheaterman wrote:Thanks for the help, but it does not work as a standard mouse in windows OS. Sometimes she twitches and late. Before that I tried everything, from 8 directions, but the bullet etc ... But nothing has not worked. I am confused by the fact that the developers have not considered such an important thing in a plugin mouse. Sorry for my english :)


Which developers are you refering to?
Those that make browsers?

"Sometimes she twitches and late.."

Because we can't acces the speed of the mouse directly, it still moves at the same speed, so this is only a way to slow down the movement of the cursor while moving, the moment you stop moving the mouse it could well be the cursor hasn't caught up yet..
the twitching can be avoided with some tweaking..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
53
S
16
G
8
Posts: 6,157
Reputation: 19,744

Post » Fri Nov 20, 2015 7:36 pm

I mean , the developers construct 2. Because a mouse is connected via plug-in construct 2.
B
3
Posts: 3
Reputation: 181

Post » Fri Nov 20, 2015 8:01 pm

cheaterman wrote:I mean , the developers construct 2. Because a mouse is connected via plug-in construct 2.


It just isn't possible..
Games exported from Construct2 are html5/javascript-based and run in a browser-environment..
Javascript can't get control over the cursor/mouse..
These settings are handled by the operating system to which you can't get control from the browser..

You could ask the browser creators to make hijacking computers easier by giving websites acces to system settings, but I don't think they'll see benefits..
You can hardly blame the Construct2 developers for not giving acces to something that isn't accesible..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
53
S
16
G
8
Posts: 6,157
Reputation: 19,744

Next

Return to How do I....?