From f3190206e03b61ec4c4a78fc51e1de235216f4e8 Mon Sep 17 00:00:00 2001 From: ZhangMenghe Date: Tue, 1 Sep 2015 14:21:08 +0800 Subject: [PATCH] Remove clickAndMove testcase --- tests/js-tests/project.json | 1 - .../src/ClickAndMoveTest/ClickAndMoveTest.js | 101 ------------------ tests/js-tests/src/tests-main.js | 9 -- 3 files changed, 111 deletions(-) delete mode 100644 tests/js-tests/src/ClickAndMoveTest/ClickAndMoveTest.js diff --git a/tests/js-tests/project.json b/tests/js-tests/project.json index b085e88a37..17b933b141 100644 --- a/tests/js-tests/project.json +++ b/tests/js-tests/project.json @@ -31,7 +31,6 @@ "src/TouchesTest/Paddle.js", "src/TouchesTest/TouchesTest.js", "src/SchedulerTest/SchedulerTest.js", - "src/ClickAndMoveTest/ClickAndMoveTest.js", "src/MenuTest/MenuTest.js", "src/ActionsTest/ActionsTest.js", "src/TileMapTest/TileMapTest.js", diff --git a/tests/js-tests/src/ClickAndMoveTest/ClickAndMoveTest.js b/tests/js-tests/src/ClickAndMoveTest/ClickAndMoveTest.js deleted file mode 100644 index 3e5121e739..0000000000 --- a/tests/js-tests/src/ClickAndMoveTest/ClickAndMoveTest.js +++ /dev/null @@ -1,101 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -var TAG_SPRITE = 1; - -var ClickAndMoveTestScene = TestScene.extend({ - runThisTest:function () { - var layer = new ClickAndMoveTestLayer(); - - this.addChild(layer); - director.runScene(this); - } -}); - -var ClickAndMoveTestLayer = cc.Layer.extend({ - ctor:function () { - - if(window.sideIndexBar){ - window.sideIndexBar.changeTest(0, 4); - } - - this._super(); - - this.init(); - - if( 'touches' in cc.sys.capabilities ) - cc.eventManager.addListener(cc.EventListener.create({ - event: cc.EventListener.TOUCH_ALL_AT_ONCE, - onTouchesEnded:function (touches, event) { - if (touches.length <= 0) - return; - event.getCurrentTarget().moveSprite(touches[0].getLocation()); - } - }), this); - else if ('mouse' in cc.sys.capabilities ) - cc.eventManager.addListener({ - event: cc.EventListener.MOUSE, - onMouseUp: function (event) { - event.getCurrentTarget().moveSprite(event.getLocation()); - } - }, this); - - var sprite = new cc.Sprite(s_pathGrossini); - - var layer = new cc.LayerColor(cc.color(255, 255, 0, 100)); - this.addChild(layer, -1); - - this.addChild(sprite, 0, TAG_SPRITE); - sprite.x = 20; - sprite.y = 150; - - sprite.runAction(cc.jumpTo(4, cc.p(300, 48), 100, 4)); - - var fadeIn = cc.fadeIn(1); - var fadeOut = cc.fadeOut(1); - var forever = cc.sequence(fadeIn, fadeOut).repeatForever(); - layer.runAction(forever); - }, - - moveSprite:function(position) { - var sprite = this.getChildByTag(TAG_SPRITE); - sprite.stopAllActions(); - sprite.runAction(cc.moveTo(1, position)); - var o = position.x - sprite.x; - var a = position.y - sprite.y; - var at = Math.atan(o / a) * 57.29577951; // radians to degrees - - if (a < 0) { - if (o < 0) - at = 180 + Math.abs(at); - else - at = 180 - Math.abs(at); - } - - sprite.runAction(cc.rotateTo(1, at)); - } -}); - -var arrayOfClickMoveTest = [ClickAndMoveTestLayer]; \ No newline at end of file diff --git a/tests/js-tests/src/tests-main.js b/tests/js-tests/src/tests-main.js index 1beb3568ab..7e311a6cad 100644 --- a/tests/js-tests/src/tests-main.js +++ b/tests/js-tests/src/tests-main.js @@ -291,15 +291,6 @@ var testNames = [ return new ChipmunkTestScene(); } }, - //"BugsTest", - { - title:"Click and Move Test", - platforms: PLATFORM_ALL, - linksrc:"src/ClickAndMoveTest/ClickAndMoveTest.js", - testScene:function () { - return new ClickAndMoveTestScene(); - } - }, { title:"ClippingNode Test", platforms: PLATFORM_ALL,