Want to email me?

You could also tweet me @willmcgugan.

Recruiters: No need to get in touch right now.

Note that a comment here isn't the best place to ask for technical help. Please email me instead.

Use Markdown for formatting
*Italic* **Bold** `inline code` Links to [Google](http://www.google.com) > This is a quote > ```python import this ```
your comment will be previewed here
gravatar
James Morris
Hello. I've been reading the book Beginning Game Development with Python and Pygame. It's a great read, fantastic actually, but I have trouble running the code… I get this in my console:

2009-03-08 19:34:03.228 Python Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.

And I don't understand it? I'm using Mac OSX 10.5 by the way. I'm not a pro programmer… I come from a PHP background (using MAMP) and so the whole Terminal concept is pretty new to me. I'm damn sure I have installed Python and Pygame correctly, as there is some Pygame examples I've been able to run fine. But it's annoying, I want to complete your book, but I can't with these errors… Like the ‘helloworld’ example, the image shows up in the background, I have a cursor image too, but it doesn't move, it's like it's frozen and it has that above error in the console.

I know you must be busy, but please help! I love your book and really want to complete it. If you need any information about my setup, please just ask me, do tell me how to find out versions though, as I'm new to the Terminal experience! Thank you Will! Great book… James
gravatar
WIll McGugan
James,

I'm afraid I can't help you with that one, not having a Mac. Perhaps you need to press a key in the terminal to move past the error message?

The pygame mailing list is probably the best place for help on this sort of thing…

Will
gravatar
Dan Koch
I was able to run the Chapter 3 helloworld.py demo just fine on Mac OS 10.5 (Leopard). Did you follow the instructions here when you installed MacPython? I opted to keep the system Python installed by Apple, but needed to follow these instructions to get PyGame to install.

http://wiki.python.org/moin/MacPython/Leopard

The only thing extra I had to do was move the pygame files to the /Library/Python/2.5/site-packages folder. Also true for gameobjects.

The warning you mentioned is not a fatal error and is discussed here:

http://www.mail-archive.com/pygame-users@seul.org/msg06183.html

I am seeing some problems with the OpenGL examples. In Chapter 9, the example rotation3d.py was missing a ball.png file, which can be easily fixed with your own image. More problematic is the lack of color for the firstopengl.py example on my MacBook (nvidia GeForce 9400M) and HP 2710p tablet (Vista, Mobile Intel 965 Express). It displays fine on my Dell 490 (Fedora 10, nvidia Quadro FX 4600). Do you think this is a driver issue?

Thanks,
Dan
gravatar
Jay
Hi there.

First of all, I would like to congratulate you on your book, “Beginning Game Development with Python and Pygame”. It's really helping me right now (with the PyWeek and all, hehe).

I'm writing to make a correction (so far, I've read up to page 36): in the 4th entry of the table 2-5, the description of the math.ceil function should be “Returns the smallest integer greater than or equal to a number”.

Bye!
gravatar
Will McGugan
Dan, there is a solution for the lack of colour issue here:

http://www.willmcgugan.com/blog/tech/2007/6/4/opengl-sample-code-for-pygame/#comment751
gravatar
dlan1000
Will,

I was wondering if you have any experience integrating the python twisted networking module with pygame. I have encountered several approaches online to doing this (but no convergence on a good solution), and in a few your name was mentioned as someone that is pursuing this line of integration.

As an aside, I think your book Beginning Game Development with Python and Pygame is phenomenal, but one area that it is lacking is network support. Personally, I have a good deal of experience in many other languages, but I gravitate towards python and pygame because I think it enables rapid prototyping and proof of concept for small independent game efforts.
gravatar
Will McGugan
dlan1000,

Networking would have been a good topic to cover, but would be quite hard to do justice without several chapters – or an entire book.

I haven't tried integrating pygame and Twisted. I suspect that they wouldn't play well together, since they both want to monopolise the main loop.

