Wizard Fu's Cocos2dx Platformer Game Engine v1.0.1

nat@wizardfu.com

See the file LICENSE for the license governing this code.

LevelObject > Character > AI > Enemy > NPCs

#pragma once
#include "Headers.h"

Squirrel

The Squirrel is stationary, sometimes eating nuts, until the Player object comes near. At this point the Squirrel is frightened and runs away. Collides with the Level. Does not collide with other LevelObject objects.

class Squirrel : public NPC
{
	public:
		virtual const char* const profileName() {return "Squirrel";}
		Squirrel();
		virtual ~Squirrel();
		virtual void setProperties(Level& level, ValueMap& dict);
		virtual void createFixtures();
		virtual void moodSeek(float delta);

	private:
		typedef NPC super;
		typedef Squirrel self;
		
		int turnCount;
		bool left;
};

Class hierarchy

 
h