CaptainCoderOrg / CapMan

A Pac Man Inspired Game for Learning and Fun!
3 stars 4 forks source link

Game input parser #46

Closed smabuk closed 6 months ago

smabuk commented 6 months ago

This implements and closes #44.

I've tried to do this in a way that has minimal impact on the existing classes.

Input format

Format of the input is:

Actors
<blank line>
Board

Actors

Comma delimited list of attributes Name, startX, startY, speed, direction, behaviour, optional behaviour parameters

Having a name of CapMan represents the player and the behaviour is ignored

Example

So our standard starting positions looks like:

CapMan         , (14, 23), 8, Left , manual
targetsPlayer  , (14, 11), 4, Down , TargetPlayerTile
clydeEnemy     , (11, 14), 4, Left , Clyde    , (11, 13), (11, 15), (13, 11)
targetAhead    , (13, 15), 4, Right, Bob      , (13, 15), (13, 13), (13, 11)
whimsicalEnemy , (16, 14), 4, Left , Whimsical, (16, 15), (16, 13), (13, 11), targetsPlayer

╭────────────╮╭────────────╮
│............││............│
│.╭──╮.╭───╮.││.╭───╮.╭──╮.│
│O│  │.│   │.││.│   │.│  │O│
│.╰──╯.╰───╯.╰╯.╰───╯.╰──╯.│
│..........................│
│.╭──╮.╭╮.╭──────╮.╭╮.╭──╮.│
│.╰──╯.││.╰──╮╭──╯.││.╰──╯.│
│......││....││....││......│
etc.

Notes