You can make some fast and complex games with Perl/Tk. If you want really nice 2D-animations, look into Tk::Zinc, which is a Canvas with groups, rotations and zooming of groups. Check out my PONG with TkZinc.

Now you need to go through the hard lesson of learning to re-use widgets, and other aspects of keeping Tk running fast and clean. This is best done by experimenting with code. I keep my Tk skills going by making little games.

Here is a screenshot of a scrabble like game which you can play over a network thru sockets. You can get it here is you want to see how I did it-> ztk-babel

As far as books go, Mastering Perl/Tk is still the best. But like I said, your best avenue to learning is to actually start playing with the code. For instance, if you want a canvas based game, setup the canvas, decide how you are going to store widgets( probably in a hash) and get some rudimentary widgets and movement on the screen. Once you see the problems you are facing, then you start to realize what code you will need to implement your game....and like I said, watch your memory use constantly, there are well known pitfalls and fixes when using widgets, especially photo objects.

Right now I'm working on a network poker game with Tk, so don't think it can't be done. Admittedly SDL is geared up for games, especially for adding sound and zooming. However, Tk may be a better choice if you want to learn and extend your skills to non-gaming data display with Tk. Tk is generally more useful than SDL, in my opinion, but SDL is quite good. Tk is probably better for cross-platform compatibility than SDL, easier to install etc. SDL is a whole mess of different libs to get and install.


I'm not really a human, but I play one on earth. flash japh

In reply to Re: Perl TK books by zentara
in thread Perl TK books by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.