Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (Grant), 999 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
quick question about moving objects #352972
01/06/11 22:03
01/06/11 22:03
Joined: Nov 2010
Posts: 21
E
elegant_mistake Offline OP
Newbie
elegant_mistake  Offline OP
Newbie
E

Joined: Nov 2010
Posts: 21
Hey I'm typing out some old AUM workshops to improve my skills. I was just wondering if anybody can explain to me how the following two lines of code work:

Code:
player_speed.x = 20 * mouse_force.y * time_step;
player_speed.y = -15 * mouse_force.x * time_step;



I understand what it does (it moves a little ship up, down, left, and right) but I don't understand why the player_speed.x is controlled by mouse_force.y. I thought it would be mouse_force.x.

If anybody has the time to answer this dumbass question, that would be really awesome.


I need to come up with a better signature
Re: quick question about moving objects [Re: elegant_mistake] #352974
01/06/11 22:11
01/06/11 22:11
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
mouse_force.y != 0 is true when you move the mouse up and down (push/ pull it from/ to you).
mouse_force.x != 0 is true when you move the mouse left or right.

The code seems to move the player upwards with player_speed.x, so you need to control the latter variable with the y-coordinate of the mouse speed vector.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends

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