From 15fa4d0ca7f5c8859b20aac237c4212157b56d52 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 21 May 2014 08:07:21 -0400 Subject: [PATCH] pylint cleanup, and add a desktop file. --- Makefile | 8 ++++- ski | 98 ++++++++++++++++++++++++++--------------------------- ski.desktop | 10 ++++++ 3 files changed, 66 insertions(+), 50 deletions(-) create mode 100644 ski.desktop diff --git a/Makefile b/Makefile index 5d172a6..faeb378 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,8 @@ # VERS=$(shell sed -MAX_HORIZONTAL_PLAYER_SPEED)): - self.player_speed -= 1 + (self.player_speed > -MAX_HORIZONTAL_PLAYER_SPEED)): + self.player_speed -= 1 return True elif cmd == 'J': # Jump self.jump_count = random.randint(0, 5) + 4 @@ -458,7 +458,7 @@ def colorize(picture): picture += reset return "".join(picture) -# Main sequence +# Main sequence if __name__ == "__main__": # Initialize the random number generator. random.seed(time.time()) @@ -482,7 +482,7 @@ if __name__ == "__main__": try: repeat = 1 while True: - sys.stdout.write(`world`) + sys.stdout.write(repr(world)) # If we are jumping, just finish the line. Otherwise, check for # obstacles, and do a command. if player.jump_count >= 0: diff --git a/ski.desktop b/ski.desktop new file mode 100644 index 0000000..c76605a --- /dev/null +++ b/ski.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Version=1.0 +Name=Ski +GenericName=Ski game +Comment=Skiing simulation with curses interface in python +Icon=ski +Exec=ski +Categories=Game;SportsGame; +Terminal=true -- 2.43.0