Documentation for C++/SDL 2.0 Tile Engine
Making a simple tile based engine
 All Classes Namespaces Functions Variables Enumerations
Public Member Functions | List of all members
Npc Class Reference

A simple npc. More...

#include <npc.h>

Inherits GameObject.

Public Member Functions

void Update ()
 Run once each frame.
void Move (float deltaT)
void Draw (Camera *cam=nullptr)
void SetMove (int moveDir)
Json::Value Save ()
void Load (Json::Value val)
- Public Member Functions inherited from GameObject
virtual void OnMouseDown ()
 On mouse down events.
virtual void OnMouseUp ()
 On mouse up event.
virtual void OnMouseEnter ()
 On mouse enter.
virtual void OnMouseExit ()
 On mouse exit.
virtual void CheckMouseOver (const Vector2f &pos)
bool GetMouseOver ()
 Return T/F is the mouse is over the object.
bool HasTag (std::string tag)
void SetCollisionMap (CollisionMap map)
Rectf Box ()
 Get the object's box.

Additional Inherited Members

- Protected Attributes inherited from GameObject
Image mImage
Physics mPhysics
 Handle's the objects physics.
std::string mTag
 To store tags to identify the object.

Detailed Description

A simple npc.

The base NPC class

Member Function Documentation

void Npc::Draw ( Camera cam = nullptr)
virtual

Draw the gameobject, apply an adjustment for the camera if one is desired

Parameters
camThe camera to adjust for

Implements GameObject.

void Npc::Load ( Json::Value  val)
virtual

Load the object from a Json::Value

See Also
GameObject::Load for loading of inherited members
Parameters
valThe Json::Value to load from

Reimplemented from GameObject.

void Npc::Move ( float  deltaT)
virtual

Move the object

Parameters
deltaTThe elapsed time

Implements GameObject.

Json::Value Npc::Save ( )
virtual

Save the object data to a json value and return it

See Also
GameObject::Save for saving of inherited members
Returns
The Json::Value containing the object data

Reimplemented from GameObject.

void Npc::SetMove ( int  moveDir)

Give the npc a direction to move in

Parameters
moveDirThe direction to move in
See Also
Math enum

The documentation for this class was generated from the following files: