Yes, the NPC's are OO-modelled and their state is indeed maintained in nested hashes (if that means the $dude->{hitpoints} thing). Altough the Object Model will have to be revised (don't know if you care, but whatever)
The current system indeed gets user input, executes the user command, lets the NPC do their moves (some kind of AS - Artifial Stupidity - they're not quite intelligent yet :) ) and then gets user input again.
Term::ReadKey seems to be an attractive solution, thanks for the hint. But that also seems not to work on Windows systems. That is, it never worked for me.
But I'll have a look at it!
You say it'll depend on how my code is currently structured, but that's no important issue. Some procedures that should/could be part of the Classes, are still stored in the main part of the code (non-OO style), while others are stored in the class files. Some procedures that should be a method of class X that inherets from class Y, are stored in the file of class Y. So the current structure is Bad and really needs to be revised, as stated before.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.