In this episode of Koding in #kotlin: #korge we
Started with the refactoring of the existing code (the simple one)
Then Igor realized that we should have speed not tied to the direction of movement
And refactored all the nasty bugs away!
Then we implemented the next important part of our plan: adding and removing balls on the fly.
And now we know that removing the last element from the list returns this element, so we can `let { it.die() }`
#gamedev #fun #learn
00:00 Intro, recap, making plans for this session
03:50 Refactoring GasParticle to require less init params
10:20 Attempting to rewrite initial balls generation with doubleRange and that horrible if-else that handles speed change
17:45 Storing particle velocity and direction as two separate variables
24:30 Making changes to input handler, introducing more bugs and fixing them
27:50 We finally realize how to simplify the speed handling
35:29 Witnessing the Wrath of Wi-Fi Gods
37:45 Adding an input handler to add a gas particle to the scene, which reveals some shadowing behind the scenes we were not aware of
45:40 Adding a handler to remove particles, letting it die peacefully
54:40 Wrapping up, pushing changes, and discussing the next steps towards ideal gas simulation
Commit with all the changes: https://github.com/cra/koding-in-kotl...
The repository itself: https://github.com/cra/koding-in-kotlin
Online demo of the JS version of the game: https://cra.github.io/koding-in-kotlin/