ZeroPhone / ZPUI

Official ZeroPhone UI framework, based on pyLCI
http://zpui.rtfd.org/
Apache License 2.0
78 stars 19 forks source link

Added highscores and fixed winning of 2048 game, partially fixes #30 #167

Closed johanneskool closed 5 years ago

johanneskool commented 5 years ago

Also formatted the code according to best practices.

codecov[bot] commented 5 years ago

Codecov Report

Merging #167 into devel will decrease coverage by 0.05%. The diff coverage is 8.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel     #167      +/-   ##
==========================================
- Coverage   41.08%   41.03%   -0.06%     
==========================================
  Files         254      254              
  Lines       21428    21456      +28     
==========================================
  Hits         8804     8804              
- Misses      12624    12652      +28
Impacted Files Coverage Δ
apps/games/g_2048/logic.py 13.7% <7.69%> (-0.83%) :arrow_down:
apps/games/g_2048/main.py 19.04% <9.37%> (-3.58%) :arrow_down:
ui/date_picker.py 87.5% <0%> (-0.57%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 76d3a7e...043287b. Read the comment docs.

johanneskool commented 5 years ago

I removed that 512, it was a debugging value. The path is now correctly determined.

CRImier commented 5 years ago

No need to set local_path to an attribute of the game class, regardless, it technically works, I guess? =D Thank you, merging!

johanneskool commented 5 years ago

That way I don't have to redefine it in write_score(), or can that be done another way?

CRImier commented 5 years ago

Usually, you can just add it at the top of the file, globally, so that other classes can use it.