Exemplo n.º 1
0
    public void MoveLeft()
    {
        Vector2 pos = mainPlayerModel.GetPosition();

        pos.x -= 0.1f;
        mainPlayerModel.SetNewPosition(pos);
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        Boot = GetComponent <M_Damagule>();
        Vector2 pos = MainPlayer.GetPosition();

        pos.x -= distanceFromMain;
        Boot.SetNewPosition(pos);
    }
Exemplo n.º 3
0
 // Update is called once per frame
 void Update()
 {
     if (Vector2.Distance(MainPlayer.GetPosition(), Boot.GetPosition()) > distanceFromMain)
     {
         Vector2 curPosition = Boot.GetPosition();
         if (curPosition.x < MainPlayer.GetPosition().x)
         {
             curPosition.x += 0.1f;
         }
         else
         {
             curPosition.x -= 0.1f;
         }
         Boot.SetNewPosition(curPosition);
     }
 }