Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: How to build a scrabble type of game with perl

by mr_mischief (Monsignor)
on Apr 19, 2016 at 15:36 UTC ( #1160899=note: print w/replies, xml ) Need Help??

in reply to How to build a scrabble type of game with perl

A good way to learn GUI programming is to pick a library set that supports GUIs and go with it. Build a couple of applications with that library then try another. Pick a library that functions at the level of the graphics stack where you want to work and that's fitting for your target system.

There are CPAN modules for Tk, Wx, SFML, IUP, and Prima all of which are fairly straightforward. Tk isn't very pretty but is fairly simple and multi-language (it originally comes from the TCL community). Prima is Perl-specific. Wx is cross-platform and multi-language but is a bit more involved than Tk. IUP is cross-platform as well. There are some Windows GUI modules too.

Then there are the desktop environment types of libraries. Gtk and Qt are widely used on Linux and work on other platforms (including Windows and Mac) well if the right libraries are installed. Gtk is the graphics library used by Gnome and Qt is used by KDE. Gtk, Gtk2, Gtk3, QtCore4 and its associated modules, and more are available.

Any of the above are designed for windows, widgets, controls, all those things that a desktop GUI does. Then are the libraries actually focused on games and multimedia like OpenGL, SDL and the SDLx libraries, and the like. These could be useful for a word game with tiles, but may be overkill.

The X11 family of modules are for lower-level access to X11 services. Those are probably not what you're wanting, but it's good to know they are available.

Then there are the less conventional ways to do this. If characters are okay, you could go with Curses or Curses::Application maybe with Curses::UI. You could make it a web app and play it in a browser (using a local little web server for local games). You could make it hundreds of different ways.

I think worrying about how the game rules work first is a grand idea. Get an engine that represents your board, tiles, players, tile draws, and plays. Have a good idea how you want to move data in and out of that. Then build whatever UI to send and receive data from outside the engine, either as separate modules or even separate programs.

  • Comment on Re: How to build a scrabble type of game with perl

Replies are listed 'Best First'.
Re^2: How to build a scrabble type of game with perl
by Discipulus (Monsignor) on Apr 19, 2016 at 18:39 UTC
    thanks and ++mr_mischief for this wonderful GUI programming perl panorama, state of the art 2016!


    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re^2: How to build a scrabble type of game with perl
by Anonymous Monk on Apr 19, 2016 at 23:31 UTC
    mr_mischief, Thank you very much for a detailed overview on GUI development and what options are available out there. Your final paragraph on a real life action plan is very useful as well for beginners like me.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1160899]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2018-07-22 05:13 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (451 votes). Check out past polls.