Skip to content

Commit

Permalink
Factor out level into a separate file.
Browse files Browse the repository at this point in the history
Now the terrain.py file can be reused for making more levels.
  • Loading branch information
fragglet committed Feb 23, 2024
1 parent 4810245 commit d8d7dba
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
26 changes: 26 additions & 0 deletions maps/tank_strike.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python3
#
# Player must fly over the mountains and destroy two tank convoys.

from terrain import *

left_barrier()
terrain(500)
oxen_field()
airfield()
terrain(200, rockiness=0.05)
mountain(end_y=50)
mountain(height=90, width=150, end_y=30)
new_territory()
mountain(height=140, width=120, end_y=40)
terrain(300, rockiness=0.1)
convoy()
airfield(owner="PLAYER2", right_side=True)
terrain(500, rockiness=0.3)
convoy(max_tanks=5)
terrain(500, rockiness=0.1)
right_barrier()
new_territory()

write_to_file("tank_strike.sop")

19 changes: 0 additions & 19 deletions maps/terrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,22 +193,3 @@ def write_to_file(filename):
print_ground(file)
print("}", file=file)

left_barrier()
terrain(500)
oxen_field()
airfield()
terrain(200, rockiness=0.05)
mountain(end_y=50)
mountain(height=90, width=150, end_y=30)
new_territory()
mountain(height=140, width=120, end_y=40)
terrain(300, rockiness=0.1)
convoy()
airfield(owner="PLAYER2", right_side=True)
terrain(500, rockiness=0.3)
terrain(500, rockiness=0.1)
right_barrier()
new_territory()

write_to_file("tank_strike.sop")

0 comments on commit d8d7dba

Please sign in to comment.