---
# System prepended metadata

title: portpholio

---

# portpholio 
* Мене зваати Назар
* Мені 14 років
* Я шість місяців  вивчав  C#
* Бажаю навчитись пайтону,щоб в майбутньому повязати з цим роботу
* Ось мої основні коди:персонажа та ворога



+ Примітка я мені допомагали в написанні кода



```csharp=
using UnityEngine;

public class player : MonoBehaviour
{
    public Rigidbody2D rig;
    public float speed;
    public SpriteRenderer rer;
    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKey(KeyCode.D))
        {
            rer.flipX = false;
            transform.Translate(Vector3.right * speed * Time.deltaTime);
        }
        if (Input.GetKey(KeyCode.A))
        {
            rer.flipX = true;
            transform.Translate(Vector3.left * speed * Time.deltaTime);
        }
        if (Input.GetKeyDown(KeyCode.Space))
        {
            rig.AddForce(Vector3.up * 500);
        }
        




    }
    private bool _isOnLadder;

    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Ladder")
            _isOnLadder = true;
    }
    private void OnTriggerExit(Collider other)
    {
        if (other.gameObject.tag == "Ladder")
            _isOnLadder = false;
    }
}
```

```csharp=
using UnityEngine;

public class player : MonoBehaviour
{
    public Rigidbody2D rig;
    public float speed;
    public SpriteRenderer rer;
    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKey(KeyCode.D))
        {
            rer.flipX = false;
            transform.Translate(Vector3.right * speed * Time.deltaTime);
        }
        if (Input.GetKey(KeyCode.A))
        {
            rer.flipX = true;
            transform.Translate(Vector3.left * speed * Time.deltaTime);
        }
        if (Input.GetKeyDown(KeyCode.Space))
        {
            rig.AddForce(Vector3.up * 500);
        }
        




    }
    private bool _isOnLadder;

    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Ladder")
            _isOnLadder = true;
    }
    private void OnTriggerExit(Collider other)
    {
        if (other.gameObject.tag == "Ladder")
            _isOnLadder = false;
    }
}
```

 код 1

```python=
import turtle
turtle.color("red")
turtle.forward(150)
turtle.left(90)
turtle.forward(150)
turtle.left(90)
turtle.forward(50)
turtle.left(90)
turtle.forward(150)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(150)
turtle.left(90)
turtle.forward(50)
turtle.left(90)
turtle.forward(150)
turtle.backward(50)
turtle.left(90)
turtle.forward(150)
turtle.left(90)
turtle.forward(50)
turtle.left(90)
turtle.forward(150)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(100)
```
 код 2

```  python=
import turtle
turtle.forward(50)
turtle.left(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(50)
turtle.left(90)
turtle.forward(50)
turtle.left(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(50)
turtle.left(90)
turtle.forward(50)
turtle.left(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
turtle.forward(50)
turtle.left(90)
```
код 3

```  python=
import turtle

def side():
  turtle.forward(50)
  turtle.left(90)
  turtle.forward(50)
  turtle.left(90)
  turtle.forward(50)
  turtle.left(90)
  turtle.forward(50)
  turtle.left(90)
  turtle.forward(100)

side()
side()
side()
side()
```
код 4
```  python=
import turtle

turtle.forward(20)
turtle.penup()
turtle.backward(30)
turtle.right(90)
turtle.forward(20)
turtle.pendown()
turtle.left(90)

turtle.forward(40)
turtle.penup()
turtle.backward(60)
turtle.right(90)
turtle.forward(20)
turtle.pendown()
turtle.left(90)
  
turtle.forward(80)
turtle.penup()
turtle.backward(120)
turtle.right(90)
turtle.forward(20)
turtle.pendown()
turtle.left(90)

turtle.forward(160)
turtle.penup()
turtle.backward(240)
turtle.right(90)
turtle.forward(20)
turtle.pendown()
turtle.left(90)
```

код 5
```  python=
def changecolor_1():
    turtle.color("green")

turtle.speed(0)

def move(x, y):
    turtle.goto(x, y)
    turtle.dot(10)

turtle.onscreenclick(move)

def rotate_left():
    turtle.left(15)

def rotate_right():
    turtle.left(-15)

turtle.onkey(rotate_left, "Left")
turtle.onkey(rotate_right, "Right")
turtle.onkey(changecolor_1,1)

turtle.listen()

while True:
     turtle.forward(2)
     ```
  
  код 6