One solution would be to run twisted in its own thread and communicate to the main pygame thread through a queue object (in the std lib). Then you could read new events from the queue prior to rendering. Although in some respects that defeats the purpose of using twisted in the first place.

An alternative approach would be to have an interface to the game state that is thread-safe, and have the pygame loop do rendering only. That would give you a more tradition event based model of the kind used in web servers.

Hope that helps!

Will
gravatar
Ken
Hi Will,

I'm in chapter 5 of your book BGDWPAP. I'm running MacPython 2.5 and pygame
on a iMac G5. When I try to run the code in Listing 5-8. Vector Magnitude Function,
I get the following error:

Traceback (most recent call last):
File “/Users/Ken/Desktop/myvecmagnitude.py”, line 22, in <module>
AB = Vector2.from_points(A, B)
File “/Users/Ken/Desktop/myvecmagnitude.py”, line 15, in from_points
return Vector2(cls, P2 - P1, P2 - P1)
TypeError: __init__() takes at most 3 arguments (4 given)

It looks like Vector2 might be the 4th argument? Is there a way around it?

At age 69 I'm brand new to programming, as a hobby, and your book has been most
helpful. I never took algebra, geometry or trigonometry. I guess this “Old Coot” better
crack a book or two.

Also, I tried to go to your site willmcgugan.com/game-objects/ for the Game Objects
download as instructed in several places in the book, but the site can not be found.

Thanks, Ken

Looking forward to your next book.
gravatar
Ken
Forgot my Email address.
gravatar
Shaun Reapswaal
Hey will. First of all I read your book. And I do believe that it's the best book on game programming that I have ever read. Game programming simply comes so easily with it!!

I'm presently working on creating a 3D MMORPG with Python and intend on completing this project. For which I have to install PyOpenGL on my comp But the laptop that I want to install it on is not connected to the internet. But the I don't know how to install it, or acquire the setup file through the internet even on the computer that is connected to the internet. So I need your urgent help please.
gravatar
Will McGugan
Hi Shaun,

If its Windows you will need to download the installer exe from http://pyopengl.sourceforge.net/ and copy it to the machine you want to install it on. If its not Windows then download the source, unpack it and install it with ‘python setup.py install’.

Hope that helps!

Will
gravatar
Shaun Reapswaal
I checked it out. It's just so frustrating that both PyOpenGL and Python-OGRE aren't working on my system. Do you know Which one of those two is better performance-wise?
gravatar
Will McGugan
Shaun, Couldn't say for sure, but OGRE will give you a complete game engine on which to build on, whereas with PyOpenGL you have start from scratch.
gravatar
Page Lee
Hello, I've got your techblog source from google, and I want to run it, the path of the project like this: /home/pagelee/workspace/techblog, and I did not modify the code, except the database config.

Then I start the server using:
python manage.py runserver, and it started.

Then I access "http://127.0.0.1:8000/"

My browser displayed:
===========================================

Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/

No Blog matches the given query.

You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.
============================================
I've tried many ways to handle it , but I was failed. So could you help me with it?
Thanks a lot.


Page Lee

from China
gravatar
Page Lee
I handle it, just add a rootblog, is'nt it?
gravatar
Will McGugan
Page Lee, I think you got it!
gravatar
Page Lee
Thanks a lot! But I got another problem that why the index page displays only a half og it, that the left half, and if you are not the admin, you will not see the right half,such as the “popular Tags” “Comments” and so on.

Sorry to disturb you, I knew Django only two days ago.
gravatar
tayfur yilmaz
hi ı saw the this site in djangosites.com and ı want to download the your sites code but this is not there.why did you erase your sites code
gravatar
frederik
hello will i need to know how to nintendo ds games with python and pygame can you help me?
gravatar
frederik
hello will i need to know how to make nintendo ds games with python and pygame can you help me
gravatar
Mateus Cavanholi
Hi Will

I first come to your blog looking after the Vector2 source-code, the one you used in the Begining Game Developing with Python and Pygame, that I bought few days ago and it's really make me understand how it works.

And then I just take a look in another “stuff” of your blog and found the lucidesktop project.

It's seems amazing the idea to use a virtual desktop instead of bookmarks pages (even those that are rigorous organised become a mess with time)

So, after all this text, here is the question: Do you still have invites for this project (http://locidesktop.com/)??

And, as I'm here already: Do you planing to make any book a bit advanced of game developing?
gravatar
Will McGugan
Mateus, there should be a few uses of this invite http://locidesktop.com/accounts/create/?invite=blog – if you are quick.

No plans for another book at the moment. One day though…
gravatar
Stefan Mannsfeld
Hi Will,

I found your simpleopengl.py example very instructive and was browsing some of the accompanying libraries. I think in your vector library, vector3.py, the __rsub__ operator should be
     def __rsub__(self, lhs):
        
        x, y, z = self._v
        ox, oy, oz = lhs[:3]
        return self.from_floats(ox-x, oy-y, oz-y)
        # orig has x-ox, ...
I haven't checked the other code, but these copy and paste bugs happen to me very frequently.
gravatar
Erik
Mr. McGugan,

I need your help. I'm trying to use the PySndObj library (http://wiki.python.org/moin/PySndObj) to create computer sound, but I can't get it to work.

First, I downloaded PySndObj-1.3-win32-Python2.5.zip (http://sourceforge.net/projects/sndobj/files/PySndObj/PySndObj-1.3/PySndObj-1.3-win32-Python2.5.zip/download).

Then, I extracted the contents of the download and placed it into the site-packages folder.

When I type “import sndobj” at the interactive prompt I receive a message that says “ImportError: No module named sndobj”. Why is there an import error?
gravatar
Jonathan Hartley
I wanted to write a quick note to say thanks for your Beginning Game Development book.

I'm a software engineer who has dabbled in opengl on the side for years, but never really done anything other than scrappy proof-of-concept demos. I read your book over a year ago. At the time I really enjoyed reading it, but I had a reservation about it because I felt that it didn't really cover much that I didn't already know.

Since then though, I've started sitting down to actually write some small games, rather than just thinking ‘yeah yeah that looks easy, I could do that.’ During this time, I have found myself returning to your book again and again. I've undergone a bit of a transition away from my old arrogant attitude, and am much more appreciative of actually creating something, as opposed to simply thinking about it. I have found several instances where the difference between thinking I understand something in principle, and actually sitting down to do it, have turned out to be quite pronounced. :-)

Anyhow, all the ideas your talk about in your book are remarkably clearly expressed, and it has been a great source of reference for me to straighten my thoughts out when I'm in the thick of indecision about something. I have grown more and more appreciative of it as time has gone by. You did a really amazing job.

So, a sincere and belated thank-you.

Jonathan
gravatar
Nejya
Hi Will!

I am reader of Your book and I am begginer in Pygame
First at all thank You for book. It's very nice of you
that you made it, and as far as I know there are not other
book about Pygame. Thought as a beginner, I have several remarks

Remark I
Your book Chapter 3, page 107:

A = (10.0, 20.0)
B = (30.0, 35.0)
AB = Vector2.from_points(A, B)
step = AB * .1
position = Vector2(A.x, A.y) #It's not going to work
for n in range(10):
position += step
print position

I changed it to A A but what did you mean

Second remark that at the certain points your book needs more exlanation than you gave. I mean this example wich you gave Chapter 7

class State(object):

def __init__(self, name):
self.name = name

def do_actions(self):
pass

def check_conditions(self):
pass

def entry_actions(self):
pass

def exit_actions(self):
pass

class StateMachine(object):

def __init__(self):
self.states = {}
self.active_state = None
……………….
def think(self):
if self.active_state is None:
return


self.active_state.do_actions()###### ???????????
new_state_name = self.active_state.check_conditions()
if new_state_name is not None:
self.set_state(new_state_name)

I will be very thankful if You explain me
how can be here used method from different class. Because I don't see any obvious connecting point. So I am hardly trying to figure out that.
gravatar
Patrick C.
Are there still invites to Loci Desktop, and if so is there a way I could get one. It seems like an awesome idea, and one that I have tried to achieve and failed at multiple times (scrolling links, mac style link dock, etc.) I would like to try this out.
gravatar
Neil
Hi Will, I'm trying to download the code examples for Begining Game Development with Python and Pygame from the Apress site and something is broken! Download stops at 25%, then wants a new IP address. I've tried this 5 times already. Thought you should know…
gravatar
Mirgorod
Hi Will!

Thanx to you for your book :)

