Python Pikachu character printing code, python code for drawing Pikachu

Hello everyone, this article will focus on drawing a cute Pikachu with python. The python Pikachu character printing code is something that many people want to understand. If you want to understand the python Pikachu programming code tutorial, you need to understand the following things first.

1. Python Pikachu programming code

import turtle
def getPosition(x, y):
turtle.setx(x)
turtle.sety(y)
print(x, y)
class Pikachu:
def __init__(self):
self.t = turtle.Turtle()
t = self.t
t.pensize(3)
t.speed(9)
t.ondrag(getPosition)
def noTrace_goto(self, x, y):
self.t.penup()
self.t.goto(x, y)
self.t.pendown()
def leftEye(self, x, y):
self.noTrace_goto(x, y)
t = self.t
t.seth(0)
t.fillcolor('#333333')
t.begin_fill()
t.circle(22)
t.end_fill()
self.noTrace_goto(x, y+10)
t.fillcolor('#000000')
t.begin_fill()
t.circle(10)
t.end_fill()
self.noTrace_goto(x+6, y + 22)
t.fillcolor('#ffffff')
t.begin_fill()
t.circle(10)
t.end_fill()
def rightEye(self, x, y):
self.noTrace_goto(x, y)
t = self.t
t.seth(0)
t.fillcolor('#333333')
t.begin_fill()
t.circle(22)
t.end_fill()
self.noTrace_goto(x, y+10)
t.fillcolor('#000000')
t.begin_fill()
t.circle(10)
t.end_fill()
self.noTrace_goto(x-6, y + 22)
t.fillcolor('#ffffff')
t.begin_fill()
t.circle(10)
t.end_fill()
def mouth(self, x, y):
self.noTrace_goto(x, y)
t = self.t
t.fillcolor('#88141D')
t.begin_fill()
# 下嘴唇
l1 = []
l2 = []
t.seth(190)
a = 0.7
for i in range(28):
a += 0.1
t.right(3)
t.fd(a)
l1.append(t.position())

self.noTrace_goto(x, y)

t.seth(10)
a = 0.7
for i in range(28):
a += 0.1
t.left(3)
t.fd(a)
l2.append(t.position())

# 上嘴唇

t.seth(10)
t.circle(50, 15)
t.left(180)
t.circle(-50, 15)

t.circle(-50, 40)
t.seth(233)
t.circle(-50, 55)
t.left(180)
t.circle(50, 12.1)
t.end_fill()
# 舌头
self.noTrace_goto(17, 54)
t.fillcolor('#DD716F')
t.begin_fill()
t.seth(145)
t.circle(40, 86)
t.penup()
for pos in reversed(l1[:20]):
t.goto(pos[0], pos[1]+1.5)
for pos in l2[:20]:
t.goto(pos[0], pos[1]+1.5)
t.pendown()
t.end_fill()
# 鼻子
self.noTrace_goto(-17, 94)
t.seth(8)
t.fd(4)
t.back(8)
# 红脸颊
def leftCheek(self, x, y):
turtle.tracer(False)
t = self.t
self.noTrace_goto(x, y)
t.seth(300)
t.fillcolor('#DD4D28')
t.begin_fill()
a = 2.3
for i in range(120):
if 0 <= i < 30 or 60 <= i < 90:
a -= 0.05
t.lt(3)
t.fd(a)
else:
a += 0.05
t.lt(3)
t.fd(a)
t.end_fill()
turtle.tracer(True)
def rightCheek(self, x, y):
t = self.t
turtle.tracer(False)
self.noTrace_goto(x, y)
t.seth(60)
t.fillcolor('#DD4D28')
t.begin_fill()
a = 2.3
for i in range(120):
if 0 <= i < 30 or 60 <= i < 90:
a -= 0.05
t.lt(3)
t.fd(a)
else:
a += 0.05
t.lt(3)
t.fd(a)
t.end_fill()
turtle.tracer(True)
def colorLeftEar(self, x, y):
t = self.t
self.noTrace_goto(x, y)
t.fillcolor('#000000')
t.begin_fill()
t.seth(330)
t.circle(100, 35)
t.seth(219)
t.circle(-300, 19)
t.seth(110)
t.circle(-30, 50)
t.circle(-300, 10)
t.end_fill()
def colorRightEar(self, x, y):
t = self.t
self.noTrace_goto(x, y)
t.fillcolor('#000000')
t.begin_fill()
t.seth(300)
t.circle(-100, 30)
t.seth(35)
t.circle(300, 15)
t.circle(30, 50)
t.seth(190)
t.circle(300, 17)
t.end_fill()
def body(self):
t = self.t
t.fillcolor('#F6D02F')
t.begin_fill()
# 右脸轮廓
t.penup()
t.circle(130, 40)
t.pendown()
t.circle(100, 105)
t.left(180)
t.circle(-100, 5)
# 右耳朵
t.seth(20)
t.circle(300, 30)
t.circle(30, 50)
t.seth(190)
t.circle(300, 36)
# 上轮廓
t.seth(150)
t.circle(150, 70)

