Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re:gregor42 Daft text adventure project

by gregor42 (Parson)
on May 29, 2001 at 18:13 UTC ( #83933=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Daft text adventure project
in thread Daft text adventure project

And obviously, if the PCs and the monsters were both subtypes of the same class, they could presumably possess the same movement routine, called in different ways. I think

Actually the way it would work would be that they would both inherit from a common class (prototype critter?) and therefore would be called the same way, via say the hypothetical "move" method. But, you would override the move method to make it function differently depending on the type of NPC or to add an interface for the PC's. But you would still call it by the same method name. i.e. move



Wait! This isn't a Parachute, this is a Backpack!

  • Comment on Re:gregor42 Daft text adventure project

Replies are listed 'Best First'.
Re: Re:gregor42 Daft text adventure project
by Tiefling (Monk) on May 29, 2001 at 18:31 UTC
    ...called the same way...

    Doh. I didn't express myself clearly, because I wasn't thinking clearly. I meant more or less what you just said. What I was thinking was that monsters (and generic NPCs, but not most other NPCs) would have a 'move me' feature which gave them a certain chance of making a random move, while the PCs would have their moves specified by input, and the special NPCs by hard-coded behaviours, although all these would end up being the arguments of a single move action. (The effect of which would be to put the moving object into the exit, and keep it there until the travel time had elapsed.)

    By the way, I currently have an idea of timestamping actions, so that multiple players can sit at a single terminal (and indeed, I don't have the resources or skill to do it any other way) and take their characters actions when the time comes around. This requires trust, but I anticipate that anyone making unauthorised moves for a fellow player will immediately have his ale taken away, or something. At least, it's for use at my own home, where such a result is inevitable. :-)

    More thanks,

    Tiefling

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://83933]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2020-12-05 05:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (63 votes). Check out past polls.

    Notices?