fixed weird movement bug
This commit is contained in:
parent
742e78c853
commit
62e110a963
1 changed files with 2 additions and 0 deletions
2
nlong
2
nlong
|
@ -73,11 +73,13 @@ def main(stdscr):
|
||||||
cx = min(width-1, cx+1)
|
cx = min(width-1, cx+1)
|
||||||
with open(dataPath, 'w') as outfile:
|
with open(dataPath, 'w') as outfile:
|
||||||
json.dump(data, outfile)
|
json.dump(data, outfile)
|
||||||
|
tx = cx + (vx * width) - width // 2
|
||||||
|
|
||||||
# draw the screen
|
# draw the screen
|
||||||
stdscr.move(0, 0)
|
stdscr.move(0, 0)
|
||||||
for y in range(height-1):
|
for y in range(height-1):
|
||||||
for x in range(width):
|
for x in range(width):
|
||||||
|
stdscr.move(y,x)
|
||||||
stdscr.addstr(data.get(str((ty - cy + y,tx - cx + x)), ' '))
|
stdscr.addstr(data.get(str((ty - cy + y,tx - cx + x)), ' '))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue