lonestar

0x10c-inspired space game based on the DCPU-16
git clone git://squid-tech.com/lonestar.git
Log | Files | Refs | README

commit b74148a1db5dca33caa9ade030c96fa0e9d5bdf0
parent 3e1da9b27ced2e3808b649279ab5ad0575aeda4d
Author: Josh Moore <jxm5210@rit.edu>
Date:   Sun, 24 Nov 2019 18:40:42 -0500

Save walls to XML

Diffstat:
Mutils/shipdraw/shipdraw.py | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/utils/shipdraw/shipdraw.py b/utils/shipdraw/shipdraw.py @@ -31,7 +31,7 @@ def clicked(event): if len(shiphull) == 0: shiphull.append(hullpos) else: - shiphull = shiphull + hullPath(hullpos) + shiphull = shiphull + hullPath(hullpos)[1:] if len(shiphull) > 1 and shiphull[-1] == shiphull[0]: drawingHull = False @@ -130,6 +130,13 @@ def saveShip(): hull = ET.SubElement(ship, 'hull') + # add hull data to ship xml + for wallpoint in shiphull: + hullwall = ET.SubElement(hull, 'wall') + hullwall.set('type', 'default') + hullwall.set('posX', str(wallpoint[0])) + hullwall.set('posY', str(wallpoint[1])) + # write the ship to the file data = ET.tostring(ship, encoding='unicode')