Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PROJECTILE WITH TURTLE
#1
Smile 
Hello. The idea here was to shot a projectile til the end of the screen. What actually happens is that the function is just printing it at the end of the screen and there is no movement upwards after shooting.
I am a beginner and might be doing something really wrong here. The 'personagem' object can move across the screen.

def shoot():
    projectile = turtle.Turtle()
    projectile.speed(0)
    projectile.shape('square')
    projectile.color('white')
    projectile.shapesize(stretch_wid=0.25, stretch_len=0.25)
    projectile.penup()
    projectile.goto(personagem.xcor(),personagem.ycor())
    while projectile.ycor() <= 290:
        projectile.dy = 0.2
        projectile.sety(projectile.ycor() + projectile.dy)
    projectile.clear()
screen.onkeypress(shoot,'p')
Reply


Messages In This Thread
PROJECTILE WITH TURTLE - by artnote1337 - Dec-25-2020, 05:22 PM
RE: PROJECTILE WITH TURTLE - by ibreeden - Dec-26-2020, 12:17 PM
RE: PROJECTILE WITH TURTLE - by MK_CodingSpace - Dec-26-2020, 03:39 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  wn = turtle.screen() AttributeError: module 'turtle' has no attribute 'screen' Shadower 1 6,188 Feb-06-2019, 01:25 AM
Last Post: woooee
  Help! Turtle not working, even when we click the turtle demo in IDLE nothing happens. BertyBee 3 5,648 Jan-04-2019, 02:44 AM
Last Post: SheeppOSU

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020