Skip to content

Commit

Permalink
replacing of format() with f-Strings and reformatting a statement int…
Browse files Browse the repository at this point in the history
…o one line because its sufficiently short now
  • Loading branch information
Morinator committed Dec 25, 2020
1 parent e9b3bdc commit 73f1c33
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions classes/Level.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self, screen, sound, dashboard):
self.entityList = []

def loadLevel(self, levelname):
with open("./levels/{}.json".format(levelname)) as jsonData:
with open(f"./levels/{levelname}.json") as jsonData:
data = json.load(jsonData)
self.loadLayers(data)
self.loadObjects(data)
Expand Down Expand Up @@ -105,11 +105,7 @@ def addCloudSprite(self, x, y):
for yOff in range(0, 2):
for xOff in range(0, 3):
self.level[y + yOff][x + xOff] = Tile(
self.sprites.spriteCollection.get(
"cloud{}_{}".format(yOff + 1, xOff + 1)
),
None,
)
self.sprites.spriteCollection.get( f"cloud{yOff + 1}_{xOff + 1}"), None,)
except IndexError:
return

Expand Down

0 comments on commit 73f1c33

Please sign in to comment.