But i got one problem when was trying to run listing 5-16…

I get this:

invalid destination position for blit

Class which was used:

class Vector2(object):
def __init__(self, x = 0.0, y = 0.0):
self.x = x
self.y = y
def __str__(self):
return “(%s, %s)” % (self.x, self.y)
@classmethod
def from_points(P1, P2):
return Vector2(P2 - P1, P2 - P1)
def get_magnitude(self):
return math.sqrt(self.x**2 + self.y**2)
def normalize(self):
magnitude = self.get_magnitude()
self.x /= magnitude
self.y /= magnitude
def __add__(self, rhs):
return Vector2(self.x + rhs.x, self.y + rhs.y)
def __sub__(self, rhs):
return Vector2(self.x - rhs.x, self.y - rhs.y)
def __neg__(self):
return Vector2(-self.x, -self.y)
def __mul__(self, scalar):
return Vector2(self.x * scalar, self.y * scalar)
def __div__(self, scalar):
return Vector2(self.x / scalar, self.y / scalar)

I need your help :)
gravatar
Mirgorod
I haven't this problem already :)
gravatar
Rune
I am reading you fantastic book Beginning Game Development with Python and PyGame. Your example in chapter 9, the cube world-example, seems to me a bit overwhelming. I have tried to use the information given simply to draw shapes in 3D enivroments with OpenGL.

I was hoping you could explain me why my code does not show the square I want it to do.

 SCREEN_SIZE = [640, 480]
import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import*
from math import radians
from sys import exit
def resize(width, height):
    glViewport(0,0, width, height)
    glMatrixMode(GL_PROJECTION)
    glLoadIdentity()
    gluPerspective(60., float(width)/height, .1, 10000.)
    glMatrixMode(GL_MODELVIEW)
    glLoadIdentity()
def init():
    glEnable(GL_DEPTH_TEST)
    glShadeModel(GL_FLAT)
    glClearColor(1.0, 1.0, 1.0, 0.0)
pygame.init()
screen = pygame.display.set_mode(SCREEN_SIZE, HWSURFACE|OPENGL|DOUBLEBUF)
resize(*SCREEN_SIZE)
init()
while True:
    for event in pygame.event.get():
        if event.type == QUIT:
            exit()
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
    glBegin(GL_QUADS)
    glColor(1.0, 0.0, 0.0, 0.0)
    glVertex(100.0, 100.0, 100.0)
    glVertex(200.0, 100.0, 100.0)
    glVertex(200.0, 200.0, 100.0)
    glVertex(100.0, 200.0, 100.0)
    glEnd()
    pygame.display.flip()

Thanks in advance.
gravatar
Espen
Dear Sir,
Do you know if your book is sold anywhere as PDF?
Amazon only want to sell me paperback and kindle version.

Regards
-Espen-
gravatar
Espen
Found it at apress.com
-Espen-
gravatar
Michael
Hello Will.
Ive recently began learning Python and Pygame and have been hunting throughout the interwebs for various tutorials and guides on the two. Your site is and excelent resource for both (and has even sparked my curiosity in django)

