Halloweendemo is a VT100 application written in VBA leveraging the consoul.net library.
The halloweendemo with source code is now on github.
This is a simple demo which creates and animates pumpkin sprites that were drawn with AsciiPaint.
The goal is to test the performance and limits (and problems) that may arise when creating, moving and interacting (you can click a pumpkin to kill it, if you catch it) multiple sprites (consoul windows).
- This is a quick and dirty demo.
- The main code is in the frmHalloween code. CConsoulSprite wraps a Consoul window for each pumpkin sprite and makes it transparent by color index.
- CConsoulSprite is not architected correctly (imho). Movement and direction should not be handled like it is done.
- Change the TIMER_INTERVAL constant to a higher value than 20. That's the number of milliseconds of the timer that moves all the sprites at once. Try 40 (or more, but you'll then feel the movement slowdown) if you experience intermittent freezing in the animation.
- The pumnpkin sprite was drawn with AsciiPaint and the generated code, slightly adapted, resides in the BuildPumpkinLinesArray() function.
- Clicking on a sprite routes the event in ICsMouseEventSink_OnMouseButton() in frmHalloween, finding the corresponing hWnd could be optimized, but the result seems responsive enough for the test.
- I have so many ideas on how to turn this to a nice and simple game. But not enough time to do so. Anyways, this was fun! Hoping you'll have fun too with that, that's the point.
I had less success porting the demo to the current twinBasic beta, as transparency and sprite redraws do not work as expected. But this will certainly be investigated forward; follow the project on github and get back here some times I you wish so.