What I have so far with React and Kotlin is entirely passive; the game just runs and there is no way to control it. Today I thought it was time to get the first bit of user input – selecting the current player action. Design The first step here was a simple design: I wanted
Continue reading User Input – First Steps
Tag: kotlin
Creating the Resource List and Adding Icons
The whole point about the move to React was to make the pages easier to implement, in particular with regards to getting some icons involved. The plan in this post was to create a resource list of the player’s current resources, and then get some images attached to the resource types. Creating the Component Firstly
Continue reading Creating the Resource List and Adding Icons
Kotlin and React Progress
So the new year is upon us and it’s time I got back to this. I’ve been a bit distracted lately – Christmas and all that, as well as building factories in Factorio. This week I’ve tried to finish off my conversion to a React based interface. This has proved to be quite problematical, mostly
Continue reading Kotlin and React Progress
A quiet week
I’ve not made much progress this week, but there’s always weeks like this. I’ve had an offer to make icons for the inventory, and so I need to look into how I can sort out the UI so that I can add icons. Kotlin itself doesn’t seem particularly suited to web page development directly –
Continue reading A quiet week
Message Passing in Web Workers
Once I’d implemented the Web Worker split, I had a new problem: How do I pass the messages back and forth? The main issues here is that I have to send the game state from the worker and the web page, and send requests for player interaction to the worker. Message Object The first thing
Continue reading Message Passing in Web Workers
Web Workers in Kotlin
Something I’ve known is useful for a web game is using Web Workers – the reason for this is that we need something to run in the background when the page isn’t active, and a page’s timer runs much more slowly when the page isn’t in focus (eg if you go to another tab) Kotlin does
Continue reading Web Workers in Kotlin
Game loop in Kotlin
To start the game, the first thing I need is a game loop. Kotlin’s timers, unfortunately, lack some clear documentation. The first thing I noticed was that the timer functionality is, once again, just a wrapper of Java timer and not available for Javascript. This really makes me think I’m using a second-class version of
Continue reading Game loop in Kotlin
A First Look at Kotlin
Next on the things that keep cropping up in my searches is Kotlin. This appears to be a Java derivative that can compile to a few different targets, one of which is Javascript, so I thought this might be a good idea. Installation It appears that Kotlin comes free with IntelliJ IDEA which is an editor
Continue reading A First Look at Kotlin