Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible), 637 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 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