control bug for tron bike game using Tkinter

Posted 08 August 2012 - 06:40 PM

Hi all,

I'm making a simple game in python using Tkinter. The game is the tron bike game which, if you are not familiar with, the point is to destroy the other bike by making it cross your path. I had it all working fine with just one bike. However, when I tried to add another bike to be controlled by another playing using the same keyboard I had a control issue where moving one bike moves both. I thought it would be very easy to add another bike using the same method as I did for the first, but as you can see I'm having problems. Maybe someone knows a better way to tackle the multiplayer element? It might be a very simple fix but it's escaping me right now.

I hate the global of everything. I'd make your data a proper class, not the ad hoc thing it is. Maybe a player class, rather than a bike class. Try to limit the scope of everything and tighten it up. Ultimately, you want to be able to handle more than two bikes...