I dont' know if I'm asking good question :S but...
Finally I've decided to start (slowly) creating this simple maze-dungeon-rogue-rpg-adventure-like game. Nothing fancy, just random dungeon, player character and few monsters to slay. What I've done so far is ... almost nothing. I want to make small steps, so I've written code which generates random dungeon. It works and it's quite easy.
My second step was to create player character and give it possibility to move around that dungeon. It works.
I did that by:
- using Array of string for Dungeon ('#' is wall and ' ' [space] is ... empty space)
- player character is
type
TPlayer = class
private
FPosX : Integer; //position X in dungeon
FPosY : Integer; //position Y in dungeon
FPRect: TRect; //TRect for player
property PosX: Integer read FPosX write FPosX;
property PosY: Integer read FPosY write FPosY;
property PRect: TRect read FPRect write FPRect;
public
end;
But I'm wondering if its good to do this like this.
I'm thinking about
- Creating class for every living entity in world with info about
- FEntityType : etNPC, etEnemy, etPlayer
- FEntityClass : ecWarrior, ecWizard, ecRogue, ecCleric etc etc.
- FEntityHealth: integer;
- FEntityAttitude : eaHostile, eaFriendly, etNone = for player?
- FEntityStr : integer; //Attack strength of entity?
- FIsQuestGiver: boolean; // I don't know if there will be quests, maybe except slay 10 rats
- FEntityRace: erHuman, erOgre, erDwarf etc
- FEntityRect: TRect // for image to Display
- FPosX: integer;
- FPosY: integer;
etc etc etc
and then create sth like this
TPlayer = class(TEntity)
TEnemy = class(TEntity)
etc etc etc
Does it make any sense? Or am I thinking all wrong about this.