Im currently stuck on pathfinding and have been looking for diffrent way people implement it. Your Fugu demo has helped and im also intrested in the Fugu's Friend demo (A* seems to be the way to go with pathfinding) Unfortunatly the link to the demo isnt working anymore and i was hoping you may have the .zip still stored somewhere? Googling for it hasnt helped at all.

The post in question is this http://www.willmcgugan.com/blog/tech/2007/4/30/swim-turtle-swim/ is over 3 years so the likelyhood of finding it is slim i know but still worth asking.

Thanks, Michael.
gravatar
Will McGugan
Sorry, Michael. Couldn't find it!
gravatar
Michael
Oh well, thank you for looking.
gravatar
Thalysson Davyd [from Brazil]
sorry my bad english, I'm still learning the English language, as well as I am new to programming

first congratulations on the book Beginning Game Development with Python and Pygame…, great book. I've done some games using pygame .. and now I'm starting to make a snake-style game using OpenGL. I read the chapters of the book on the subject but I'm still a little “lost” in the sense of how I will make the game! I have in mind as early concepts of primitives, textures…

be able to help with any tutorial or suggesting a book (using python in the examples, not the language of c or c + +) or someone who can connect with and ask questions thank you very much.
gravatar
Sean

i recently bought your book “Beginning Game Development with python and pygame : from novice to professional”

i have python 2.7.1

i have windows vista

i am currently reading chapter 2 and i typed both tank.py and tankgame.py correctly in the sciTE text editor

when i try to run tankgame.py the out put is


>pythonw -u “tankgame.py”
>The system cannot find the file specified


and when i do a syntax check this comes up



>python -c “import py_compile; py_compile.compile(r'C:\Users\Sean\Documents\tankgame.py')”
'python' is not recognized as an internal or external command,
operable program or batch file.
>Exit code: 1


how do i get the tankgame.py to run correctly like it does in the book
gravatar
Shaun Reapswaal
Wassup Free Willy?!! hehe! xD

Well anyway, will since yours was the best book on game development that I have “ever” read. I was wondering why have you not written any other books since then? I mean I have been waiting and it's been ages or so. Don't you like writing or teaching or something?

Well have you ever thought of writing a book on Python Ogre? hopefully using Python 3.0 Python-Ogre does not support it as yet, but it's about to. Should be complete any day now :P
gravatar
Will McGugan
@Sean, no plans to write another book in the short term I'm afraid. But I would love to write another one.

I haven't tried Python Ogre. It looks pretty cool though…
gravatar
Shaun Reapswaal
It sure is cool Will! But it can be much better, the people working on it are either not skilled enough or they aren't enough in numbers. Well anyway, if you would love to write a book then why don't you have any plans in the short term?
gravatar
emilio
hi mr will i was reading your book of pygame and i have a problem with vector in the exameple 6-2 simply directional movement and in others when i write
screen.blit.(sprite, sprite_pos) said invalid destination position for a blit i dunno why it said that would you mind helping my and the vector class is defined
gravatar
Fabronchis
Hello .. I'm from Argentina. Sorry for my bad english. I want to use “djangotechblog” for build my cheff blog. My question is: DjangoTechBlog managment users account? I want to check all the post. I don't like that all people post. I want to avoid abuse, irrelevant comment, …

Another Question:
What type of licence djangotechblog have?
Requiere your signature?

bye
gravatar
Sagar Gupta
Hello. I've been reading the book Beginning Game Development with Python and Pygame, and i am facing problem in using scite while i press the run button it will show the following problem…
“pythonw -u ”list.py“
>The system cannot find the file specified.”

Please help i am using windows 7 operating system
gravatar
Sagar Gupta
please Help!!!
gravatar
din
hi will ur book is a fantastic read i'm in the middle of it but from two days or so my computer is not even opening python application and it is showing error message i.e(socket error : conection refused,idle's subprocess didn't make the conection please tell me a solution i'm using windows 7 ultimate version)
gravatar
Tai
Hi! i'm reading ur pygame book :D and i dont understand this code:

