Wizard Fu's Cocos2dx Platformer Game Engine v1.0.1

nat@wizardfu.com

See the file LICENSE for the license governing this code.

LevelObject > Projectile > Projectiles

#pragma once
#include "Headers.h"

See Projectile for common object properties that can be set for projectiles.

MagicMissile

The Player object’s projectile. Meant to look and act like a magic missile. Depending on the Player object’s abilities, the MagicMissile can fly a short distance or a long distance. The missile leaves a trail of particles. At the end of the missile’s journey, it explodes, dealing a slight area damage. MagicMissile will never damage the Player.

class MagicMissile : public Projectile
{
	public:
		virtual const char* const profileName() {return "MagicMissile";}
		MagicMissile();
		virtual ~MagicMissile();
		virtual void setProperties(Level& level, ValueMap& dict);
		virtual void createBody(Physics& physics, void* userData);
		virtual void createFixtures();
		virtual void launch();
		virtual void tick(float delta);
		virtual void onDestroy();
		GETTER_SETTER(int, playerIndex, PlayerIndex);

	private:
		typedef Projectile super;
		typedef MagicMissile self;
		
		int soundId;
};

Bone

The Bone is projectile that is thrown in an arc by the Skeleton toward the Player. At the end of the bone’s journey, it explodes, dealing a slight area damage.

class Bone : public Projectile
{
	public:
		virtual const char* const profileName() {return "Bone";}
		Bone();
		virtual ~Bone();
		virtual void setProperties(Level& level, ValueMap& dict);
		virtual void createFixtures();
		virtual void launch();
		virtual void animate(float delta);
		virtual void onDestroy();

	private:
		typedef Projectile super;
		typedef Bone self;
};

MagicBall

The MagicBall is a large, slow-moving projectile fired by the Mage toward the Player.

class MagicBall : public Projectile
{
	public:
		virtual const char* const profileName() {return "MagicBall";}
		MagicBall();
		virtual ~MagicBall();
		virtual void setProperties(Level& level, ValueMap& dict);
		virtual void launch();
		virtual void tick(float delta);

	private:
		typedef Projectile super;
		typedef MagicBall self;
		
		float hoverTimer;
};

Class hierarchy

 
h