Skip to content

sangdev90/EatNum

 
 

Repository files navigation

EatNum Game

Developed with Cocos2d-x v3.2, by Hans Zhang (ezburg@gmail.com).

C++11 feature: Lambda

btnNext = ScalableSprite::create("next.png", 
	[this, nextChapter, nextLevel, showNext]() {
		m_doneLayer->removeFromParent();
		m_doneLayer = nullptr;
		m_nChapter = nextChapter;
		m_nLevel = nextLevel;
		this->loadLevel();
		this->scaleBlocks(0);
	}
);

STL std:function

typedef std::function<void(Ref *, Touch *, Event *)> touchCallback;

Customized Node

class Block : public Node
{
CC_CONSTRUCTOR_ACCESS:
	virtual ~Block() {}

	virtual bool init(const Color4B& bgColor, 
		const string& title, 
		const touchCallback& onTouchEnd,
		const touchCallback& onTouchBegan,
		const touchCallback& onTouchMoved,
		const touchCallback& onTouchCancelled);
};

And its sub class:

class DraggableBlock : public Block
{
	// ...
};

Cross platform support classes

  • CrossHelper
  • CrossiOS
  • CrossAndroid

Simple Cocos2d-x Class generator

Run on windows:

Classes/CreateCocos2dxClass.exe

About

🔢 Cocos2d-x 3.0 game with C++ 11

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 55.3%
  • Objective-C 12.8%
  • C# 11.8%
  • Python 7.0%
  • Objective-C++ 6.2%
  • Java 2.9%
  • Other 4.0%