# 左耳朵
t.seth(200)
t.circle(300, 40)
t.circle(30, 50)
t.seth(20)
t.circle(300, 35)
#print(t.pos())
# 左脸轮廓
t.seth(240)
t.circle(105, 95)
t.left(180)
t.circle(-105, 5)
# 左手
t.seth(210)
t.circle(500, 18)
t.seth(200)
t.fd(10)
t.seth(280)
t.fd(7)
t.seth(210)
t.fd(10)
t.seth(300)
t.circle(10, 80)
t.seth(220)
t.fd(10)
t.seth(300)
t.circle(10, 80)
t.seth(240)
t.fd(12)
t.seth(0)
t.fd(13)
t.seth(240)
t.circle(10, 70)
t.seth(10)
t.circle(10, 70)
t.seth(10)
t.circle(300, 18)
t.seth(75)
t.circle(500, 8)
t.left(180)
t.circle(-500, 15)
t.seth(250)
t.circle(100, 65)
# 左脚
t.seth(320)
t.circle(100, 5)
t.left(180)
t.circle(-100, 5)
t.seth(220)
t.circle(200, 20)
t.circle(20, 70)
t.seth(60)
t.circle(-100, 20)
t.left(180)
t.circle(100, 20)
t.seth(300)
t.circle(10, 70)
t.seth(60)
t.circle(-100, 20)
t.left(180)
t.circle(100, 20)
t.seth(10)
t.circle(100, 60)
# 横向
t.seth(180)
t.circle(-100, 10)
t.left(180)
t.circle(100, 10)
t.seth(5)
t.circle(100, 10)
t.circle(-100, 40)
t.circle(100, 35)
t.left(180)
t.circle(-100, 10)
# 右脚
t.seth(290)
t.circle(100, 55)
t.circle(10, 50)
t.seth(120)
t.circle(100, 20)
t.left(180)
t.circle(-100, 20)
t.seth(0)
t.circle(10, 50)
t.seth(110)
t.circle(100, 20)
t.left(180)
t.circle(-100, 20)
t.seth(30)
t.circle(20, 50)
t.seth(100)
t.circle(100, 40)
# 右侧身体轮廓
t.seth(200)
t.circle(-100, 5)
t.left(180)
t.circle(100, 5)
t.left(30)
t.circle(100, 75)
t.right(15)
t.circle(-300, 21)
t.left(180)
t.circle(300, 3)
# 右手
t.seth(43)
t.circle(200, 60)
t.right(10)
t.fd(10)
t.circle(5, 160)
t.seth(90)
t.circle(5, 160)
t.seth(90)
t.fd(10)
t.seth(90)
t.circle(5, 180)
t.fd(10)
t.left(180)
t.left(20)
t.fd(10)
t.circle(5, 170)
t.fd(10)
t.seth(240)
t.circle(50, 30)
t.end_fill()
self.noTrace_goto(130, 125)
t.seth(-20)
t.fd(5)
t.circle(-5, 160)
t.fd(5)
# 手指纹
self.noTrace_goto(166, 130)
t.seth(-90)
t.fd(3)
t.circle(-4, 180)
t.fd(3)
t.seth(-90)
t.fd(3)
t.circle(-4, 180)
t.fd(3)
# 尾巴
self.noTrace_goto(168, 134)
t.fillcolor('#F6D02F')
t.begin_fill()
t.seth(40)
t.fd(200)
t.seth(-80)
t.fd(150)
t.seth(210)
t.fd(150)
t.left(90)
t.fd(100)
t.right(95)
t.fd(100)
t.left(110)
t.fd(70)
t.right(110)
t.fd(80)
t.left(110)
t.fd(30)
t.right(110)
t.fd(32)
t.right(106)
t.circle(100, 25)
t.right(15)
t.circle(-300, 2)
##############
#print(t.pos())
t.seth(30)
t.fd(40)
t.left(100)
t.fd(70)
t.right(100)
t.fd(80)
t.left(100)
t.fd(46)
t.seth(66)
t.circle(200, 38)
t.right(10)
t.fd(10)
t.end_fill()
# 尾巴花纹
t.fillcolor('#923E24')
self.noTrace_goto(126.82, -156.84)
t.begin_fill()

