原创 cocos2dx3.2 自定義精靈讓精靈能夠回調接收EventTouch事件,

廢話少說,上代碼: 其實上次也說過的只不過這次是完善啦一些。 CustomSprite.h頭文件聲明: // //  CustomSprite.h //  DontSaveMe // //  Created by Mr Ga

原创 C++11新特性(四)static_assert, share_ptr, unique_ptr簡單使用

// auto also as the type of turn, as long as appoint the type #include <iostream> auto add(int a, int b)->int {  

原创 cocos2dx3.2 android.mk的標準配置,說笑呢

說標準那是因爲我用它能成功編譯出我的android遊戲僅此而已,哈哈 LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) $(call import-add-path,$(LOCAL_PA

原创 C++11新特性(六)bind,function,lambda簡單使用

#include <iostream> #include <functional> using namespace std; class Node; class Touch; class Event; #define 

原创 模板方法模式

using System; using System.Collections.Generic; using System.Text; namespace 模板方法模式 {     class Program     {         s

原创 xcode 光標變粗不能輸入,糾結很久

解決辦法shift + command + x

原创 cocos2dx3.2 xcode中資源路徑設置問題

在xcode中,將資源分類,然後將各自的文件夾添加到Resources,運行程序的時候老是報錯, 說是找不懂資源,原因就是找不到資源路徑。那麼如何設置呢? 1、首先在 xcode左邊的Resources上面用兩個手指輕輕點下,(這個我不知

原创 xcode提高開發效率,自定義代碼塊,你會了麼?

習慣寫c++代碼,使用xcode多少有點不習慣,畢竟xcode是專門爲objective準備的,爲什麼呢?請看: 比如我在xcode上敲dowhile然後按回車,則出來以下的代碼快  do {             <#stateme

原创 cocos2dx3.2 C++再談談函數指針的簡單使用

一般情況: void showMsg(float) {     cout << "show msg normal" << endl; } void (*p)(float); 然後這樣調用:     p = showMsg;  

原创 代理模式

using System; using System.Collections.Generic; using System.Text; namespace 代理模式 {     class Program     {         s

原创 github的簡單使用(一)

什麼是git,什麼是github,說概念我真的不懂,我知道這些東西能夠用於源代碼的管理。 我爲什麼要學習github,原因很簡單,有次我看到一位牛人的博客說:現在的程序員如果還不會掌握github的使用你還算是一名程序員麼? 哎,自己確實

原创 c++原來結構體這樣初始化也行,一直不知道呢?

typedef struct tagSolution {     std::string name;     int age;      }Solution; int main() {          static Soluti

原创 cocos2dx3.2 xcode代碼塊啊,氣死自己的類名,低級的錯誤何時了?

哎,以爲自己學會了在xcode上如何自己自定義代碼塊,沒曾想到自己竟然犯下如此低級的錯誤,是我的眼睛瞎了,還是。。。。 (如果大家不知道如何在xcode上創建自定義代碼塊的話可以參照我的上一篇文章:http://blog.csdn.ne

原创 簡單工廠模式

 using System; using System.Collections.Generic; using System.Text; namespace Operation {     /// <summary>     /// 運

原创 cocos2dx3.2 從引擎中學到的一招,創建新類,構造函數和虛析構函數都應該是保護類型

#include <iostream> #include <vector> using namespace std; class Node { public:     static Node* create();     vo