```  python=
     import turtle

turtle.left(90)
turtle.forward(150)
turtle.backward(75)
turtle.left(90)
turtle.backward(50)
turtle.right(90)
turtle.forward(75)
turtle.backward(150)
turtle.left(90)
turtle.penup()
turtle.backward(30)
turtle.pendown()

turtle.right(90)
turtle.forward(150)
turtle.right(90)
turtle.forward(66)
turtle.backward(66)
turtle.right(90)
turtle.forward(75)
turtle.left(90)
turtle.forward(66)
turtle.backward(66)
turtle.right(90)
turtle.forward(75)
turtle.left(90)
turtle.forward(75)
turtle.penup()
turtle.forward(30)
turtle.pendown()

turtle.left(90)
turtle.forward(150)
turtle.backward(150)
turtle.left(90)
turtle.backward(66)
turtle.left(180)
turtle.penup()
turtle.forward(30)
turtle.pendown()

turtle.left(90)
turtle.forward(150)
turtle.backward(150)
turtle.left(90)
turtle.backward(66)
turtle.left(180)
turtle.penup()
turtle.forward(70)
turtle.pendown()

turtle.forward(50)
turtle.left(45)
turtle.forward(30)
turtle.left(45)
turtle.forward(90)
turtle.left(45)
turtle.forward(30)
turtle.left(45)
turtle.forward(50)
turtle.left(45)
turtle.forward(30)
turtle.left(45)
turtle.forward(90)
turtle.left(45)
turtle.forward(30)
``` 
     
     код 7
```  python=  
import turtle
turtle.pensize(3)
turtle.left(75)
turtle.forward(75)
turtle.right(145)
turtle.forward(75)
turtle.right(145)
turtle.forward(75)
turtle.right(145)
turtle.forward(75)
turtle.right(142)
turtle.forward(75)
```


 код 8
```  python=  
import turtle
import time

def onleft():
    turtle.left(90)

def onright():
    turtle.right(90)

def scene1():
    turtle.onkey(onleft, "Left")
    turtle.onkey(onright, "Right")
    turtle.listen()

    turtle.tracer(0)
    turtle.fillcolor("red")

    turtle.shape("circle")
    turtle.stamp()
    turtle.stamp()
    turtle.stamp()
    turtle.stamp()
    turtle.stamp()
    turtle.stamp()
    turtle.stamp()
    turtle.stamp()
    turtle.stamp()
    turtle.stamp()
    turtle.stamp()
    turtle.stamp()
    turtle.stamp()
    turtle.stamp()
    turtle.stamp()
    turtle.stamp()
    turtle.stamp()
    turtle.stamp()
    turtle.stamp()
    turtle.stamp()

    while True:
        turtle.forward(5)
        turtle.stamp()
        turtle.clearstamps(1)
        turtle.update()
        time.sleep(0.015)

scene1() 
```

 код 9-пряма лінія
```  python= 
import turtle
import math
import time
turtle.bgcolor(1,0,0)
turtle.tracer(0,0)

def move(x):
    turtle.goto(18*-x,3*x)

def scene(t0):
    while True:
        move(22 * (time.time() - t0))
        time.sleep(0.01)
        turtle.update()

scene(time.time())
```

 код 10-клавіатура
