'2013/12/10'에 해당되는 글 4건
- 2013.12.10 추천 책
- 2013.12.10 [펌]유니티 구글드라이브 연동 소스
- 2013.12.10 패턴
- 2013.12.10 포물선 운동 관련 소스
한빛미디어 - 세가의 신입 사원 교육 과정에서 배우는 게임 프로그래밍의 정석 (히라야마 타카시 / 김성훈 옮기)
에이콘 출판사 - XNA 4.0 Game Development by Example 한국어판 (커트 재거스 저 / 김동훈, 김유나 공역)
'보고싶은책' 카테고리의 다른 글
| 유니티 서적 (0) | 2013.12.11 |
|---|---|
| 유니티 중급 이상 책 (0) | 2013.12.11 |
| 추천 책 (0) | 2013.12.10 |
| 패턴 (0) | 2013.12.10 |
| 만들면서 이해하는 실전! Cocos2d-x 3.x 게임 프로그래밍 (0) | 2013.12.01 |
| cocos2d-x (0) | 2013.11.22 |
Google Drive for Unity3D
Google Drive for Unity3D plugin.
Upload, explore, download files in someone's Google Drive.
And store your secure data such as score with AppData.
GitHub: https://github.com/midworld/unity-googledrive
and Doxygen Docs
Code:
var drive = new GoogleDrive(); drive.ClientID = "YOUR CLIENT ID"; drive.ClientSecret = "YOUR CLIENT SECRET"; // Request authorization. if (authorization.Current is Exception) { yield break; } // Authorization succeeded. // Upload a text file. // Get all files. var listFiles = drive.ListAllFiles(); var files = GoogleDrive.GetResult<List<GoogleDrive.File>>(listFiles); if (files != null) { foreach (var file in files) { // Download a text file and print. if (file.Title.EndsWith(".txt")) { var download = drive.DownloadFile(file); } } }
Code:
// Upload score in 'AppData'. int score = 10000; // User cannot see 'score.txt'. Only your app can see this file.
'잡다한것들전부 > 팁' 카테고리의 다른 글
| 유니티 2d rpg 개발 (0) | 2013.12.11 |
|---|---|
| 유니티 2d 게임 개발 (0) | 2013.12.11 |
| [펌]유니티 구글드라이브 연동 소스 (0) | 2013.12.10 |
| 유니티 포물선 공식 (1) | 2013.12.09 |
| 유니티 대화 예제 (0) | 2013.12.09 |
| 유니티 text 파일로 저장하는 법 (0) | 2013.12.09 |
"실용주의 디자인 패턴"
'보고싶은책' 카테고리의 다른 글
| 유니티 중급 이상 책 (0) | 2013.12.11 |
|---|---|
| 추천 책 (0) | 2013.12.10 |
| 패턴 (0) | 2013.12.10 |
| 만들면서 이해하는 실전! Cocos2d-x 3.x 게임 프로그래밍 (0) | 2013.12.01 |
| cocos2d-x (0) | 2013.11.22 |
| 게임 매니악스 슈팅 게임 알고리즘 (0) | 2013.11.21 |
#include "HelloWorldScene.h"
#include "SimpleAudioEngine.h"
using namespace cocos2d;
using namespace CocosDenshion;
CCScene* HelloWorld::scene()
{
// 'scene' is an autorelease object
CCScene *scene = CCScene::create();
// 'layer' is an autorelease object
HelloWorld *layer = HelloWorld::create();
// add layer as a child to scene
scene->addChild(layer);
// return the scene
return scene;
}
// on "init" you need to initialize your instance
bool HelloWorld::init()
{
//////////////////////////////
// 1. super init first
if ( !CCLayer::init() )
{
return false;
}
/////////////////////////////
// 2. add a menu item with "X" image, which is clicked to quit the program
// you may modify it.
// add a "close" icon to exit the progress. it's an autorelease object
CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
"CloseNormal.png",
"CloseSelected.png",
this,
menu_selector(HelloWorld::menuCloseCallback) );
pCloseItem->setPosition( ccp(CCDirector::sharedDirector()->getWinSize().width - 20, 20) );
// create menu, it's an autorelease object
CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
pMenu->setPosition( CCPointZero );
this->addChild(pMenu, 1);
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
sprite = CCSprite::create("CloseNormal.png");
this->addChild(sprite);
sprite->setPosition(ccp(20, winSize.height/2));
//힘
int Force = 5;
//각도 조절
float x = Force * cos(25);
float y = Force * sin(25);
//벡터값
vector = CCPoint(x, y);
time = 0.0f;
initPos = sprite->getPosition();
CCLog("%f, %f" , x,y);
this->schedule(schedule_selector(HelloWorld::gameLogic));
return true;
}
void HelloWorld::gameLogic(float dt)
{
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
//CCLog("gameLogic!");
time += dt;
//시간에 따른 포물선 운동 공식
float x = vector.x * time;
float y = vector.y * time - (9.8f/2.0f * time * time);
CCPoint pos = sprite->getPosition();
sprite->setPosition(ccp(pos.x+x,pos.y+y));
if(sprite->getPositionY() < 0)
{
time = 0;
sprite->setPosition(ccp(20, winSize.height/2));
}
}
void HelloWorld::menuCloseCallback(CCObject* pSender)
{
CCDirector::sharedDirector()->end();
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
exit(0);
#endif
}
'잡다한것들전부 > 팁' 카테고리의 다른 글
| 중급 개발자가 되는 방법 5가지 (0) | 2013.12.16 |
|---|---|
| 배경 무한 스크롤링 (0) | 2013.12.11 |
| 포물선 운동 관련 소스 (0) | 2013.12.10 |
| 헥사 게임 알고리즘 (0) | 2013.12.03 |
| 비쥬얼드 로직 (0) | 2013.12.02 |
| 비쥬얼드 3개 블록 맞추는 로직 (0) | 2013.12.02 |


