Freitag, 10. August 2012

Clickable dummy finished

Things have progressed nicely so far, even though I took a little longer (as usual) to grasp some of the basic concepts of kivy. I managed to finish a clickable backgammon dummy in a few days. Check it out:


I made only legal moves in that video, but any move would have worked, like moving backwards, piling up checkers of different colours etc. It's only a dummy without any logic underneath. That's the task lying ahead: Connect the existing meowBG logic to the new presentation layer.

Mittwoch, 8. August 2012

meowBG going kivy

I'm on holiday right now, and the last days I've been diving into the kivy framework. Kivy looks very promising, especially with respect to its multi-platform support. There has even been a kivy app released on Apple's app store. Hacking for iPhone and iPad in pure python? Me gusta!

So, after I've become a little tired of how sluggish my dear meowBG looks in its wxPython based implementation, I'm now planning to move the graphics parts entirely to kivy.

I'm especially looking forward to making the checkers fly smoothly across the board - the part that made my brain hurt in wxPython. It may be my lack of knowledge of wxPython, but animating widgets in kivy is just a walk in the park. Kivy's approach to animations is interesting: You define the animation independently of the widget it is applied to, and just specify the attributes that the animation will change. For instance, changing the position with an animation could work like this:

animation = Animation(pos=(100, 100), duration=0.2)
animation.start(target_widget)

This would move the object behind target_widget to the position (100, 100) within a fifth of a second. And of course you could specify a callback function to be called when the animation has finished, by setting

         animation.on_complete = your_callback_func