Check out more tutorials on my blog: http://christianthompson.com/
Follow me on Twitter: https://twitter.com/tokyoedtech
And please SUBSCRIBE to my channel here: https://www.youtube.com/channel/UC2vm-0XX5RkWCXWwtBZGOXg
Amazon Auto Links: No products found.
Thankyou for creating this video, has helped me alot 🙂
Do you have any tutorials on how exactly the turtle module can be used to create games?
oh and also you should make a de-bugging tutorial that would be grate of cheese (im italian so sorry for the bad joke)
wow ur amazing thanks so much you gave me a boost in learning python! your the man to go to when you need help coding
It opens a new window and it looks fine, but it does not run and I just get Space Invaders (not responding) and it crashes. What did I do wrong? I know its not a complete code but I shouldn’t need to enter anymore for the screen to at least stay open. And note that I am not talking about how it originally closes immediately after opening, it stays open but just doesnt work.
import os
import turtle
wn = turtle.Screen()
wn.bgcolor(“black”)
wn.title(“Space Invaders”)
sorry for writing to you directly but
Dear Mr. Thomson,
I am getting this error but I do not know why?
File “C:/Users/Lab/PycharmProjects/HelloWorld/SpaceInvaders/Invade.py”, line 14, in
wn = turtle.screen()
AttributeError: module ‘turtle’ has no attribute ‘screen’
Process finished with exit code 1
the code block is @:
http://christianthompson.com/sites/default/files/Space_Invaders/Space-Invaders-Tutorial-10.py
Imean this is your code
Traceback (most recent call last):
File “C:/Users/Georg/PycharmProjects/space invaders/turtles.py”, line 5, in
main = turtle.screen()
AttributeError: module ‘turtle’ has no attribute ‘screen’
any help with this error? im on python 3.6 (edit: i fixed the problem now)
Loved The Video! Subscribed…
*Thanks!!!*
_#LovePython_
border_pen = turtle.Turtle() is not working :p
To tutorial for this in 3.6
Turtle sounds so much like the turtle in LOGO
what’s turtle
It worked up until the creating the border where my window just said not responding please help me!!!!
Hi there , I have copied the code exactly to how yours is on notepad++ I save the file. Then open it as I would in a normal document. And a screen opens for a second then closes. Should I be using a different ide or do I need any plugins etc
i have problem with the 5 line “import os” i get a message that ‘ “os” imported but unused’
AttributeError: ‘_Screen’ object has no attribute ‘speed’ what should i do ?:D
Your so awesome 😀
whenever I try to run it off of my raspberry pi it says error syntax
this is my code
>>> import turtle
>>> import os
>>> wn = turtle.Screen()
>>> wn.bgcolor(“Black”)
>>> wn.title(“Space Invaders”)
>>> pen = turtle.Turtle()
>>> pen.color(“white”)
>>> pen.speed(0)
>>> pen.penup()
>>> pen.setposition(-300,-300)
>>> pen.pendown()
>>> for x in range(4):
pen.forward(600)
pen.lt(90)
>>> pen.hideturtle()
>>> character = turtle.Turtle()
>>> character.shape(“triangle”)
>>> character.speed(0)
>>> character.setposition(0,-250)
>>> character.setheading(90)
>>> character.color(“blue”)
If i put the border at -300,-300 then it is too big for the screen and all i see is the left and right sides of it anyone help?
hello chris how i learn python in package library
Im using Jupyter and its running python 3 and the border_pen.penup() isnt working its having error??
PS:For python 3 use input instead and dont use the delay otherwise the name would be Python Turtle Graphics
I’m getting back “This application has requested the Runtime to terminate it in an unusual way. ” when I try to make the screen. The window crashes immediately along with my kernel. I don’t know what to do here.
The window that appears keeps crashing when I press “Run”. Says SPace Invaders and shows the turtle, just not responding.
It always crash… why?! I am on Windows Pythn 3.6 (Solved)
The “”delay = input(“press enter to finish”)”” cause problems so put “turtle.mainloop()”.
(know that “raw_input” doesn’t work)
PD: Good vids :3
Hey im programming in the python that comes with visual studio code, but it doesn’t recognize “wn” as anything. help please?
Good video, great tutorial
Where is he coding the python, and what does he have open to run the game?
great tutorial, keep up with this work!!!!
import turtle
import os
turtle.mainloop()
#screen
gameScreen = turtle.screen()
gameScreen.bgcolor(“black”)
gameScreen.title(“Space Invaders”)
delay = input(“press enter”)
#Draw border
border_pen = turtle.Turtle()
border_pen.speed(0)
border_pen.color(“White”)
border_pen.penup()
border_pen.setposition(-300,-300)
borderpen
border_pen.pensize(3)
for side in range (4):
border_pen.fd(600)
border_pen.lt(90)
border_pen.hideturtle()
I am getting the screen but it is just white and that is it and i dont get the black screen with green text.
windows 10
python 3
i would appreciate it if you would help
Hi, I’m using python 3 but all it the screen and borders don’t stay on, they appear and disappear straight away.
Here’s the code, I copy pasted the exact one.
import turtle
import os
# Set up screen
wn = turtle.Screen()
wn.bgcolor(“black”)
wn.title(“Space Invaders”)
# Draw border
border_pen = turtle.Turtle()
border_pen.speed(0)
border_pen.color(“white”)
border_pen.penup()
border_pen.setposition(-300, -300)
border_pen.pendown()
border_pen.pensize(3)
for side in range(4):
border_pen.fd(600)
border_pen.lt(90)
border_pen.hideturtle()
# Create player turtle
player = turtle.Turtle()
player.color(“blue”)
player.shape(“triangle”)
player.penup()
player.speed(0)
player.setposition(0, -250)
player.setheading(90)
I’m getting invalid syntax messages can someone help.
#Space Invaders – part1
#set up the screen
#Python 2.7 on raspberry pi
import turtle
import os
#Set up the screen
wn = turtle.Screen()
wn.bgcolor(“black”)
wn.title(“Space Invaders”)
#Draw border
border_pen = turtle.Turtle()
border_pen.speed(0)
border_pen.color(“white”)
border_pen.penup()
border_pen.setposition(-300,-300)
border_pen.pendown()
border_pen.pensize(3)
for side in range(4):
border_pen.fd(600)
border_pen.lt(90)
border_pen.hideturtle()
#creat the player turtle
player = turtle.Turtle()
player.color(“blue”)
player.shape(“triangle”)
player.penup()
player.speed(0)
player.setpostion(0, -250
delay = input(“Press enter to finish”)
I need help, the delay = raw_input(“Press enter to finish”) does not work on later versions. I have used”turtle.mainloop()” but to no avail. any suggestions?
great tutorial im learning python myself its fun to code!
I like raw ”tutorial” like this. Because it gets you into action instantly, while explaining this along the way. Thank you so much!
Nice job with the code!!