Commit graph

11 commits

Author SHA1 Message Date
af3d93ba11 Fix up how Maps are rendered in MapWindows
There was a bug in how MapWindow was calculating the numpy array slices
when drawing the map. Redo how this works so that MapWindow can draw
maps of arbitrary size and center maps that are smaller than the window's
drawable area.
2023-03-05 13:37:51 -08:00
4050ac5c6f Add a bunch of doc strings and header comments to files 2023-02-15 08:25:40 -08:00
356e205f2c Implement viewport tracking for the MapWindow
As the player moves the hero, the MapWindow will try to keep the
hero in the middle of the view.
2023-02-12 19:47:27 -08:00
8efd3ce207 Refactor map rendering
- Move all map rendering to a new MapWindow class
- Clip map rendering to the bounds of the Window
- Pass in Entities list from the Engine and render them relative to the window

The map doesn't scroll yet, so it'll always be clipped on the bottom and
right.
2023-02-12 15:55:01 -08:00
6780b0495c Move all the interface stuff to interface.Interface
Draw three windows with frames:
- map window
- info window (hit point bar; turn count)
- message window

Clean up the UI code in the Engine.
2023-02-11 01:21:52 -08:00
4124d1ae4e Clean up some pylint warnings in interface/color.py 2022-05-16 20:49:28 -07:00
e5485300ef Rename interface.bar.Bar -> interface.percentage_bar.PercentageBar 2022-05-16 16:47:21 -07:00
18a068cff6 Add some more basic colors and some semantic colors for the Health Bar 2022-05-16 16:40:29 -07:00
11aee12320 Add colors attribute to Bar class
This list lets you specify a set of colors that the bar should be painted with
depending on the percentage the bar is filled
2022-05-16 16:40:04 -07:00
6073454ed3 Add line 1 comment to interface/__init__.py 2022-05-16 16:39:19 -07:00
5a9df0a322 Add my first interface element: a Bar!
It renders a bar of a certain width and a percentage full. Use it to render HP.

Add a new Python package called interface. The Bar class lives there. Also add a
bunch of color defintions to a module called interface.color.
2022-05-15 00:12:05 -07:00