Quantcast
Channel: Answers for "need explanation for a line of code."
Browsing index pages (4 articles)

Answer by CHPedersen

First of all, correct the code. It's wrong, and won't compile. It should be: public Vector2 speed = new Vector2(50, 50); Vector2 movement = new Vector2(speed.x * inputX,speed.y * inputY); Notice the...

View Article


Answer by jamesflowerdew

input on the x and y will be between 1 and -1 depending on the player's actions (0 if they are not touching anything ;)). mutiplying these by set values will convert these actions into movement at in...

View Article


Answer by CHPedersen

First of all, correct the code. It's wrong, and won't compile. It should be: public Vector2 speed = new Vector2(50, 50); Vector2 movement = new Vector2(speed.x * inputX,speed.y * inputY); Notice the...

View Article

Answer by jamesflowerdew

input on the x and y will be between 1 and -1 depending on the player's actions (0 if they are not touching anything ;)). mutiplying these by set values will convert these actions into movement at in...

View Article
Browsing index pages (4 articles)


Latest Images