Permalink
Browse files

Ready for release v1.0!

  • Loading branch information...
chen-yumin committed Apr 6, 2015
1 parent e730148 commit 719647d09d24b8e7cf9a91fa6d28d77a60f91051
Showing with 2,680 additions and 977 deletions.
  1. +4 −1 Classes/AppDelegate.cpp
  2. +3 −3 Classes/Scene/AboutScene.cpp
  3. +8 −7 Classes/Scene/BaseScene.cpp
  4. +2 −1 Classes/Scene/LevelPickerScene.cpp
  5. +21 −7 Classes/Scene/MainGameScene.cpp
  6. +1 −1 Classes/Scene/SplashScene.cpp
  7. +7 −6 Classes/UI/BallDialog.cpp
  8. +3 −0 Classes/UI/BallDialog.h
  9. BIN Resources/g_charmy_av.png
  10. BIN Resources/g_charmysoft_logo.png
  11. +4 −0 proj.android/AndroidManifest.xml
  12. BIN proj.android/res/drawable-xxxhdpi/icon.png
  13. BIN proj.android/res/drawable/icon.png
  14. +99 −0 proj.android/src/org/cocos2dx/cpp/AppActivity.java
  15. +126 −388 proj.ios_mac/{Slippery Wheels.xcodeproj → CCPP.xcodeproj}/project.pbxproj
  16. +16 −9 proj.ios_mac/ios/AppController.mm
  17. BIN proj.ios_mac/ios/Default-667h@2x.png
  18. BIN proj.ios_mac/ios/Default-736h@3x.png
  19. +84 −1 proj.ios_mac/ios/Info.plist
  20. +4 −0 proj.ios_mac/ios/Prefix.pch
  21. +2 −2 proj.ios_mac/ios/RootViewController.mm
  22. +1 −1 proj.ios_mac/mac/Info.plist
  23. +4 −0 proj.ios_mac/mac/Prefix.pch
  24. BIN proj.win32/CCPP.sdf
  25. +46 −0 proj.win32/CCPP.vcxproj
  26. +138 −0 proj.win32/CCPP.vcxproj.filters
  27. +13 −0 proj.win8.1-universal/App.Shared/App.xaml
  28. +21 −0 proj.win8.1-universal/App.Shared/App.xaml.cpp
  29. +19 −0 proj.win8.1-universal/App.Shared/App.xaml.h
  30. +62 −0 proj.win8.1-universal/App.Shared/CCPP.Shared.vcxitems
  31. +42 −0 proj.win8.1-universal/App.Shared/CCPP.Shared.vcxitems.filters
  32. +143 −0 proj.win8.1-universal/App.Shared/Cocos2dRenderer.cpp
  33. +55 −0 proj.win8.1-universal/App.Shared/Cocos2dRenderer.h
  34. +239 −0 proj.win8.1-universal/App.Shared/OpenGLES.cpp
  35. +51 −0 proj.win8.1-universal/App.Shared/OpenGLES.h
  36. +28 −0 proj.win8.1-universal/App.Shared/OpenGLESPage.xaml
  37. +313 −0 proj.win8.1-universal/App.Shared/OpenGLESPage.xaml.cpp
  38. +78 −0 proj.win8.1-universal/App.Shared/OpenGLESPage.xaml.h
  39. 0 {proj.wp8-xaml/AppComponent → proj.win8.1-universal/App.Shared}/pch.cpp
  40. +14 −0 proj.win8.1-universal/App.Shared/pch.h
  41. +192 −0 proj.win8.1-universal/App.Windows/CCPP.Windows.vcxproj
  42. +29 −0 proj.win8.1-universal/App.Windows/CCPP.Windows.vcxproj.filters
  43. BIN proj.win8.1-universal/App.Windows/CCPP.Windows_TemporaryKey.pfx
  44. +30 −0 proj.win8.1-universal/App.Windows/Package.appxmanifest
  45. +144 −0 proj.win8.1-universal/App.WindowsPhone/CCPP.WindowsPhone.vcxproj
  46. +30 −0 proj.win8.1-universal/App.WindowsPhone/CCPP.WindowsPhone.vcxproj.filters
  47. +33 −0 proj.win8.1-universal/App.WindowsPhone/Package.appxmanifest
  48. +181 −0 proj.win8.1-universal/CCPP.sln
  49. +2 −2 proj.wp8-xaml/App/App.xaml
  50. +1 −2 proj.wp8-xaml/App/App.xaml.cs
  51. +18 −16 proj.wp8-xaml/App/{Slippery Wheels.csproj → CCPP.csproj}
  52. +1 −1 proj.wp8-xaml/App/EditBox.xaml
  53. +1 −2 proj.wp8-xaml/App/EditBox.xaml.cs
  54. +2 −2 proj.wp8-xaml/App/LocalizedStrings.cs
  55. +1 −1 proj.wp8-xaml/App/MainPage.xaml
  56. +53 −28 proj.wp8-xaml/App/MainPage.xaml.cs
  57. +2 −2 proj.wp8-xaml/App/Properties/AssemblyInfo.cs
  58. +19 −14 proj.wp8-xaml/App/Properties/WMAppManifest.xml
  59. +2 −1 proj.wp8-xaml/App/Resources/AppResources.Designer.cs
  60. +33 −103 proj.wp8-xaml/AppComponent/{Slippery WheelsComponent.vcxproj → CCPPComponent.vcxproj}
  61. +26 −27 ....wp8-xaml/AppComponent/{Slippery WheelsComponent.vcxproj.filters → CCPPComponent.vcxproj.filters}
  62. +0 −3 proj.wp8-xaml/AppComponent/pch.h
  63. +25 −21 proj.wp8-xaml/AppComponent/src/Cocos2dRenderer.cpp
  64. +9 −7 proj.wp8-xaml/AppComponent/src/Cocos2dRenderer.h
  65. +1 −1 proj.wp8-xaml/AppComponent/src/Direct3DContentProvider.cpp
  66. +2 −2 proj.wp8-xaml/AppComponent/src/Direct3DContentProvider.h
  67. +31 −18 proj.wp8-xaml/AppComponent/src/Direct3DInterop.cpp
  68. +5 −1 proj.wp8-xaml/AppComponent/src/Direct3DInterop.h
  69. +2 −2 proj.wp8-xaml/AppComponent/src/EditBoxEvent.cpp
  70. +1 −1 proj.wp8-xaml/AppComponent/src/EditBoxEvent.h
  71. +1 −0 proj.wp8-xaml/AppComponent/src/pch.cpp
  72. +11 −0 proj.wp8-xaml/AppComponent/src/pch.h
  73. +141 −0 proj.wp8-xaml/CCPP.sln
  74. +0 −293 proj.wp8-xaml/Slippery Wheels.sln