t.seth(30)
t.fd(40)
t.left(100)
t.fd(40)
t.pencolor('#923e24')
t.seth(-30)
t.fd(30)
t.left(140)
t.fd(20)
t.right(150)
t.fd(20)
t.left(150)
t.fd(20)
t.right(150)
t.fd(20)
t.left(130)
t.fd(18)
t.pencolor('#000000')
t.seth(-45)
t.fd(67)
t.right(110)
t.fd(80)
t.left(110)
t.fd(30)
t.right(110)
t.fd(32)
t.right(106)
t.circle(100, 25)
t.right(15)
t.circle(-300, 2)
t.end_fill()
# 帽子、眼睛、嘴巴、脸颊
self.cap(-134.07, 147.81)
self.mouth(-5, 25)
self.leftCheek(-126, 32)
self.rightCheek(107, 63)
self.colorLeftEar(-250, 100)
self.colorRightEar(140, 270)
self.leftEye(-85, 90)
self.rightEye(50, 110)
t.hideturtle()
def cap(self, x, y):
self.noTrace_goto(x, y)
t = self.t
t.fillcolor('#CD0000')
t.begin_fill()
t.seth(200)
t.circle(400, 7)
t.left(180)
t.circle(-400, 30)
t.circle(30, 60)
t.fd(50)
t.circle(30, 45)
t.fd(60)
t.left(5)
t.circle(30, 70)
t.right(20)
t.circle(200, 70)
t.circle(30, 60)
t.fd(70)
# print(t.pos())
t.right(35)
t.fd(50)
t.circle(8, 100)
t.end_fill()
self.noTrace_goto(-168.47, 185.52)
t.seth(36)
t.circle(-270, 54)
t.left(180)
t.circle(270, 27)
t.circle(-80, 98)
t.fillcolor('#444444')
t.begin_fill()
t.left(180)
t.circle(80, 197)
t.left(58)
t.circle(200, 45)
t.end_fill()
self.noTrace_goto(-58, 270)
t.pencolor('#228B22')
t.dot(35)
self.noTrace_goto(-30, 280)
t.fillcolor('#228B22')
t.begin_fill()
t.seth(100)
t.circle(30, 180)
t.seth(190)
t.fd(15)
t.seth(100)
t.circle(-45, 180)
t.right(90)
t.fd(15)
t.end_fill()
t.pencolor('#000000')
def start(self):
self.body()
def main():
print('Painting the Pikachu... ')
turtle.screensize(800, 600)
turtle.title('Pikachu')
pikachu = Pikachu()
pikachu.start()
turtle.mainloop()
if __name__ == '__main__':
main()

2. I used python to draw Pikachu, and there was no error. I also opened the cmd window and entered page22.py. Import turtle was also added in front.

Command line input: python page22.py
If python is not an environment variable, please add the environment variable

3. How to draw Pikachu

Pikachu is drawn as follows:

1. First draw the outline of Pikachu's head, which has two long ears.

2. The tips of Pikachu's ears are black, draw Pikachu's big round eyes.

3. Then draw its mouth, which is laughing happily.

4. Then draw Pikachu's body, with both hands pointing up.

5. Draw Pikachu's body, one of its feet is moving forward, and a long lightning-like tail.

6. Finally, paint Pikachu with beautiful colors, and the cute Pikachu stick figure is complete!

Pikachu is one of the elves appearing in the handheld game series "Pokemon" developed by Nintendo of Japan. A representative character in Pokemon.

With the popularity of its surrounding animated Pokemon (that is, Pokémon) animations, the charm of this Pokémon has gradually begun to be accepted by players of lower age groups, and it has led to female players, marking the beginning of this Pikachu trend. arrival. Pikachu was chosen as Japan's official mascot for the 2014 World Cup in Brazil.

Designed by Game Freak's design team and finalized by Ken Sugimori, Pikachu's figure is one of the few Pokémon figures that stand out from the crowd.

According to Satoshi Tajiri, creator of the Pokémon series, Pikachu's name comes from the Japanese pika (the sound of electric sparks) and chu (the sound of mice).

Developer Junichi Masuda noted that Pikachu's name was one of the most difficult Pokémon names to create in order to appeal to both Japanese and American audiences.

4. How to draw Pikachu How to draw Pikachu?

How to draw Pikachu:
1. Draw the top of the head (like an open book), and draw the outline of Pikachu's cheeks.
2. Draw Pikachu's cute short hands, and use arcs to connect the ears and cheeks.
3. Next, draw the outline of the body, and draw two flat ovals to be Pikachu's little feet.
4. Connect the body with the feet, a lightning-shaped tail, and a point in the middle of the face as a nose. Draw the details of the mouth and ears in turn.
5. Draw four circles on the face, which are the eyes and cheeks, and draw the highlights of the eyes. Finally, color it with the corresponding color in turn!

5. How to draw a Pikachu

A Pikachu is drawn as follows:

1. First, let's draw Pikachu's head. Be sure to draw the pointed ears and oval face.