```  python= 
import turtle


def ride_cube():
    turtle.clear()
    turtle.forward(50)
    turtle.left(90)
    turtle.forward(50)
    turtle.left(90)
    turtle.forward(50)
    turtle.left(90)
    turtle.forward(50)
    turtle.left(90)
    
def ride_sixthgrader():
    turtle.clear()
    turtle.forward(50)
    turtle.left(60)
    turtle.forward(50)
    turtle.left(60)
    turtle.forward(50)
    turtle.left(60)
    turtle.forward(50)
    turtle.left(60)
    turtle.forward(50)
    turtle.left(60)
    turtle.forward(50)
    turtle.left(60)
    
def ride_octagon():
    turtle.clear()
    turtle.forward(50)
    turtle.left(45)
    turtle.forward(50)
    turtle.left(45)
    turtle.forward(50)
    turtle.left(45)
    turtle.forward(50)
    turtle.left(45)
    turtle.forward(50)
    turtle.left(45)
    turtle.forward(50)
    turtle.left(45)
    turtle.forward(50)
    turtle.left(45)
    turtle.forward(50)
    turtle.left(45)

def ride_triangle():
    turtle.clear()
    turtle.forward(100)
    turtle.left(120)
    turtle.forward(100)
    turtle.left(120)
    turtle.forward(100)
    turtle.left(120)
    
def ride_sircle():
    turtle.clear()
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)    
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
      
def ride_line():
    turtle.clear()
    turtle.forward(100) 
    
def ride_piramide():
    turtle.clear()
    turtle.forward(20)
    turtle.penup()
    turtle.backward(30)
    turtle.right(90)
    turtle.forward(20)
    turtle.pendown()
    turtle.left(90)
    turtle.forward(40)
    turtle.penup()
    turtle.backward(60)
    turtle.right(90)
    turtle.forward(20)
    turtle.pendown()
    turtle.left(90)
    turtle.forward(80)
    turtle.penup()
    turtle.backward(120)
    turtle.right(90)
    turtle.forward(20)
    turtle.pendown()
    turtle.left(90)
    turtle.forward(160)
    turtle.penup()
    turtle.backward(240)
    turtle.right(90)
    turtle.forward(20)
    turtle.pendown()
    turtle.left(90)
    
    
      
turtle.onkey(ride_cube, "q")
turtle.onkey(ride_sixthgrader, "w")
turtle.onkey(ride_octagon, "e")
turtle.onkey(ride_triangle, "r")
turtle.onkey(ride_sircle, "t")
turtle.onkey(ride_line, "y") 
turtle.onkey(ride_piramide, "u") 




turtle.listen()import turtle


def ride_cube():
    turtle.clear()
    turtle.forward(50)
    turtle.left(90)
    turtle.forward(50)
    turtle.left(90)
    turtle.forward(50)
    turtle.left(90)
    turtle.forward(50)
    turtle.left(90)
    
def ride_sixthgrader():
    turtle.clear()
    turtle.forward(50)
    turtle.left(60)
    turtle.forward(50)
    turtle.left(60)
    turtle.forward(50)
    turtle.left(60)
    turtle.forward(50)
    turtle.left(60)
    turtle.forward(50)
    turtle.left(60)
    turtle.forward(50)
    turtle.left(60)
    
def ride_octagon():
    turtle.clear()
    turtle.forward(50)
    turtle.left(45)
    turtle.forward(50)
    turtle.left(45)
    turtle.forward(50)
    turtle.left(45)
    turtle.forward(50)
    turtle.left(45)
    turtle.forward(50)
    turtle.left(45)
    turtle.forward(50)
    turtle.left(45)
    turtle.forward(50)
    turtle.left(45)
    turtle.forward(50)
    turtle.left(45)

def ride_triangle():
    turtle.clear()
    turtle.forward(100)
    turtle.left(120)
    turtle.forward(100)
    turtle.left(120)
    turtle.forward(100)
    turtle.left(120)
    
def ride_sircle():
    turtle.clear()
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)    
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
    turtle.forward(10)
    turtle.left(10)
      
def ride_line():
    turtle.clear()
    turtle.forward(100) 
    
def ride_piramide():
    turtle.clear()
    turtle.forward(20)
    turtle.penup()
    turtle.backward(30)
    turtle.right(90)
    turtle.forward(20)
    turtle.pendown()
    turtle.left(90)
    turtle.forward(40)
    turtle.penup()
    turtle.backward(60)
    turtle.right(90)
    turtle.forward(20)
    turtle.pendown()
    turtle.left(90)
    turtle.forward(80)
    turtle.penup()
    turtle.backward(120)
    turtle.right(90)
    turtle.forward(20)
    turtle.pendown()
    turtle.left(90)
    turtle.forward(160)
    turtle.penup()
    turtle.backward(240)
    turtle.right(90)
    turtle.forward(20)
    turtle.pendown()
    turtle.left(90)
    
    
      
turtle.onkey(ride_cube, "q")
turtle.onkey(ride_sixthgrader, "w")
turtle.onkey(ride_octagon, "e")
turtle.onkey(ride_triangle, "r")
turtle.onkey(ride_sircle, "t")
turtle.onkey(ride_line, "y") 
turtle.onkey(ride_piramide, "u") 




turtle.listen()
```