March 11th, 2016Cams & Tweens

I guess one more couldn’t hurt, if only because this has been a surprising amount of work.

Well then, as the title suggests there’s two significant additions this week: cameras and tweening. The former isn’t too complicated as it’s basically just an object holding offset values affecting any renderable objects and layers not fixed to their position. The renderer can also easily switch between different cameras, so you can use multiple camera “angles” without having to change their positions back and forth. And now that I think about it, offering split screen capability shouldn’t be far from here…

Anyway, the other part, i.e. tweening, has been a lot more tricky. I’m still very used to JavaScript, where this probably would’ve been just a few lines of code and offered significantly more freedom than my 400 lines of code do now, which is a bit of a shame. There might of course be a way to do this that I haven’t figured out yet, but for now it’s only possible to tween specific values on specific objects. That should do fine for most applications, but if it was possible, I’d naturally prefer to let the user tween any- and everything.

Still, it’s fun to look at:

CORE2D-tweens

So much movement! Including all kinds of easing, delays, callbacks, and, most fun of all, various forms of repeat! One should be able to do some pretty cool stuff with that. Now all I need is to finish up audio streaming and build a proper asset manager and remember that I started writing a physics engine which is still terrible and useless at this point before I claim I’m about done.

Oh well.

Crabman out.