
cocos2d项目
文章平均质量分 87
天道殷勤
这个作者很懒,什么都没留下…
展开
-
接水果
话不多说,直接上代码,不喜勿喷,谢谢。class Fruits:public Layer//游戏的场景{public: static Scene* createScene(); bool init() override; CREATE_FUNC(Fruits); void onEnter()override; void onExit()override; boo...原创 2018-04-21 16:33:59 · 864 阅读 · 0 评论 -
cocos2d 打地鼠项目
开始界面代码就不发了,相信各位同仁都会,就把打地鼠游戏场景的代码发一下。不喜勿喷,谢谢大家。 cocos2d::Vector 是cocos2dx 在std::vector基础上封装了一层,cocos2d::Vector这个类模版维护了一个std::vector。cocos2d::Vector<int> cocosVector;//错误,首先这里<T>类型受到...原创 2018-04-14 10:35:35 · 1324 阅读 · 1 评论 -
cocosCreator项目 打地鼠
game.jscc.Class({ extends: cc.Component, properties: { //老鼠的预设体数组mousePrefab: [cc.Prefab],//老鼠的位置数组 pointmouse:[cc.Vec2], //锤子的的预设体 default:系统默认值 cc.Prefab预制文件实...原创 2018-05-26 15:01:33 · 2585 阅读 · 5 评论 -
画写球
#ifndef linePhysics_hpp#define linePhysics_hpp#include <stdio.h>#include <iostream>using namespace std;#include "cocos2d.h"USING_NS_CC;struct _segment{ Point p1; Point p2;};class Lin...原创 2018-05-23 15:34:42 · 189 阅读 · 0 评论 -
物理引擎Chipmunk--引力球
//// PhysicsJoints2.hpp// day01//// Created by MAC on 16/7/14.////#ifndef PhysicsJoints2_hpp#define PhysicsJoints2_hpp#include <stdio.h>#include <iostream>using namespace std;#include "...原创 2018-06-04 21:13:39 · 808 阅读 · 0 评论 -
斗地主文本
1、创建一副扑克牌,写代码首先创建一张牌的类。如下所示:1234567891011121314151617181920212223242526class Poker : public Sprite { public: Poker(); ~Poker(); static Poker* create(const char *pszFil...原创 2018-06-01 21:04:21 · 702 阅读 · 0 评论