Here is my try.

Code separated in different files.
No sound support yet.