4 Levels.py format
KikooDX edited this page 2 years ago

Variables utility

  • levels list : contain raw levels layouts
  • lvl_dims list : contain levels dim in tuples

Chars/tiles correpondance

  • @ : player (can only put one)
  • # : wall
  • / : box space
  • + : box
  • * : box in box space
  • . : floor (can be walked on)
  • (space) : empty tile (can't be walked on)

Example

levels += [
"       "+\ # no empty spaces, need to put spaces to fill up else the level brake
"#######"+\
"#..+./#"+\
"#@#+..#"+\
"#..../#"+\
"#######"
]
lvl_dim += [(7, 6)] # level is 7 width and 6 height