From: Ingo Ruhnke Date: Sat, 20 Mar 2004 21:21:11 +0000 (+0000) Subject: - added converter script for levels X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=1b8a16d0893fcc5de6449767593fe904c36dbfed;p=supertux.git - added converter script for levels SVN-Revision: 283 --- diff --git a/contrib/levelconvert.py b/contrib/levelconvert.py new file mode 100755 index 000000000..7c7085bb6 --- /dev/null +++ b/contrib/levelconvert.py @@ -0,0 +1,47 @@ +#!/usr/bin/python + +import sys + +print ";; Converting:", sys.argv[1] + +f = open(sys.argv[1], 'r') +mycontent = f.readlines() + +content = [] + +for i in mycontent: + content.append(i[:-1]) + +name = content[0] +theme = content[1] +time = content[2] +music = content[3] +background = content[4] +red = content[5] +blue = content[6] +green = content[7] +width = content[8] +height = "15" +gravity = content[9] + +print "(level" +print " (name \"%s\")" % name +print " (theme \"%s\")" % theme +print " (music \"%s\")" % music +print " (background \"%s\")" % background +print " (bkgd_red %s)" % red +print " (bkgd_green %s)" % green +print " (bkgd_blue %s)" % blue +print " (time %s)" % time +print " (width %s)" % width +print " (gravity %s)" % gravity +print " (tilemap " +for i in content[10:]: + for x in i: + sys.stdout.write("%3d" % ord(x)) + sys.stdout.write(" ") + print "" +print " )" +print ")" + +# EOF #