heading *= movement_direction

what does * do in this line?
gravatar
Neil
hello will
i have a little problem with donloading and installing the gameobjects library, gameobjects-0.0.3.win32.exe dosen't work on my computer so i tried the 0.0.3.zip version but when i try to run the setup file it dosen't work and this error shows up:

>>>
Game Objects v0.0.3
Traceback (most recent call last):
File “C:\Python25\Lib\site-packages\gameobjects-0.0.3\setup.py”, line 31, in <module>
classifiers = classifiers.splitlines(),
File “C:\Python25\lib\distutils\core.py”, line 139, in setup
raise SystemExit, gen_usage(dist.script_name) + “\nerror: %s” % msg
SystemExit: usage: setup.py cmd1 [cmd2 …]
or: setup.py –help
or: setup.py –help-commands
or: setup.py cmd –help

error: no commands supplied
>>>

and when i try to import it with IDLE it cannot find gameobjects.vector2

can you help with this ??
gravatar
Asgar
Can you tell me how to do the effect while mouse dragging the canvas.

Thanks in advance
gravatar
kowthal ganesh
Hi sir,
This is ganesh with you, had a doubt, is it possible to draw the pencil, circle, rectangles, at text view in python, else there is only way to draw the things in drawing area, how can i improve smoothness of pencil tool, is there any suitable package on available to import the drawing environment,..
please clarify myself,

Thanks in advance
gravatar
Anton Zepherin
Hi Will,

Just saw your tweet and thought i'd get in touch as I'm after for a Python Developer for a 6 week remote opportunity to start immediately.

If you're available and interested please get in touch as soon as possible at 0207 269 6784 or you can reach me at az@opusrs.com

Best,
Anton
gravatar
Merlink
Hi Will,

I modified your chess.py what in my mind is a really great and simple chess lib. I want to combine it with PyBitmessage to use it as P2P Serverless chess implementation.

Could I put my modified version to github and publish it there?

If yes, what licenses are possible?

Best regards,

Merlink
gravatar
Kenny Prestom
Hi Will:

I'm so glad to discover your site while looking for a script to use for a welcome/splash page for a website. I've tried many sliders with the ken burns effect, but they provide start and end points for the panning only as top, left, bottom etc, which are not accurate enough for this project.
I suspect precise start and end coordinates for panning could probably be set in your script, which is exactly what I need.

When you get the opportunity, would you please give an example of how the entire randomization part of your script may be replaced by just one start point and one end point?

Thanks,

Kenny
gravatar
Aleki
hi again,

Its time to finally move your projects to git. Even google suggests move to github.com now.

Google is a big barrier for me, keeping me from contributing.
gravatar
Tanner
Hello, I am not for sure if your familiar with Tkinter, but if you are i kinda of need some help on how to give a restart button a restart function or tell the restart button what to do.Email me as quick as you can please

sincerely,
Tanner

from tkinter import*
import random
import time




class Ball:
def __init__(self, canvas, paddle, color):
self.id = canvas.create_oval(10, 10, 25, 25, fill=color)
self.paddle = paddle
self.canvas = canvas
canvas.move(self.id, 232, 276)
starts =
random.shuffle(starts)
self.x = starts
self.y = -3
self.hit_bottom = False
self.speed = 0.01

def hit_paddle(self, pos):
paddle_pos = self.canvas.coords(self.paddle.id)
if pos >= paddle_pos and pos <= paddle_pos:
if pos >= paddle_pos and pos <= paddle_pos:
game.score.hit()
self.x += game.paddle.x
return True
return False


def draw(self):
self.canvas_width = self.canvas.winfo_width()
self.canvas_height = self.canvas.winfo_height()
self.canvas.move(self.id, self.x, self.y)
pos = self.canvas.coords(self.id)

