Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 15,499 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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