Saturday 15 May 2010

python 3.x - Load sprite (in turtle) without pygame -



python 3.x - Load sprite (in turtle) without pygame -

i want create targets 2d shooting game (super basic) can't figure out how load picture, possible? right utilize turtle.stamp() create prints want pic instead. know of bgpic() i'm thinking turtle.load('image.png') or exists? or creating type of sprite perhaps...

call me stupid, i'm trying without using pygame :)

this isn't possible using turtle, sadly. however, vaguely recall turtle.begin_poly() method. allows draw pictures using turtle , alter turtle them.

>>> turtle.home() >>> turtle.begin_poly() >>> turtle.fd(100) >>> turtle.left(20) >>> turtle.fd(30) >>> turtle.left(60) >>> turtle.fd(50) >>> turtle.end_poly() >>> p = turtle.get_poly() >>> register_shape("myfavouriteshape", p)

sadly, closest you'll get. can @ the turtle documentation more on this, though!

python-3.x

No comments:

Post a Comment