if pos <= 0:
self.y = 3
if pos >= self.canvas_height:
self.hit_bottom = True
if self.hit_paddle(pos) == True:
self.y = -3
if pos <= 0:
self.x = 3
if pos >= self.canvas_width:
self.x = -3




class Paddle:
def __init__(self, canvas, color):
self.id = canvas.create_rectangle(0, 0, 100, 10, fill=color)
self.canvas = canvas
canvas.move(self.id, 200, 300)
canvas.bind_all(“<KeyPress-Left>”, self.turn_left)
canvas.bind_all(“<KeyPress-Right>”, self.turn_right)
canvas.bind_all(“<space>”, self.start_game)
self.started = False
self.x = 0

def draw(self):
self.canvas_width = self.canvas.winfo_width()
self.canvas.move(self.id, self.x, 0)
pos = self.canvas.coords(self.id)
if pos <= 0:
self.x = 0
elif pos >= self.canvas_width:
self.x = 0

def turn_left(self, evt):
self.x = -2

def turn_right(self,evt):
self.x = 2

def start_game(self, evt):
self.started = True




class Score:
def __init__(self, canvas, color):
self.value = 0
self.canvas = canvas
self.id = canvas.create_text(10,\
12, \
font=(“Purisa”, 14), \
text=“Score: ” + str(self.value), \
anchor=“nw”, \
fill=color)
def hit(self):
self.value += 1
self.canvas.itemconfig(self.id, text=“Score: ” + str(self.value))

def clear(self):
self.value = 0
self.canvas.itemconfig(self.id, text=“Score: ” + str(self.value))


class Game:

def __init__(self):
# Create canvas
self.canvas = Canvas(tk, width=500, height=400, bd=0, highlightthickness=0)
self.canvas.pack()
# Initialize restart button
self.restart_button = None
# Create game elements
self.score = Score(self.canvas, “black”)
self.paddle = Paddle(self.canvas, “blue”)
self.ball = Ball(self.canvas, self.paddle, “red”)
self.game_over_text = self.canvas.create_text(250, \
200, \
font=(“Purisa”, 50), \
fill=“red”, \
text=“GAME OVER”, \
state=“hidden”)
self.restart()


def add_restart(self):
self.restart_button = Button(tk, text=“RESTART GAME”, \
command=self.restart)
self.restart_button.pack()

def restart(self):
self.canvas.itemconfig(self.game_over_text, state='hidden')
# Reset score
self.score.clear()
# Reset paddle
self.paddle.x = 0
self.canvas.move(self.paddle.id, self.paddle.x, 0)
# Reset ball
self.ball.canvas.move(self.ball.id, 232, 276)
starts =
random.shuffle(starts)
self.ball.x = 0
self.ball.y = -3
self.ball.hit_bottom = False
self.ball.speed = 0.01





tk = Tk()
tk.title(“Game”)
tk.resizable(0,0)
tk.wm_attributes(“-topmost”, 1)
tk.update()

game = Game()

while 1:
if game.ball.hit_bottom == False and game.paddle.started == True:
game.ball.draw()
game.paddle.draw()
if game.ball.hit_bottom == True:
game.canvas.itemconfig(game.game_over_text, state='normal')
game.paddle.started = False
if game.restart_button is None:
game.add_restart()

tk.update_idletasks()
tk.update()
time.sleep(game.ball.speed)
gravatar
Tanner
That was what i had for the game i made
gravatar
Stuart Axon

Hi. gameobjects looks like a fantastically useful library. A few people have taken it onto github, would you consider having it on your own github and uploading it to pypi ?

S

gravatar
Shawn Driscoll

I don't know if I ever thanked you or not for writing the Game Development for Python and Pygame book, I bought it years ago and still refer to it. I've taken a real interest in finite state machines recently, and remembered your AntStateMachine program. So I'm going through and running it. I finally am taking the time to learn more about Classes. I'm more of a procedural style programmer. But using class style code will help streamline some of the programming ideas I have, as far as FSM programming is concerned.

