Schwartz Engine

Schwartz Engine

About This

I develop Android Apps and games. I play board games and I am an experienced GM in warhammer Fantasy Role Play (1st and 2nd Ed). I am also painting and sculpting miniatures.
Yes that's right I am a freak - No mistake there. I am using this media to track my work and organise it a little.

Reclaiming my Unit Testing!

AppsPosted by Carsten Schwartz May 02, 2018 20:16
This evening I had to make a new unit test for one of the classes in my A DUNGEON HORROR DEED editor, for a while Eclipse had spat some kind of IDE NULL pointer exception in my face every time I tried to run a test. I have not done anything about since the classes under test not have changed.

But now it was urgent, so away I went to the web and was lucky to find a couple of good suggestions on a Stack Overflow entry. I used this one that specified what to do in the Eclipse IDE:

- Go to help
- Select: Install New Software
- In the Work with text box type: Juno
- Expand Programming languages in the tree view
- Select: Install Eclipse Java Development Tools
- Install it
- Restart

And it worked in first try:

So now I can make my testing count again!

As an aside I can mention that the Dice class that have methods I have used since 1989 when I made a program for rolling new Characters for Warhammer Fantasy Roleplay have a method for rolling a specific range from (and including) a minimum integer value to a maximum. I have never tried what happens if you give the method a minimum that is larger than the maximum. So of course I made a test where I tried this. I expected the method to switch the two parameters and still deliver a range roll from (and including) the lowest to the highest of the two values.

And of course it crashed, away I went an refactored the method to switch the values if the minimum was largest and now the test succeeds. And then I added some explanatory java doc as well:

  • Comments(0)//

Enhancement of the ADHD Level editor

AppsPosted by Carsten Schwartz Apr 12, 2018 21:53
Last night it occurred to me that the editor I have made for A DUNGEON HORROR DEED not is quite up to speed regarding communicating that the map you are editing has changed...

So the gloves went of and I implemented the classic 'hasChanged' flag used to indicate if your document/map has changed by adding an asterisk after the title of the editor window.

I also remembered that I had made a back door to mod the ADHD game. If you make a set of maps where one of them is named Gobbo Town and make a world map file from these called ADHDFakeMaps and copy that to where your save the progress of the game, then you will start in that map when starting a new game. I sat and used the Editor to create a little fake map level to use the back door and realized the the editor is well suited for this work, but the game will act a little strange if you try to load a save game from the original embedded map when you use the back door. So I have to remember that if I am modding. ;-)

As an aside I had to make a little extra features regarding saving. The Save... menu item worked as a Save As..., so I have implemented a true Save that saves with out questions. Also an opt to overwrite if an existing file is selected during Save As... was needed to make a proper editor, but I think it is OK now.. :-)

This is also added as part of the Game manual on, download the editor here.

  • Comments(0)//

A classic Mistake!

AppsPosted by Carsten Schwartz Apr 07, 2018 22:19
I just implemented a classic elastic collision formula to get a semi realistic collision modeling amongst the asteroids in my take of the 1979 Asteroids game.

This is the formula where the u vectors are the speeds before the collision, the v vectors the speeds after the collision and the m numbers are the masses.

I had implemented this correctly, but just made a tiny little mistake, the distance needed between two objects for them not to touch was calculated a little to small, causing the asteroids to linger almost on top of each other when colliding. After fixing this it looks a little better. Try it out HERE! :-)

  • Comments(0)//

It Lives, It Lives!

AppsPosted by Carsten Schwartz Apr 03, 2018 07:34
Yes that's rigth My TF700T Tablet Lives Once Again!

Recently my beloved tablet has gotten slow again even though I have rooted it and installed a custom rom that made it speedy. You cannot just install any App once you have installed a custom rom. I learned this the hard way. After installing som different browsers because I was tired of waiting on the slow Chrome experience, the tablet started rebooting at random and claiming that the start screen had stopped - Very Annoying!

I started thinking it was time to boot into recovery and reinstall the custom rom from the zips on the tablet. But I needed a good fast browser that had some kind of add/tracker blocking to give me a fast and seamless user experience. I fell over the Brave browser and away I went; wiped the tablet, installed the custom room from recovery and installed Brave as an experiment.

It is by far the best browsing experience I have had for a long time. Many sites pester you with commercials popups and all sort of time wasting crap, this browser simply ignores that and shows you the content instead of the waste. I highly recommend this product, I am not payed to write this, It is simply a quality product :-)

As an aside to all this glorification of a newly reborn tablet, I had to do it all over again because:

You must remember to:

- Select Do not auto update Apps in the settings of Google Play.
- Disable all location reporting
- Disable all usage and feedback reporting

I forgot it in the first run but quicly discovered that the tablet got slower, because it updated the installed optimized Apps. And wasted time using the GPS and the internet for wasteful purposes.

  • Comments(0)//

