Skip to content

Instantly share code, notes, and snippets.

@takashi1975
takashi1975 / Android.mk
Last active September 6, 2022 08:02
Box2dを動かしてみた (Cocos2d-x v3.2)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/external)
$(call import-add-path,$(LOCAL_PATH)/../../cocos2d/cocos)
LOCAL_MODULE := cocos2dcpp_shared
@takashi1975
takashi1975 / AppDelegate.cpp
Created August 23, 2014 09:03
Cocos2d-x v3 マルチ解像度
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLView::create("My Game");
director->setOpenGLView(glview);
}
//マルチ解像度
@takashi1975
takashi1975 / AppDelegate.cpp
Last active August 29, 2015 14:06
Cocos2d-x v3.x マルチ解像度 例2
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLView::create("My Game");
director->setOpenGLView(glview);
}
//マルチ解像度
@takashi1975
takashi1975 / AppActivity.java
Last active August 29, 2015 14:06
Cocos2d-x v3.x Android 記述しておきたい コード
public class AppActivity extends Cocos2dxActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//ボリュームの調整
setVolumeControlStream(AudioManager.STREAM_MUSIC);
}
}
@takashi1975
takashi1975 / HelloWordScene.h
Created September 7, 2014 07:36
Cocos2d-x v3.x シングルタップ
#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__
#include "cocos2d.h"
class HelloWorld : public cocos2d::Layer
{
public:
// there's no 'id' in cpp, so we recommend returning the class instance pointer
static cocos2d::Scene* createScene();
@takashi1975
takashi1975 / .bash_profile
Last active August 29, 2015 14:06
Cocos2d-x v3.x 環境設定 .bash_profile
#################################################################
# ANDROID SDK
export ANDROID_SDK_ROOT=/Applications/android-sdk-macosx
export PATH=$PATH:$ANDROID_SDK_ROOT
export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools
#################################################################
# ANDROID NDK
# export NDK_ROOT=/Applications/android-ndk-r9d
@takashi1975
takashi1975 / HelloWorldScene.cpp
Last active August 29, 2015 14:06
Cocos2d-x v3.2 マルチタップ(cocos2d_tests の MultiTouchTest からコピる!)
#include "HelloWorldScene.h"
USING_NS_CC;
#pragma mark - ### マルチタッチ対応 ###
//デバッグ表示用 カラー
static const Color3B* s_TouchColors[EventTouch::MAX_TOUCHES] = {
&Color3B::YELLOW,
@takashi1975
takashi1975 / Android.mk
Last active August 29, 2015 14:07
Cocos2d-x v3.2 で Spine を動かす
#########################################################
# Spine/Android.mk
#########################################################
#--------------------------------------------------------
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#--------------------------------------------------------
LOCAL_MODULE := spine_static
@takashi1975
takashi1975 / ParticleAdd
Created October 30, 2014 23:05
Cocos2d-x v3.2 ... パーティクルの追加
auto * particle = ParticleSystemQuad::create("particle_laserball.plist");
auto pos = Point::ZERO;
particle->setPosition(pos);
particle->setAutoRemoveOnFinish(true);
this->addChild(particle);
@takashi1975
takashi1975 / ReadMe.txt
Last active September 3, 2015 23:52
Cocos2d-x ver.3.2 Plugin を試してみた (Admob編)
Cocos2d-x ver.3.2 Plugin
[例] Admob を入れてみる
http://qiita.com/blankblank/items/0daf178e5e070a723798
http://brbranch.jp/blog/201407/cocos2d-x/adlantis_cocos2dx/
~~~ 準備 ~~~
1.プロジェクトの追加
・[Your Project]/cocos2d/plugin/protocols/proj.ios/PluginProtocol.xcodeproj