[Tutor] Fwd: circular movement in pygame

Alan Gauld alan.gauld at btinternet.com
Wed Apr 29 09:48:21 CEST 2015


On 29/04/15 08:15, diliup gabadamudalige wrote:

> 1. x = some code
>
> That is what I used and it worked. I was trying to find how we can do the
> same thing by updating the current position by doing
>
> 2. x += some code
>   Above 1 works. 2 does not. Why is that?


Because they do completely different things!

1 is simply

x = some code

2 is

x = x + some code

In 2 you are adding x to some code.

Of course they don't work the same.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list