
How it works...
You have created a player character in the scene using the girl1 sprite, and added a scripted component instance of class PlayerMove. You have also created a star GameObject (a pickup), tagged Star and with a 2D box collider that will trigger a collision when the player's character hits it. When you run the game, the player-girl1 character should move around using W A S D, the arrow keys, or joystick. There is a newVelocity variable, which is updated each frame in the Update() method based on the inputs. This Vector2 value is then applied in the FixedUpdate() method to become the new velocity for the GameObject.
Unity maps user inputs such as key presses, arrow keys, and game controller controls to its Input class. Two special properties of the Input class are the Horizontal and Vertical axes – accessed via the Input.GetAxis("Horizontal") and Input.GetAxis("Vertical") methods.
Currently, nothing will happen if the player-SpaceGirl character hits a star because that has yet to be scripted.
You have added a background (GameObject background-blue) to the scene, which will be behind everything since it is in the rearmost sorting layer, Background. Items you want to appear in front of the background (the player character and the star, so far) are placed on the Foreground sorting layer.