Skip to content

Recent ~ Java, Kotlin, Python

A break down of my most recent projects through their GitHub repositories.
Following a couple of courses on LibGdx game development offered the perfect opportunity to move from the comfort of Java to the advantages of Kotlin. This culminated in my:
Becoming confident with multi-module Gradle builds.
Transferring and refactoring a brick-breaker game from Java directly into Kotlin.
Writing a re-useable class hierarchy for LibGdx game objects.
Being far more language agnostic, for example my latest data manipulation/interrogation app to visualise and test trading strategies is in Python/PySide.
Using AI as an aid and a learning tool.
Recent ~ Java, Kotlin, Python
ezgif.com-optimize.gif
Strategy Visualiser → Current Project
Analysing, visualising and manipulating trade data inevitably leads you to R or Python. Once I had enough experience with Python in Jupyter I quickly wanted to be able to reuse all I was learning. This repository started as a group of Jupyter Notebooks derived from an algorithmic trading course. Moving to reusable classes in turn led in the direction of a structured app with a workflow that enables investigating strategies and adding new features easily as my clients (my) needs grow. As the app is personal, a web front-end is for once not an ideal choice. With research PySide made the most sense for my use-case. It has so many pre-baked options and access to all of the data-crunching goodness of Python. I’m using an AI coding companion for the first time, and it’s been a great help in quickly levelling up my Python. The GUI aspect of Pyside has also incentivised me to up my CSS/SCSS for bespoke styling.
ezgif.com-optimize.gif
Python_Sandbox_Private.png
ansi_termius.png
After setting up a number Virtual Personal Servers to investigate Nextcloud and a simple mail server with MailInABox I was struck by the repetitiveness of server tasks, especially when you are learning a set up for the first time. It is unlikely that any first set up will be the final set up, while you improve the process and learn. It is a grind of commands in an ordered list. I have all of the bash commands saved in a snippet repo now. Automation using Ansible seemed powerful, and it is, as I learned in this introduction to it. I like how the intent/procedure is baked into the process, the ordered list is there in the files.
ansi.png
api_ibkr_01.png
Broker authorization and access to their API is handled by the brokers bare-bones app using the Python examples shown on their site and used in this repository.
api_ibkr_02.png
cat_master.giv.gif
Java → Kotlin Brick Breaker
Began as a straight forward exercise in translating Java to Kotlin in real time so I could get used to the semantics, but soon developed into a refactoring exercise. I wanted to be able to reuse and simplify maintenance where I could, thinking about a future game of my own. I achieved the same end result as shown in the Java course, but with quite different architecture. The main difference was a reuseable class hierarchy for graphical game objects. After completing the game I used this repo as a LibGdx playground for transitions and GUIs. I was going to begin my own game, but then disaster struck one of my PC’s and I started looking at cloud storage servers, my interest in trading grew, my need for cloud-storage diminished, and I’m now fully committed to the ‘Strategy-Analyser’ as my main day-to-day project.
Brickbreaker.png
KotlinOA.png
I saw this course just before I was about to begin the final brick breaker game in Java. I’d heard good things about Kotlin, and thought ‘If I’m serious about writing a lot of code for my own games in the future, why not save on 20% of the typing?’ I’ve been enjoying using Kotlin and I may well complete the last game in the Java based LibGdx course in both Java and Kotlin.
KotlinOA02.png
KotlinSampler01.png
A place to sandbox newly found LibGdx concepts. I’ve converted it into a console app as JFrame is no longer supported. It uses reflection to launch the various SampleBase() classes by name.
KotlinSampler02.png
ysNbva6.png
A comfortable introduction to Kotlin
ysNbva6.png
p7zUzqS.png
I managed to stop myself going down a rabbit hole to devise a more elegant way of spawning multiple object types without overlap and within desired parameters. I realised there are bound to be multiple solutions already available. I bought some books instead. This is one of them: This was a good decision, it is my aim to write my own games, so getting a broad understanding of LibGdx and commonly used game patterns is more of a priority.
p7zUzqS.png
I thoroughly enjoyed this weekend with Python. With more experience I could become quite comfortable making my own scripts.
The classic Snake game, this time using Ashley. This basically means Object behaviours are designated by the components that they own.
The classic Snake game created using classic OO design in LibGdx.
Using Scene 2D for this familiar game
Looking at LibGdx Sprite with a familiar game.
Tidying object behaviours into components with Ashley.
A simple introduction to using the LibGdx library and using World Units rather than pixels, resizing to any device using FitViewport and having a debug environment that is larger than your actual gameworld. The last is invaluable for finding where your bugs are actually rendering!
This sampler presents a menu system in JFrame and uses reflection to run the various sample classes exploring various aspects of LibGdx.
It’s always best to have more than one project active, if you hit a snag, it is then possible to put your effort elsewhere before going back to solve any problems with a fresh head. This application is probably the most complex I have undertaken. Especially as it refactors through the various architecture patterns. I’m pretty sure it is geared towards more senior programmers than myself, but, for this reason I learned a huge amount from it. There were a few days worth of debugging on this particular journey. Ultimately I hit a snag at the end of the Outbox pattern refactor, and because I was enjoying game programming with LibGdx so much, I have not yet come back to this. I fully understand and can see the advantage of the isolation of the core code within this project, but I cannot say that I feel I ‘own the code’. With the interactions between Spring, Docker, Kafka and the advanced design patterns I need more time with it. I plan to set up the various patterns in a simplified form as separate projects.
Microservices with an X post emulator whose posts are hosted and searchable via a containerized elastic query Kafka cluster. I got my first experience of containerized microservices working together on my machine with this course. Left at lecture 64 of 100 though as the later sections were not a priority for me.
Initially a repository for code competition solutions, this repository morphed into an app for testing input vs output on the CodeChef site.
First experience with Spark that gave me an overview of how Big Data is manipulated in the cloud.
Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.