Thank you again for writing the book.

gravatar
Will McGugan

Glad you like it, Shawn! Hope you enjoy your project.

gravatar
Scott Phillips

Hi Will, it's Scott from Oxford.

Do you still have the local currency experiment running? Been chatting with someone looking to launch their own complementary currency as part of an sustainable development, social justice, ethical living project.

If you've got a few minutes guidance setting accounts up with credits for people, that'd really help.

Hope this finds you well, love your new photography on your blog!

Scott

gravatar
Will McGugan

Hi Scott,

Nice to hear from you. I have a new version of the currency site (currency.moyaproject.com).

Feel free to pass on my details. I may be able to help...

Will

gravatar
Scott Phillips

Thank you for getting back to me. You might want to look at the validation email here:

The first email had a big blue button: Add currency to account. This URL was complete.

After entering the registration details, the second part of the validation arrived via email. This link wasn't cosmetically styled, saying: Validate Email. The URL was incomplete.

http://signup/validate/?token=ova80x0uyy9rbneq0spf

When the domain was added though, it worked as expected: https://currency.moyaproject.com/signup/validate/?token=ova80x0uyy9rbneq0spf

gravatar
Randy Hanba

Will, could you please drop me a note via my website contact form at www.randyhannaphotography.com

I have some photo questions for you. Tried to use your email link however it only wants to use the Apple mail app which I don't use.

Looking forward to hearing from you soon.

Cheers and great work on your images. Randall

gravatar
Will McGugan

You can email me at willmcgugan@gmail.com

gravatar
Hugh Chesser

Will,

I was interested in getting a hold of the source code from your book from 2007 - "Beginning Game Development with Python and Pygame". I have tried downloading it from Apress (now Springer), but was not able to find it there.

I have a class I am teaching for the first time to 2nd yr engineering students on programming and thought your book started with the fundamentals and took things step by step.

Thanks for your book and any source code you can send me. Email: hugh.chesser@gmail.com

Hugh

gravatar
Samuel Ky Lau

Hello, Will

I am a Python newbie, and learned alot from your Rich, and Rich-CLI code on GitHub. Thank you so much to your project open-source, and learner like me could learn from professional programmer like you.

Thanks Sam

gravatar
Cecilio Rodriguez

Hello Will, my name is Cecilio Rodríguez.

I am from Venezuela. and I'm looking for a remote job, with which I can help my family and survive. I have an interesting set of skills and knowledge that may be of your interest. I'm not a software engineer or coder, in fact, my degree (Bachelor in Fiscal Sciences) is accumulating dust in my closet. Please allow me a couple of minutes to tell you a little more about it:

I have more than 8 years of experience working remotely, and I have developed and grown in the eCommerce and Tech world, said that I have had positions such as customer service, in my beginning, email marketing assistant, and copywriter. Similarly, I have worked as a virtual assistant, developing administrative tasks, and creating images, email templates, and newsletter, designed in Photoshop and Canva

I must say I am a very versatile person, I have worked with various entrepreneurs and companies over the years, and at this time, I find myself in a delicate position, since I lost the job, I had since I spent little more than 2 months recovering from a robbery where I lost my computer and phone.

I emphasize that due to inflation in my country, remote work is an excellent alternative to try to achieve the quality of life that I want, which is why I can commit to working more than 40 hours a week, for a monthly payment of XXX (I can tell you this privately)

If you have an open vacancy or a task that you can delegate, or know someone who may be interested in my services, I would greatly appreciate the connection with that person. As I told you, I find myself in a delicate situation where the only thing that matters to me is being able to help my family.

Thank you!

gravatar
Felix Maas

Hi Will,

I wanted to text you an email regarding some questions about which camera gear to take to a trip to Sumatra. Unfortunately your email seems to be wrong (there is space character too much). Could you give me your correct address?

Happy to hear from you soon!

Best regards from Germany, Felix