High Score and the last Collision stuff

AppsPosted by Carsten Schwartz Mar 31, 2018 17:48
I have added a class to show a High Score List and the last stuff that was missing in my take on the classic Asteroids Game from 1979. Now the Saucers also smash up the Asteroids and the Spaceship continues from the state it ended when moving to the next wave of Asteroids. It seems to be kind of finished. Try it out HERE!

I also had a strange issue with the custom font I made, when you draw vertical and horizontal lines on the Type Script canvas you have add 0.5 to a x or y coordinate, if it is a true integer like 1.0, 5.0 etc. So now the font stands more thin and solid - Strange...

  • Comments(0)//

Game of Life

AppsPosted by Carsten Schwartz Mar 23, 2018 15:11
Recently some chaps got me interested in Conway's Game of Life. This is a fun simulation of cellular birth, life and death in a grid based universe. So I could not help myself, of I went to try and make something that could simulate this in TypeScript. It has been a quite fun and learning experience.

I started out doing a basic simulation of the Cell AI depicted on the official Wiki page and after that I simply had to make my take on a graphical version. Also to learn a little about the performance of Browser based games using TypeScript.

As it turns out you can make a Singleton class where you store the graphics and use double buffering when you render it to gain an IMHO impressive performance. And it was also fun to design some graphics for the thing.

You can try the simulations I made here:

Simple Game of Life

Graphical Version

the controls are as follows:

[SPACE]: Clear the grid and introduce random live cells.
[A-L]: Inserts cells in some of the known patterns mentioned on the official Wiki.

Have fun...

Windows Versions!

To recap on some C++ coding I also made a Windows version on the Simple Game of Life. I used Virtual Box running Windows with the Visual Studio Community Edition to develop the C++ version.

I also found an old relate program that can make the Mandelbrot fractal this I made ages ago but it is quite fun. Every time it renders it dumps a Fractal.png file on its current location. By holding the left mouse button down, dragging the mouse and releasing you can zoom in the fractal imagery.

And that old Exe runs fine under Wine too :-)

You can download the exe files here:



Have fun...

  • Comments(0)//

The Asteroids Clone

AppsPosted by Carsten Schwartz Mar 14, 2018 15:34
Yep that's right while learning to code TypeScript to keep me sharp I have made my first version of an Asteroids Clone that you can try out HERE.


[SPACE]: Fire
[Left Arrow]: Turn Left
[Right Arrow]: Turn Right
[Up Arrow]: Thrust, be careful!
[Down Arrow]: Reverse Thrust, be even more careful!
[H] Hyper Space, don't try this at home!

[S]: Start new game

I have learned a lot about TypeScript and had a lot of fun recapping Vector math and reading about the mechanics of the classic game. There is a lot of sites on the web that talks about this old Classic.

Still need to do a lot yet, I will up date the game as I go along. Buttons are also needed to make the game playable on a mobile device and there is some of the game mechanics that crashes the ship to often and now hyperspace and security when ship reappears on the screen after a crash, but OK for a first demo :-)

  • Comments(0)//

Coding with Visual Studio Code on Linux

AppsPosted by Carsten Schwartz Mar 09, 2018 15:32
Yep that's right, I have been using Microsofts Visual Studio code on my Linux Box to play around with TypeScript, which is a really nice game development platform for the WEB. You can see a Demo of Triangle Collision I made Here.

It was a guy on the WEB that had made some nice starting points for working with TypeScript, who got me interested. And funny Enough Microsoft has made an IDE that can be used for developing TypeScript Apps. It looks a lot like Visual Studio, but has reduced functionality. And the great stuff is that they have made a version for Linux.

TypeScript is an extension of JavaScript and compiles to .js files. You can make classes, interfaces and I don't know what, If you're into OO development it is fairly easy to start using. I have inspired by the tutorials at Tyler Green and Typescript Games started making my own clone of the notorious Atari Asteroids Game from way back to learn the stuff, and then it is also a nice recap on Vector Calculus.

After a good start I had some problems being able to have one file per class I made. It turned out I had to use a reference tag with a path attribute (/// <reference path="../Commonlib/Vector.ts" />) to include other '.ts' TypeScript files and then add their paths in a file list in the files section of the 'tsconfig.json' file which defines the build of a typescript project.

And BTW! - I like the concept of using json for configurations instead of the dreaded non human readable XML ;-)

There are other ways to include/import classes in TypeScript and I went to great lengths to try them. I even installed a Virtual Windows using Virtual Box to try and see if the Visual Studio Community edition was better at this. Strangely enough Windows almost runs at normal speed inside Virtual Box. So with a more powerful laptop than my old i5 2 core clunker, you might as well stick to Linux and the run any Windows Development in a Virtual Box instance.

  • Comments(0)//
Next »