Permalink
Browse files

HUGE commit: ready for release v1.2!

1) Changed name to Arkaflow from previously Ching Chong Ping Pong,
because this game has drawn some inspiration from Arkanoid and
ULTRAFLOW.

2) Added a few user-friendly written instructions.

3) Changed the background music to match the new name.

4) Added 3 different new levels, where artificial intelligence was added
to the triangular bricks to automatically dodge the ball when it
approaches, thus making this game more puzzle-like.

5) Bugs fixed and more...
  • Loading branch information...
chen-yumin committed May 16, 2015
1 parent 719647d commit c95e7ca3ce76b8c4f1eb7b090ea3eb9c8a32c19a
Showing with 555 additions and 805 deletions.
  1. +1 −1 Classes/AppDelegate.cpp
  2. +0 −20 Classes/Element/Block.h
  3. +8 −8 Classes/Element/{Block.cpp → Brick.cpp}
  4. +20 −0 Classes/Element/Brick.h
  5. +1 −1 Classes/Element/Diamond.cpp
  6. +0 −31 Classes/Element/MainBall.cpp
  7. +0 −26 Classes/Element/MainBall.h
  8. +1 −1 Classes/Element/Ring.cpp
  9. +1 −1 Classes/Element/SmartString.cpp
  10. +0 −1 Classes/Element/SmartString.h
  11. +39 −7 Classes/Element/Target.cpp
  12. +6 −4 Classes/Element/Target.h
  13. +1 −1 Classes/Element/Triangle.cpp
  14. +2 −2 Classes/EngineHelper.h
  15. +3 −3 Classes/Levels/BaseLevel.cpp
  16. +6 −5 Classes/Levels/Level1.cpp
  17. +1 −1 Classes/Levels/Level1.h
  18. +3 −3 Classes/Levels/Level10.cpp
  19. +1 −1 Classes/Levels/Level10.h
  20. +5 −5 Classes/Levels/Level11.cpp
  21. +2 −2 Classes/Levels/Level11.h
  22. +3 −3 Classes/Levels/Level12.cpp
  23. +1 −1 Classes/Levels/Level12.h
  24. +6 −6 Classes/Levels/Level13.cpp
  25. +2 −2 Classes/Levels/Level13.h
  26. +6 −6 Classes/Levels/Level14.cpp
  27. +1 −1 Classes/Levels/Level14.h
  28. +8 −8 Classes/Levels/Level15.cpp
  29. +5 −5 Classes/Levels/Level16.cpp
  30. +1 −1 Classes/Levels/Level16.h
  31. +4 −4 Classes/Levels/Level17.cpp
  32. +2 −2 Classes/Levels/Level17.h
  33. +10 −10 Classes/Levels/Level18.cpp
  34. +2 −2 Classes/Levels/Level18.h
  35. +9 −9 Classes/Levels/Level19.cpp
  36. +1 −1 Classes/Levels/Level19.h
  37. +7 −7 Classes/Levels/Level2.cpp
  38. +8 −8 Classes/Levels/Level20.cpp
  39. +2 −2 Classes/Levels/Level20.h
  40. +7 −7 Classes/Levels/Level21.cpp
  41. +2 −2 Classes/Levels/Level21.h
  42. +32 −47 Classes/Levels/Level22.cpp
  43. +0 −2 Classes/Levels/Level22.h
  44. +90 −0 Classes/Levels/Level23.cpp
  45. +18 −0 Classes/Levels/Level23.h
  46. +8 −5 Classes/Levels/Level24.cpp
  47. +2 −2 Classes/Levels/Level24.h
  48. +4 −4 Classes/Levels/Level27.cpp
  49. +6 −6 Classes/Levels/Level3.cpp
  50. +2 −2 Classes/Levels/Level3.h
  51. +7 −7 Classes/Levels/Level4.cpp
  52. +1 −1 Classes/Levels/Level4.h
  53. +5 −5 Classes/Levels/Level5.cpp
  54. +2 −2 Classes/Levels/Level5.h
  55. +4 −4 Classes/Levels/Level6.cpp
  56. +1 −1 Classes/Levels/Level6.h
  57. +8 −8 Classes/Levels/Level7.cpp
  58. +2 −2 Classes/Levels/Level7.h
  59. +6 −6 Classes/Levels/Level8.cpp
  60. +1 −1 Classes/Levels/Level8.h
  61. +7 −7 Classes/Levels/Level9.cpp
  62. +2 −2 Classes/Levels/Level9.h
  63. +30 −21 Classes/Levels/Levels.cpp
  64. +1 −1 Classes/Levels/Levels.h
  65. +5 −5 Classes/Scene/AboutScene.cpp
  66. +4 −4 Classes/Scene/AboutScene.h
  67. +2 −2 Classes/Scene/BaseScene.cpp
  68. +5 −5 Classes/Scene/LevelPickerScene.cpp
  69. +4 −4 Classes/Scene/LevelPickerScene.h
  70. +44 −24 Classes/Scene/MainGameScene.cpp
  71. +9 −9 Classes/Scene/MainGameScene.h
  72. +4 −4 Classes/Scene/SettingsScene.cpp
  73. +4 −4 Classes/Scene/SettingsScene.h
  74. +26 −82 Classes/Scene/WelcomeScene.cpp
  75. +3 −4 Classes/Scene/WelcomeScene.h
  76. +1 −1 Classes/UI/BallButton.cpp
  77. +1 −1 Classes/UI/BallDialog.cpp
  78. +1 −1 Classes/UI/BallSlider.cpp
  79. +1 −1 Classes/UI/EdgedBallButton.cpp
  80. BIN Resources/audio/bgmusic.ogg
  81. BIN Resources/share.jpg
  82. BIN Resources/share.png
  83. BIN Resources/ui/title.png
  84. +3 −3 proj.android/AndroidManifest.xml
  85. +0 −17 proj.android/ant.properties
  86. +0 −13 proj.android/build-cfg.json
  87. +0 −83 proj.android/build.xml
  88. +0 −149 proj.android/build_native.py
  89. +4 −2 proj.android/jni/Android.mk
  90. +0 −20 proj.android/proguard-project.txt
  91. +0 −13 proj.android/project.properties
  92. BIN proj.android/res/drawable-hdpi/icon.png
  93. BIN proj.android/res/drawable-ldpi/icon.png
  94. BIN proj.android/res/drawable-mdpi/icon.png
  95. BIN proj.android/res/drawable-xhdpi/icon.png
  96. BIN proj.android/res/drawable-xxhdpi/icon.png
  97. BIN proj.android/res/drawable-xxxhdpi/icon.png
  98. BIN proj.android/res/drawable/icon.png
  99. +1 −1 proj.android/res/values-zh/strings.xml
  100. +1 −1 proj.android/res/values/strings.xml
  101. +5 −5 proj.android/src/org/cocos2dx/cpp/AppActivity.java
View
@@ -20,7 +20,7 @@ bool AppDelegate::applicationDidFinishLaunching() {
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, 2048*0.45, 1536*0.45), 1);
glview = GLViewImpl::createWithRect("Arkaflow", 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);
View

This file was deleted.

Oops, something went wrong.
@@ -1,18 +1,18 @@
#include "stdafx.h"
#include "Scene/MainGameScene.h"
#include "../Scene/MainGameScene.h"
#include "EngineHelper.h"
#include "Block.h"
#include "Brick.h"
USING_NS_CC;
Block::Block() {
Brick::Brick() {
}
Block::~Block() {
Brick::~Brick() {
}
Block* Block::create(float width, float height, int color) {
Block *block = new (std::nothrow) Block();
Brick* Brick::create(float width, float height, int color) {
Brick *block = new (std::nothrow) Brick();
if (block && block->initWithColor(C4B(color)))
{
block->autorelease();
@@ -23,15 +23,15 @@ Block* Block::create(float width, float height, int color) {
return nullptr;
}
void Block::initOpt(float width, float height){
void Brick::initOpt(float width, float height){
setContentSize(Size(width, height));
this->setTag(TAG_PHY_BLOCK);
}
/**
Make sure to setScale before initBody.
*/
void Block::initBody(){
void Brick::initBody(){
auto body = PhysicsBody::createBox(getContentSize(), SMOOTH_MATERIAL);
body->setDynamic(false);
body->setCategoryBitmask(0xFFFFFFF0);
View
@@ -0,0 +1,20 @@
#ifndef _BRICK_H_
#define _BRICK_H_
#include "EngineHelper.h"
class Brick: public cocos2d::LayerColor
{
public:
Brick();
~Brick();
static Brick* create(float width = 320, float height = 16, int color = E::P.C400);
SETOPACITY_FUNC(LayerColor);
void initBody();
protected:
void initOpt(float width, float height);
private:
};
#endif // _BRICK_H_
@@ -1,5 +1,5 @@
#include "stdafx.h"
#include "Scene/MainGameScene.h"
#include "../Scene/MainGameScene.h"
#include "EngineHelper.h"
#include "Diamond.h"

This file was deleted.

Oops, something went wrong.
View

This file was deleted.

Oops, something went wrong.
View
@@ -1,6 +1,6 @@
#include "stdafx.h"
#include "EngineHelper.h"
#include "Scene/MainGameScene.h"
#include "../Scene/MainGameScene.h"
#include "Ring.h"
USING_NS_CC;
@@ -1,6 +1,6 @@
#include "stdafx.h"
#include "SmartString.h"
#include "Scene/MainGameScene.h"
#include "../Scene/MainGameScene.h"
#include "EngineHelper.h"
#include "math.h"
@@ -2,7 +2,6 @@
#define _SMARTSTRING_H_
#include "cocos2d.h"
#include "MainBall.h"
#define SS_SPEEDRATIO 300
class SmartString : public cocos2d::Sprite
View
@@ -1,8 +1,8 @@
#include "stdafx.h"
#include "Scene/MainGameScene.h"
#include "../Scene/MainGameScene.h"
#include "EngineHelper.h"
#include "Target.h"
#include "Block.h"
#include "Brick.h"
USING_NS_CC;
@@ -57,6 +57,37 @@ void Target::playAnim(int index){
}
}
void Target::enableArtificialIntelligence(){
auto func = CallFunc::create([this](){_updateAI();});
runAction(RepeatForever::create(Sequence::create(func, nullptr)));
}
void Target::_updateAI(){
#define MOVING_TAG 10000
if(bAlreadyHit)
return;
S_MainGame *scene = ((S_MainGame *)S_MainGame::getCurrentScene());
if(scene == nullptr || scene->getMainBall() == nullptr)
return;
Vec2 pos = scene->getMainBall()->getPosition();
auto pos2 = getParent()->convertToWorldSpace(getPosition()) / E::scale;
//CCLog("pos: %f, %f; pos2: %f, %f;", pos.x, pos.y, pos2.x, pos2.y);
if(pos.getDistance(pos2) < 128)
{
stopActionByTag(MOVING_TAG);
MoveBy* mb;
if(pos2.y < 320)
{
mb = MoveBy::create(0.5f, Vec2(0, +320));
}
else{
mb = MoveBy::create(0.5f, Vec2(0, -320));
}
mb->setTag(MOVING_TAG);
runAction(mb);
}
}
/**
Make sure to setScale before initBody.
*/
@@ -73,12 +104,13 @@ void Target::initBody(){
void Target::beHit(){
if(bAlreadyHit)
return;
bAlreadyHit = true;
getPhysicsBody()->removeFromWorld();
Vec2 pos = getPosition() + getParent()->getPosition();
BaseScene::getCurrentScene()->putEmitter2(Vec2(pos.x, pos.y));
auto cbRemove = CallFunc::create([this](){removeFromParentAndCleanup(true);});
stopAllActions();
runAction(Sequence::create(FadeOut::create(0.6), cbRemove, nullptr));
bAlreadyHit = true;
targetNum --;
if(targetNum <= 0){
((S_MainGame*)BaseScene::getCurrentScene())->nextLevelDialog();
@@ -93,9 +125,9 @@ void Target::setPosition(float x, float y){
}
void Target::initProtector(float width){
block1 = Block::create(width, width / 8);
block2 = Block::create(width / 8, width * 0.75);
block3 = Block::create(width / 8, width * 0.75);
block1 = Brick::create(width, width / 8);
block2 = Brick::create(width / 8, width * 0.75);
block3 = Brick::create(width / 8, width * 0.75);
this->getParent()->addChild(block1);
this->getParent()->addChild(block2);
this->getParent()->addChild(block3);
@@ -116,4 +148,4 @@ void Target::_updateProtectorPosition(){
block1->setPosition(getPositionX() -x_offset, getPositionY()-x_offset);
block2->setPosition(getPositionX() -x_offset, getPositionY()-x_offset);
block3->setPosition(getPositionX() -x_offset + width - width / 8, getPositionY()-x_offset);
}
}
View
@@ -2,7 +2,7 @@
#define _TARGET_H_
#include "EngineHelper.h"
#include "Block.h"
#include "Brick.h"
class Target: public cocos2d::Sprite
{
@@ -18,12 +18,14 @@ class Target: public cocos2d::Sprite
SETOPACITY_FUNC(Sprite);
static int targetNum;
bool bAlreadyHit;
void enableArtificialIntelligence();
private:
void initOpt();
void _updateProtectorPosition();
Block* block1;
Block* block2;
Block* block3;
void _updateAI();
Brick* block1;
Brick* block2;
Brick* block3;
};
@@ -1,5 +1,5 @@
#include "stdafx.h"
#include "Scene/MainGameScene.h"
#include "../Scene/MainGameScene.h"
#include "EngineHelper.h"
#include "Triangle.h"
View
@@ -4,7 +4,7 @@
#include "cocos2d.h"
#include <SimpleAudioEngine.h>
#define VERSION "1.0"
#define VERSION "1.2"
#define PI 3.141592653589793238462643383279502884197169399375105820974944592307816406286
@@ -134,7 +134,7 @@ namespace stdPatchForMinGW
#define S(english,chinese) E::language==0? english: chinese
#define GAME_TITLE S("Ching Chong Ping Pong", "乾坤弹球")
#define GAME_TITLE S("Arkaflow", "溜溜的圈圈")
//#define FONT_MAIN S("Arial", "微软雅黑")
#define FONT_MAIN S("fonts/SF Theramin Gothic Condensed.ttf", "fonts/Chinese Font.ttf")
@@ -1,8 +1,8 @@
#include "stdafx.h"
#include "BaseLevel.h"
#include "Scene/MainGameScene.h"
#include "UI/TitleBar.h"
#include "Element/Target.h"
#include "../Scene/MainGameScene.h"
#include "../UI/TitleBar.h"
#include "../Element/Target.h"
USING_NS_CC;
View
@@ -1,8 +1,9 @@
#include "stdafx.h"
#include "stdafx.h"
#include "Level1.h"
#include "Element/Ring.h"
#include "Element/Target.h"
#include "Element/Triangle.h"
#include "../Element/Ring.h"
#include "../Element/Target.h"
#include "../Element/Triangle.h"
#include "../Scene/MainGameScene.h"
USING_NS_CC;
@@ -14,7 +15,7 @@ bool Level1::init()
}
restart();
S_MainGame::printString(S("Draw a line down here to fly the ball", "滑动手指画条直线来弹飞圈圈吧~"));
return true;
}
View
@@ -3,7 +3,7 @@
#include "EngineHelper.h"
#include "BaseLevel.h"
#include "Element/Target.h"
#include "../Element/Target.h"
class Level1 : public BaseLevel
{
@@ -1,8 +1,8 @@
#include "stdafx.h"
#include "Level10.h"
#include "Element/Ring.h"
#include "Element/Target.h"
#include "Element/Triangle.h"
#include "../Element/Ring.h"
#include "../Element/Target.h"
#include "../Element/Triangle.h"
USING_NS_CC;
View
@@ -3,7 +3,7 @@
#include "EngineHelper.h"
#include "BaseLevel.h"
#include "Element/Target.h"
#include "../Element/Target.h"
class Level10 : public BaseLevel
{
Oops, something went wrong.

0 comments on commit c95e7ca

Please sign in to comment.