Porting old stuff


Stock trading

Back in late 80s I owned MSX microcomputer. I also had subscribed Finnish computer magazine MikroBitti. In issue 11/87 there was stock trading game for Commodore 128 and since it seemed interesting I ported it over to MSX.

Now a bit over 30 years later those early magazines were released in PDF format and I had opportunity to port that game once again.

Selecting technology

Selecting technology wasn't that easy. I lately did quite a lot with Godot and this could have worked well there as well, but since most of the game revolves around very simple UI I decided go for Python and some UI library. I first had PySimpleGUI in my mind but then I accidentally stumbled upon DearPyGUI.

DearPyGUI, or DPG in short, seemed to fit my gamestyle and also provide relatively nice set of UI widgets to work with and initially it seemed very Pythonic.

Fight for your right to code

Main and only screen of game consists of two parts:

  • Player and round information (round, player name, cash)
  • Stock information and buy/sell controls for each

Initially it looked simple - two table like containers having some text labels that can be changed and one input box for integer. 

At this point I have to give big thanks to DPG community they really helped.

DPG is still in beta phase, currently in version 0.6.x and some things aren't polished yet. Specially working with some properties for some widgets is a bit strange partially because DearPyGUI wraps part of DearImGUI some things just are way they are because of underlying library.

Major issues I encountered and with help I did managed to get them working:

  • Text/Label widgets and updating them.
  • Component alignment
  • Containers
  • Lack of proper modal popups completely
    • There are popups but they are only bound to mouse actions

How much is the fish?

I spent weekend + 2 evenings doing this game. It's not yet completely finished but playable. So it didn't took that long. Most of the time was spent trying to make layout work nicely and buy/sell functionality which I changed over several times.

Files

stocktrader.zip 6 MB
Mar 08, 2021

Get Stock Trader

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.