View
@@ -12,12 +12,15 @@ AppDelegate::~AppDelegate() {}
bool AppDelegate::applicationDidFinishLaunching() {
srand(time(NULL));
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
FileUtils::getInstance()->setDefaultResourceRootPath("res/");
#endif
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
//glview = GLViewImpl::createWithRect("Ching Chong Ping Pong", Rect(0, 0, 320, 640), 1);
glview = GLViewImpl::createWithRect("Ching Chong Ping Pong", Rect(0, 0, 800, 600), 1);
glview = GLViewImpl::createWithRect("Ching Chong Ping Pong", Rect(0, 0, 2048*0.45, 1536*0.45), 1);
//glview = GLViewImpl::createWithRect("Ching Chong Ping Pong", Rect(0, 0, DESIGNED_WIDTH, DESIGNED_HEIGHT), 1);
director->setOpenGLView(glview);
//glview->setDesignResolutionSize(DESIGNED_WIDTH, DESIGNED_HEIGHT, ResolutionPolicy::NO_BORDER);
@@ -103,15 +103,15 @@ bool S_About::init()
#define OFFSET_Y__ (320)
auto iconCharmy = Sprite::create("g_charmysoft_logo.png");
iconCharmy->setScale(0.5f);
auto iconCharmy = Sprite::create("g_charmy_av.png");
iconCharmy->setScale(0.6f);
iconCharmy->setAnchorPoint(Vec2(0, 0.5));
iconCharmy->setPosition(E::originX + 24, E::originY + OFFSET_Y__);
this->addChild(iconCharmy, 0);
auto lbCharmy = Label::createWithTTF(S("CharmySoft", "尘泯网络"), FONT_BOLD, 28,
Size(320, 64), TextHAlignment::CENTER, TextVAlignment::CENTER);
lbCharmy->setPosition(E::visibleWidth/2 + 80, E::originY + OFFSET_Y__ + 40);
lbCharmy->setPosition(E::visibleWidth/2 + 80, E::originY + OFFSET_Y__ + 48);
lbCharmy->setAnchorPoint(Vec2(0.5, 0.5));
lbCharmy->setColor(C3B(E::P.C900));
this->addChild(lbCharmy, 0);
@@ -62,6 +62,7 @@ void BaseScene::onKeyReleased(cocos2d::EventKeyboard::KeyCode keyCode, cocos2d::
bool BaseScene::onTouchBegan(cocos2d::Touch* touch, cocos2d::Event* event)
{
utils::captureScreen(nullptr, "D:/a.png");
/*
#ifndef NDEBUG
Vec2 p = touch->getLocation() / E::scale;
@@ -232,7 +233,7 @@ void BaseScene::putEmitter(Vec2 pos){
void BaseScene::putEmitter2(Vec2 pos){
m_emitterCreated ++;
auto _emitter = ParticleSystemQuad::createWithTotalParticles(100);
auto _emitter = ParticleSystemQuad::createWithTotalParticles(60);
//_emitter->retain();
_emitter->setTag(m_emitterCreated);
@@ -275,13 +276,13 @@ void BaseScene::putEmitter2(Vec2 pos){
_emitter->setEndSpinVar(360);
// color of particles
_emitter->setStartColor(C4F_(E::P.C700, 0.7f));
_emitter->setStartColor(C4F_(E::P.C700, 0.5f));
_emitter->setStartColorVar(Color4F(0.1f, 0.1f, 0.1f, 0.2f));
_emitter->setEndColor(C4F_(E::P.C700, 0.15f));
_emitter->setEndColorVar(Color4F(0.1f, 0.1f, 0.1f, 0.15f));
// size, in pixels
_emitter->setStartSize(28.0f);
_emitter->setStartSize(32.0f);
_emitter->setStartSizeVar(4.0f);
_emitter->setEndSize(ParticleSystem::START_SIZE_EQUAL_TO_END_SIZE);
@@ -300,7 +301,7 @@ void BaseScene::putEmitter2(Vec2 pos){
void BaseScene::putEmitter3(Vec2 pos){
m_emitterCreated ++;
auto _emitter = ParticleSystemQuad::createWithTotalParticles(40);
auto _emitter = ParticleSystemQuad::createWithTotalParticles(20);
//_emitter->retain();
_emitter->setTag(m_emitterCreated);
@@ -337,10 +338,10 @@ void BaseScene::putEmitter3(Vec2 pos){
_emitter->setLifeVar(0.8f);
// color of particles
_emitter->setStartColor(C4F_(E::P.C500, 0.8f));
_emitter->setStartColorVar(Color4F(0.1f, 0.1f, 0.1f, 0.2f));
_emitter->setStartColor(C4F_(E::P.C500, 0.4f));
_emitter->setStartColorVar(Color4F(0.1f, 0.1f, 0.1f, 0.3f));
_emitter->setEndColor(C4F_(E::P.C300, 0.3f));
_emitter->setEndColorVar(Color4F(0.1f, 0.1f, 0.1f, 0.15f));
_emitter->setEndColorVar(Color4F(0.1f, 0.1f, 0.1f, 0.2f));
// size, in pixels
_emitter->setStartSize(32.0f);
@@ -169,7 +169,7 @@ bool S_LevelPicker::init()
CPalette[i]->setScale(0.3f);
CPalette[i]->setAnchorPoint(Vec2(0, 0));
CPalette[i]->setTag(TAG_COLOR_MENU+i);
auto lbLevel = Label::createWithTTF(stdp::to_string(i+1), FONT_BOLD, 128,
auto lbLevel = Label::createWithTTF(i+1 > E::settings.unlockedLevel? "?": stdp::to_string(i+1), FONT_BOLD, 128,
CPalette[i]->getContentSize(), TextHAlignment::CENTER, TextVAlignment::CENTER);
lbLevel->setPosition(CPalette[i]->getContentSize()/2);
//lbLevel->setAnchorPoint(Vec2(0.5, 0.5));
@@ -273,6 +273,7 @@ void S_LevelPicker::menuCallback(Ref* pSender)
void S_LevelPicker::_ok(){
E::settings.currentLevel = m_tempLevel;
UserDefault::getInstance()->setIntegerForKey(UD_CURRENT_LEVEL, E::settings.currentLevel);
m_bClose = 1;
runAnimations(true);
}
@@ -39,7 +39,7 @@ bool S_MainGame::init()
// super init
if (!BaseScene::init(E::P.C100)){return false;}
#ifndef NDEBUG
//E::settings.currentLevel = 19;
//E::settings.currentLevel = 21;
E::settings.unlockedLevel = 22;
#endif
@@ -263,13 +263,21 @@ void S_MainGame::onKeyEvent(EventKeyboard::KeyCode keyCode, cocos2d::Event *even
}
void S_MainGame::backHomeDialog(){
auto leaveDialog = BallDialog::create(S("If you go back to home page, your current game will be lost, are you sure?", "返回主菜单后当前游戏数据将丢失,您确定要返回主菜单吗?"), CC_CALLBACK_0(S_MainGame::leaveGame, this));
this->addChild(leaveDialog, 1000);
static BallDialog* leaveDialog = nullptr;
if(leaveDialog == nullptr || leaveDialog->isValid() == false){
leaveDialog = BallDialog::create(S("If you go back to home page, your current game will be lost, are you sure?", "返回主菜单后当前游戏数据将丢失,您确定要返回主菜单吗?"), CC_CALLBACK_0(S_MainGame::leaveGame, this));
leaveDialog->setReferencer(&leaveDialog);
this->addChild(leaveDialog, 1000);
}
}
void S_MainGame::pickLevelDialog(){
auto leaveDialog = BallDialog::create(S("If you pick a new level, your current game will be lost, are you sure?", "选择新的关卡后当前游戏数据将丢失,您确定要选择关卡吗?"), CC_CALLBACK_0(S_MainGame::pickLevel, this));
this->addChild(leaveDialog, 1000);
static BallDialog* pickLevelDialog = nullptr;
if(pickLevelDialog == nullptr || pickLevelDialog->isValid() == false){
pickLevelDialog = BallDialog::create(S("If you pick a new level, your current game will be lost, are you sure?", "选择新的关卡后当前游戏数据将丢失,您确定要选择关卡吗?"), CC_CALLBACK_0(S_MainGame::pickLevel, this));
pickLevelDialog->setReferencer(&pickLevelDialog);
this->addChild(pickLevelDialog, 1000);
}
}
void S_MainGame::pickLevel(){
@@ -339,6 +347,8 @@ void S_MainGame::restartGame(){
addChild(m_game, 2);
m_game->runAction(Sequence::create(DelayTime::create(0.6f), FadeIn::create(0.3f), nullptr));
}
m_smartstring->stopGoing();
}
@@ -422,8 +432,12 @@ void S_MainGame::menuCallback(Ref* pSender)
case TAG_RESTART:
{
auto leaveDialog = BallDialog::create(S("Do you want to restart this game?", "是否想要重新开始这一关?"), CC_CALLBACK_0(S_MainGame::restartGame, this));
this->addChild(leaveDialog, 1000);
static BallDialog* restartDialog = nullptr;
if(restartDialog == nullptr || restartDialog->isValid() == false){
restartDialog = BallDialog::create(S("Do you want to restart this game?", "是否想要重新开始这一关?"), CC_CALLBACK_0(S_MainGame::restartGame, this));
restartDialog->setReferencer(&restartDialog);
this->addChild(restartDialog, 1000);
}
break;
}
case TAG_HOME:
@@ -22,7 +22,7 @@ bool S_Splash::init()
}
auto iconCharmy = Sprite::create("g_charmysoft_logo.png");
iconCharmy->setScale(0.8f);
iconCharmy->setScale(0.75f);
iconCharmy->setAnchorPoint(Vec2(0.5, 0.5));
iconCharmy->setOpacity(0);
iconCharmy->setPosition(E::visibleWidth / 2, E::visibleHeight / 2);
View
@@ -10,6 +10,7 @@ USING_NS_CC;
#define TAG_CANCEL 1
BallDialog::BallDialog() {
m_referencer = nullptr;
}
BallDialog::~BallDialog() {
@@ -152,7 +153,6 @@ void BallDialog::runAnimations(bool bReverse){
E::playEffect("da");
m_callbackOK();
}
this->removeFromParentAndCleanup(true);
break;
}
@@ -163,17 +163,18 @@ void BallDialog::runAnimations(bool bReverse){
E::playEffect("da");
m_callbackCancel();
}
this->removeFromParentAndCleanup(true);
break;
}
default:
{
this->removeFromParentAndCleanup(true);
break;
}
}
this->removeFromParentAndCleanup(true);
if(m_referencer != nullptr && *m_referencer != nullptr){
*m_referencer = nullptr;
m_referencer = nullptr;
}
});
auto seq = Sequence::create(DelayTime::create(0.4f), callback, nullptr);
this->runAction(seq);
@@ -185,4 +186,4 @@ void BallDialog::menuCallback(Ref* pSender)
auto pMenuItem = (MenuItem*)pSender;
m_resultTag = pMenuItem->getTag();
runAnimations(true);
}
}
View
@@ -10,6 +10,8 @@ class BallDialog : public cocos2d::Sprite
~BallDialog();
static BallDialog* create(const std::string = "", const std::function<void(void)>& callbackOK = nullptr, const std::function<void(void)>& callbackCancel = nullptr, const std::string ok = "ui/b_ok.png", const std::string cancel = "ui/b_cancel.png");
void runAnimations(bool);
bool isValid(){return m_listenerId != -1;};
void setReferencer(BallDialog** referencer){m_referencer = referencer;};
private:
void addEvents();
@@ -25,6 +27,7 @@ class BallDialog : public cocos2d::Sprite
void initOpt(std::string, std::string);
void menuCallback(cocos2d::Ref* pSender);
int m_listenerId;
BallDialog** m_referencer;
};
View
Binary file not shown.
Binary file not shown.
@@ -26,7 +26,10 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<supports-screens android:anyDensity="true"
android:smallScreens="true"
@@ -35,4 +38,5 @@
android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>
Binary file not shown.
Binary file not shown.
@@ -26,7 +26,106 @@ of this software and associated documentation files (the "Software"), to deal
****************************************************************************/
package org.cocos2dx.cpp;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.cocos2dx.lib.Cocos2dxActivity;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.content.res.AssetManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
public class AppActivity extends Cocos2dxActivity {
// Buffer size used.
private final static int BUFFER_SIZE = 1024;
static Activity a;
static File file = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
a = this;
super.onCreate(savedInstanceState);
}
public static void Charmy_Share() {
new Thread(new Runnable() {
public void run() {
if(file == null || !file.exists()){
CopyShareToSdCard();
file = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/ccpp.png");
}
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("image/*");
intent.putExtra(Intent.EXTRA_SUBJECT, "Ching Chong Ping Pong");
intent.putExtra(Intent.EXTRA_TEXT, "Check out this extradinary game, Ching Chong Ping Pong! It's real fun! http://www.CharmySoft.com");
intent.putExtra(Intent.EXTRA_STREAM,
Uri.fromFile(file));
a.startActivity(Intent.createChooser(intent, "Share Game"));
}
}).start();
}
public static void Charmy_Rate(){
Uri uri = Uri.parse("market://details?id=" + a.getApplicationContext().getPackageName());
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
try {
a.startActivity(goToMarket);
} catch (ActivityNotFoundException e) {
a.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=" + a.getApplicationContext().getPackageName())));
}
}
private static void CopyShareToSdCard() {
try{
AssetManager assetManager = a.getApplicationContext().getAssets();
InputStream in = assetManager.open("share.png");
OutputStream out = new FileOutputStream(Environment.getExternalStorageDirectory().getAbsolutePath() + "/ccpp.png");
copyAssetFiles(in, out);
in.close();
in = null;
out.flush();
out.close();
out = null;
}catch (FileNotFoundException e) {
e.printStackTrace();
} catch (NullPointerException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
private static void copyAssetFiles(InputStream in, OutputStream out) {
try {
byte[] buffer = new byte[BUFFER_SIZE];
int read;
while ((read = in.read(buffer)) != -1) {
out.write(buffer, 0, read);
}
in.close();
in = null;
out.flush();
out.close();
out = null;
} catch (IOException e) {
} catch (NullPointerException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Oops, something went wrong.

0 comments on commit 719647d

Please sign in to comment.