I saw quite a few ways to do it, but I don't understand why they calculate /10*10 in the end. This is how the food is handled, it doesn't work without the last part(/10.0)*10.0) but I don't understand what it is there for. Can someone please explain this?
foodx = round(random.randrange(0, window_width - snake_block)/10.0)*10.0
foody = round(random.randrange(0, window_width - snake_block)/10.0)*10.0
Aucun commentaire:
Enregistrer un commentaire