Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Akow, degenerate_762), 1,430 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
mouse movement speed #402108
05/30/12 07:35
05/30/12 07:35
Joined: Jun 2011
Posts: 75
algeria
T
Tonyjack221 Offline OP
Junior Member
Tonyjack221  Offline OP
Junior Member
T

Joined: Jun 2011
Posts: 75
algeria
i want to get speed of the mouse
example:
mouse_ent.y +=mouse_moving*mouse_force.x;

i need that for Modified speed movement of object like speed of mouse


sorry for my English blush


Last edited by Tonyjack221; 05/30/12 07:36.
Re: mouse movement speed [Re: Tonyjack221] #402109
05/30/12 07:55
05/30/12 07:55
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
if i understood right, you want to move an object with the mouse cursor, so it always stays below it?
or just move it into the mouse movement direction?


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: mouse movement speed [Re: Espér] #402110
05/30/12 08:01
05/30/12 08:01
Joined: Apr 2008
Posts: 245
GameScore Offline
Member
GameScore  Offline
Member

Joined: Apr 2008
Posts: 245
mmh i think he want to know how fast the mouse is moving atm by user
this is mouse_force.x/mouse_force.y
i think...

Last edited by GameScore; 05/30/12 08:02.
Re: mouse movement speed [Re: Espér] #402111
05/30/12 08:06
05/30/12 08:06
Joined: Jun 2011
Posts: 75
algeria
T
Tonyjack221 Offline OP
Junior Member
Tonyjack221  Offline OP
Junior Member
T

Joined: Jun 2011
Posts: 75
algeria
yes is stays below it i don't know where is the problem

Re: mouse movement speed [Re: Tonyjack221] #402112
05/30/12 08:07
05/30/12 08:07
Joined: Jun 2011
Posts: 75
algeria
T
Tonyjack221 Offline OP
Junior Member
Tonyjack221  Offline OP
Junior Member
T

Joined: Jun 2011
Posts: 75
algeria
There is a discrepancy between the mouse and the object

Re: mouse movement speed [Re: GameScore] #402114
05/30/12 08:08
05/30/12 08:08
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Check the manual for the "mickey" vector. That might be what you're after.
Or you may e able to use it to calculate what you want...

Just be aware it is in PIXELS, not quants...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: mouse movement speed [Re: GameScore] #402115
05/30/12 08:10
05/30/12 08:10
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
the force variables are always -1,0 or 1 - this won't help you out laugh

what you need to do is:
Code:
VECTOR* mouse_speed = {x=0; y=0; z=0;}
VECTOR* mouse_old = {x=0; y=0; z=0;}

...

if(mouse_force.x != 0 || mouse_force.y != 0)
{
    mouse_speed.x = abs(mouse_pos.x - mouse_old.x);
    mouse_speed.y = abs(mouse_pos.y - mouse_old.y);
    vec_set(mouse_old.x, mouse_pos.x);
}



this should give you the distance speed in pixels of the mouse cursor..
i hope i didn't forget something.. written with my iPhone.. untested


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: mouse movement speed [Re: Espér] #402120
05/30/12 09:42
05/30/12 09:42
Joined: Jun 2011
Posts: 75
algeria
T
Tonyjack221 Offline OP
Junior Member
Tonyjack221  Offline OP
Junior Member
T

Joined: Jun 2011
Posts: 75
algeria
Espér
thank you
but how to use that code with that
function Move_x(ENTITY* moveme)
{

selecto=me;
while(1)
{
if(mouse_left == 1)
{
if(moveme==mouse_ent)
{
mouse_ent.y -=7*mouse_force.x;
my.ambient = 100;
}
}
wait(1);
}

}

Re: mouse movement speed [Re: Tonyjack221] #402122
05/30/12 10:04
05/30/12 10:04
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
explain what you want to create, please...
If you want to move an object by moving the mouse, your code works. if you always want to place an object below the mouse cursor, use c_trace and mouse_pos3d, if you want to move an object by the mouse_speed, use my code and use mouse_speed.x/y *accelerator_variable*time_step.


btw.. the mouse_ent in your code makes no sense, cause you want to move the Argumented Entity, and not the mouse_ent ^^

Last edited by Espér; 05/30/12 10:42.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: mouse movement speed [Re: Espér] #402127
05/30/12 11:06
05/30/12 11:06
Joined: Jun 2011
Posts: 75
algeria
T
Tonyjack221 Offline OP
Junior Member
Tonyjack221  Offline OP
Junior Member
T

Joined: Jun 2011
Posts: 75
algeria
thank you Espér it is work great


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1