glory9211
glory9211

Reputation: 843

turtle.shapesize not working if I use a .gif shape

I am trying to make an animation in turtle and I am using sprites from the internet. I wanted to shrink the size of my sprites but the turtle.shapesize() is not changing the size of the turtle

import turtle

screen = turtle.Screen()
screen.tracer(0)
screen.addshape("mario.gif")
sprite = turtle.Turtle()
sprite.speed(0)
sprite.shape("mario.gif")
sprite.penup()
sprite.shapesize(5, 5, 1)

while True:
    screen.update()

Thank you in advance.

Upvotes: 1

Views: 844

Answers (1)

Jean Joubert
Jean Joubert

Reputation: 63

Shapesize does change the size of the turtle but not of the gif image itself.

You can resize the shape at ezgif.com and swap gifs during the game eg

sprite.shape('mario1.gif')

if sprite.distance(sprite2) <= 20:

    sprite.shape('mario2.gif')

Upvotes: 1

Related Questions