2. The next step is to draw Pikachu's body and limbs. Remember to draw its arms and legs shorter to make it look cuter.

3. Draw cute facial features and round red cheeks, and draw a lightning-shaped tail for Pikachu.

4. Paint black on the tips of Pikachu's ears, and the line drawing of a cute Pikachu is ready.

5. The last thing is to paint the color. You only need three colors: yellow body, red face, pink mouth, and a Pikachu is ready.

Character image:

Pikachu is a squat, round, rodent-like Pokémon with yellow fur all over his body. Its ears are long with black tips. It has a small mouth, looks like a number 3 on the side, and black eyes. It has two red circles on its cheeks.

Its tail is like a jagged lightning bolt, and the part where it meets the body also has a patch of brown fur. Although it is strictly a quadruped, it more often stands and walks on two hind feet. Living in forests, they usually feed on tree fruit. They use small electric shocks to knock the berries out of the trees so they don't have to climb them, and they roast them as well.

Wild Pikachu mostly move in groups and rarely stay in one place. Pikachu has excellent hearing thanks to its large ears. Many domesticated Pikachu can understand and interpret human speech, even better than most pet dogs.

6. How To Draw A Pikachu

Here's how to draw a Pikachu:

1. First draw the outline of Pikachu's face and ears, draw an arc above the ears and blacken the tips of the ears, then draw Pikachu's body and feet, and then draw the eyes, nose, mouth and cheeks.

2. Then draw Pikachu's hands and lightning-shaped tail, draw hearts on both sides of Pikachu, and finally paint Pikachu and the heart.

3. Draw two squares first, relying on your eyesight as much as possible, without using a ruler, draw lightly with a pencil.

The second method is as follows:

Draw a circle in the box, pencil, lightly, diagonal auxiliary line, again please remind: draw lightly, draw the vertical center line, the auxiliary line is very important if you have not finished drawing the auxiliary line yet.

Draw two horizontal guides across the square, then draw another horizontal line under them. Draw the position of Pikachu's thigh in the lower part, tap it lightly.

Draw the position of Pikachu's toes, draw Pikachu's feet, and the small circle between the two circles is the position of the shoulders. You must remember that you still need to draw the pen gently and relax.

Draw the basic direction of the arm, draw the approximate width of the arm, and use a combination of simple arcs and circles to draw the complete arm.

All the facial features are drawn in this rectangular area, draw auxiliary lines, and draw a line on the rectangle, slightly below the middle.

Draw the cheeks, draw the eyes on top of the rectangle, no need for a perfect circle, a slightly slanted oval looks cute, draw the highlights of the eyes, the mouth and the nose. Start drawing the ear, draw the length of the ear.

Draw the basic shape of the tail. According to the shape of Pikachu's tail, draw a few parallel lines, and there is a reverse longer line at the end of the tail

The sketches of various auxiliary lines are finally completed! You can outline with a marker pen.

7. How To Draw A Cartoon Pikachu

The drawing method of cartoon Pikachu is as follows:

1. Start to draw Pikachu's head. This character is cute, so I drew a hat for it.

2. Now that the head is drawn, let's draw the pickup's body next.

3. Then draw the hands, feet, and the most special lightning-like tail. In this way, the stick figure line drawing of Pikachu is completed.

4. Next, we paint yellow and red with a marker pen.

Pikachu is a squat, round, rodent-like Pokémon with yellow fur all over his body. Its ears are long with black tips. It has a small mouth, looks like a number 3 on the side, and black eyes. It has two red circles on its cheeks. Its tail is like a jagged lightning bolt, and the part where it meets the body also has a patch of brown fur.

Although it is strictly a quadruped, it more often stands and walks on two hind feet. Living in forests, they usually feed on tree fruit. They use small electric shocks to knock the berries out of the trees so they don't have to climb them, and they roast them as well.

Wild Pikachu mostly move in groups and rarely stay in one place. Pikachu has excellent hearing thanks to its large ears. Many domesticated Pikachu can understand and deduce human speech, even better than most pet dogs, so Pikachu is more popular.

8. How to draw Pikachu

How to draw Pikachu:

Tools/Materials: coloring brushes, pencils, erasers, paintbrushes

method 1

1. First outline Pikachu's cheeks with lines.

2. Draw Pikachu's long ears on both sides of the head.

3. Draw big eyes and leave highlights.

4. Draw Pikachu's smiling mouth.

5. Decorate the texture on the ears with lines.

6. Draw Pikachu's arms downward.

7. Let's draw one of Pikachu's feet.

8. Then outline Pikachu's fat body.

9. Draw Pikachu's other foot.

10. Draw a big tail behind the body.

11. Finally, you can paint Pikachu with beautiful colors.

Guess you like

Origin blog.csdn.net/mynote/article/details/128805987