├── .gitignore ├── CocosDenshion └── SimpleAudioEngine.js ├── README.md ├── bin ├── Cocos2dPatchs.js ├── Demo.js ├── GameLayer.js ├── GameScene.js ├── MainScene.js ├── actions │ ├── DynamicMove.js │ └── Timer.js ├── animations.js ├── common.js ├── dna │ ├── DNA.js │ ├── Gene.js │ ├── GeneBuildingUpgrader.js │ └── genes.js ├── event.js ├── icell-html5.js ├── icell-native.js ├── inner │ ├── Cell.js │ ├── CellHexgon.js │ ├── CellInnerMap.js │ ├── Hexgon.js │ ├── HexgonAxes.js │ ├── HexgonAxesPathMap.js │ ├── InnerLayer.js │ ├── building │ │ ├── Building.js │ │ ├── BuildingLayer.js │ │ ├── Bullet.js │ │ ├── PlastosomePower.js │ │ ├── ProteinFactory.js │ │ ├── Recycle.js │ │ ├── Rocket.js │ │ ├── Tower.js │ │ └── up │ │ │ ├── TowerBombing.js │ │ │ ├── TowerFirepower.js │ │ │ ├── TowerRetardment.js │ │ │ └── UpgraderBase.js │ ├── monster │ │ ├── FlopAminoAcid.js │ │ ├── Mitochondria.js │ │ ├── Virus.js │ │ ├── VirusCluster.js │ │ └── VirusLayer.js │ ├── organ │ │ ├── Bottles.js │ │ ├── Eye.js │ │ ├── Organ.js │ │ └── Tower.js │ └── skill │ │ ├── Bottles.js │ │ ├── Bullet.js │ │ ├── OutsideShooter.js │ │ └── SkillBase.js ├── levels │ ├── FreeWorld.js │ ├── LevelSelector.js │ ├── ResourceLoadingScene.js │ ├── ResourcePreloader.js │ └── c1 │ │ ├── l1.js │ │ ├── l2.js │ │ ├── l3.js │ │ ├── l4.js │ │ ├── l5.js │ │ ├── l6.js │ │ ├── l7.js │ │ ├── l8.js │ │ ├── lv_lost.js │ │ └── tutorial.js ├── outer │ ├── AminoAcid.js │ ├── Boss.js │ ├── BossCompass.js │ ├── Bottles.js │ ├── Camera.js │ ├── Cell.js │ ├── CellShell.js │ ├── ContactListener.js │ ├── Footprint.js │ ├── LifeEntity.js │ ├── PhysicalEntity.js │ ├── PlayerLayer.js │ ├── Portal.js │ ├── RandomRolesLayer.js │ ├── Stain.js │ ├── VirusCluster.js │ └── pinups │ │ ├── LayerGround.js │ │ └── Pinup.js ├── settings.js ├── test.js ├── ui │ ├── BuildingCreateMenu.js │ ├── BuildingUpgradeMenu.js │ ├── CreateBuildingBtn.js │ ├── DlgRewardGene.js │ ├── MsgBox.js │ ├── PauseMenu.js │ ├── UI.js │ ├── UILayer.js │ ├── UpgradeBuildingBtn.js │ ├── ZoomBar.js │ ├── dashboard │ │ ├── Dashboard.js │ │ └── Star.js │ ├── editer │ │ ├── ObjectEditer.js │ │ ├── PanelPinup.js │ │ ├── PanelRole.js │ │ ├── PanelStain.js │ │ ├── PropsList.js │ │ ├── WorldEditer.js │ │ └── WorldEditerLayer.js │ ├── font │ │ ├── Font.js │ │ └── Html5Font.js │ ├── menu │ │ ├── Menu.js │ │ └── MenuStar.js │ └── skill │ │ ├── ButtonBase.js │ │ ├── OutsideShooterButton.js │ │ └── SkillBar.js ├── user │ ├── AminoAcidPool.js │ ├── Character.js │ ├── ProteinFormulas.js │ └── ProteinPool.js └── util │ ├── DbgPannel.js │ ├── Instance.js │ ├── ObjectPool.js │ ├── SmoothEdger.js │ ├── canvas.js │ ├── debug.js │ ├── declareClassName.js │ ├── functions.js │ └── node.funcs.js ├── iframeSaveWorld.html ├── index.html ├── jquery.js ├── jquery.json.js ├── jquery.ui ├── images │ ├── expand.png │ ├── pbar-ani.gif │ ├── ui-bg_diagonals-thick_18_b81900_40x40.png │ ├── ui-bg_diagonals-thick_20_666666_40x40.png │ ├── ui-bg_flat_10_000000_40x100.png │ ├── ui-bg_glass_100_f6f6f6_1x400.png │ ├── ui-bg_glass_100_fdf5ce_1x400.png │ ├── ui-bg_glass_65_ffffff_1x400.png │ ├── ui-bg_gloss-wave_35_f6a828_500x100.png │ ├── ui-bg_highlight-soft_100_eeeeee_1x100.png │ ├── ui-bg_highlight-soft_75_ffe45c_1x100.png │ ├── ui-icons_222222_256x240.png │ ├── ui-icons_228ef1_256x240.png │ ├── ui-icons_ef8c08_256x240.png │ ├── ui-icons_ffd27a_256x240.png │ ├── ui-icons_ffffff_256x240.png │ ├── uibtn.png │ └── uitit.jpg ├── jquery-ui-1.8.23.custom.css └── jquery-ui-1.8.23.custom.min.js ├── main.js ├── res ├── CellMembran.png ├── CloseNormal.png ├── CloseSelected.png ├── Goal.png ├── Static_poly.png ├── Stone_poly.png ├── Wood_poly.png ├── b_bg_1.png ├── b_bg_2.jpg ├── b_bgtop_1.png ├── b_qiu_1.png ├── b_wuzi_1.jpg ├── b_wuzi_2.jpg ├── b_wuzi_3.jpg ├── b_wuzi_4.jpg ├── background │ └── bg.png ├── bg200x300.png ├── bg300x200.png ├── btn-back-1.png ├── btn-back.png ├── btn-composition-light.png ├── btn-composition-selected.png ├── btn-composition.png ├── btn-main-1.png ├── btn-main.png ├── btn-no-1.png ├── btn-no.png ├── btn-pause-1.png ├── btn-pause.png ├── btn-sound-off.png ├── btn-sound-on.png ├── btn-yes-1.png ├── btn-yes.png ├── building │ ├── Bullet.png │ ├── addbuild.plist │ ├── addbuild.png │ ├── bottles-l.png │ ├── bottles-nm.png │ ├── bottles.png │ ├── build.plist │ ├── build.png │ ├── cannon-l.png │ ├── cannon-nm.png │ ├── cannon.png │ ├── dec_bg.png │ ├── eye-l.png │ ├── eye-nm.png │ ├── eye.png │ ├── factory.plist │ ├── factory.png │ ├── grow-l.png │ ├── grow-nm.png │ ├── grow.png │ ├── jetter-l.png │ ├── jetter-nm.png │ ├── jetter.png │ ├── oshooter-l.png │ ├── oshooter-nm.png │ ├── oshooter.png │ ├── power-l.png │ ├── power-nm.png │ ├── power.png │ ├── recycle-l.png │ ├── recycle-nm.png │ ├── recycle.png │ ├── remove.png │ ├── rocket-l.png │ ├── rocket-nm.png │ ├── rocket.png │ ├── shooter-l.png │ ├── shooter-nm.png │ ├── shooter.png │ ├── slower-l.png │ ├── slower-nm.png │ ├── slower.png │ ├── tower.plist │ ├── tower.png │ └── up_1.png ├── cellshell.png ├── cocos20.png ├── cocos64.png ├── dashboard │ ├── HP_bg.png │ ├── HP_hp.png │ ├── HP_hp_bg.png │ └── dashboard_bg.png ├── deselect-1.png ├── deselect.png ├── dna-icons-16.png ├── dna-icons-32.png ├── fire.png ├── level-flag-flash.png ├── level-flag-gr.png ├── level-flag-normal.png ├── logo.png ├── mainscene │ ├── background.jpg │ ├── cocos.png │ ├── electricity.png │ ├── freeworld.png │ ├── freeworld1.png │ ├── jindutiao_bg.png │ ├── lb.png │ ├── line.png │ ├── login_bg.png │ ├── logo.png │ ├── pao.png │ ├── sina.png │ ├── sina1.png │ ├── story.png │ ├── story1.png │ ├── test.png │ ├── test1.png │ ├── world.png │ └── world1.png ├── map-c1.png ├── menu │ ├── btn.png │ ├── btn2.png │ ├── but.png │ ├── dot.png │ ├── mid.png │ └── top.png ├── null-pinup.png ├── null.png ├── organ │ ├── Bullet.png │ ├── Msg.png │ └── Tower.png ├── pin_map.png ├── role │ ├── boss.plist │ ├── boss.png │ ├── role.plist │ ├── role.png │ ├── virus.plist │ └── virus.png ├── skill.png ├── skill │ ├── bottles.png │ ├── outsideShooter.png │ └── rocket.png ├── skillbj.png ├── smoke.plist ├── smoke.png ├── sound │ ├── Attack01.ogg │ ├── Beam01.ogg │ ├── Bom01.ogg │ ├── Elec01.ogg │ ├── Fire05.ogg │ ├── Hit08.ogg │ ├── WarpOut.ogg │ ├── Water02.ogg │ ├── Wind06.ogg │ ├── catch.mp3 │ └── music │ │ ├── Arrivee-distante.mp3 │ │ ├── Confiant.mp3 │ │ ├── Desert.mp3 │ │ ├── Hors-du-grenier.mp3 │ │ ├── Parmi-les-automates.mp3 │ │ └── bardo.mp3 ├── star2.png ├── star3.png ├── victory.png ├── weibo_login.png ├── xibaohecheng.plist └── xibaohecheng.png ├── src └── NativeClient.js ├── style.css └── users.js /.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | .settings 3 | .buildpath 4 | cocos2d 5 | lib 6 | .tags 7 | .tags_sorted_by_file 8 | .Trash-1000/ 9 | service 10 | untitled.sublime-workspace 11 | untitled.sublime-project 12 | Thumbs.db 13 | Thumbs.db* 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 《我,细胞》 2 | 3 | 《我,细胞》是一个以微生物环境为故事背景的 物理解密+塔防 类型游戏。 4 | 5 | 你会在游戏中扮演显微镜下的一个单细胞生物。你可以控制细胞的移动探索微观世界,搜集氨基酸,躲避或迎击病毒群。 6 | 7 | 当玩家滚动鼠标滚轮时(或触摸屏幕上的手势),显微镜的观察倍数就会放大,细胞的体内场景逐渐显示出来。你必须在为细胞建造各种器官来提升细胞的能力,以及防御进入到细胞得病毒。 8 | 9 | 细胞的体内场景就是一个经典的自由布局塔防。 10 | 11 | 击杀每一关的Boss后,细胞会随机生长,因此你无法完全控制细胞的自然形状。完美击杀Boss会获得DNA奖励,用以细胞的生长和器官的解锁、升级。 12 | 13 | 《我,细胞》还提供了一个功能完善的关卡编辑器,由玩家来自由编辑关卡。 14 | 15 | 游戏地址:http://games.jecat.cn/icell 16 | -------------------------------------------------------------------------------- /bin/Demo.js: -------------------------------------------------------------------------------- 1 | var Helloworld = cc.Layer.extend({ 2 | isMouseDown:false, 3 | helloImg:null, 4 | helloLb:null, 5 | circle:null, 6 | sprite:null, 7 | 8 | init:function () { 9 | 10 | var selfPointer = this; 11 | ////////////////////////////// 12 | // 1. super init first 13 | this._super(); 14 | 15 | var size = cc.Director.getInstance().getWinSize(); 16 | 17 | //this.helloLb = cc.LabelTTF.create("Hello World", "Arial", 24); 18 | // position the label on the center of the screen 19 | //this.helloLb.setPosition(cc.p(cc.Director.getInstance().getWinSize().width / 2, 0)); 20 | // add the label as a child to this layer 21 | //this.addChild(this.helloLb, 5); 22 | 23 | // add "HelloWorld" splash screen" 24 | this.sprite = new yc.outer.Cell(); 25 | this.addChild(this.sprite, 0); 26 | 27 | 28 | 29 | var actionTo = cc.SkewTo.create(5, 0., 45); 30 | var actionToBack = cc.SkewTo.create(5, 0, 0); 31 | var rotateTo = cc.RotateTo.create(5, 300.0); 32 | var rotateToBack = cc.RotateTo.create(5, 0); 33 | var actionScaleTo = cc.ScaleTo.create(5, -0.44, 0.47); 34 | var actionScaleToBack = cc.ScaleTo.create(5, 1.0, 1.0); 35 | var actionBy = cc.MoveBy.create(5, cc.p(80, 80)); 36 | var actionByBack = actionBy.reverse(); 37 | 38 | //this.sprite.runAction(cc.Sequence.create(rotateToA, scaleToA)); 39 | 40 | 41 | this.sprite.runAction(cc.Sequence.create(actionTo, actionToBack, null)); 42 | this.sprite.runAction(cc.Sequence.create(rotateTo, rotateToBack, null)); 43 | this.sprite.runAction(cc.Sequence.create(actionScaleTo, actionScaleToBack)); 44 | this.sprite.runAction(cc.Sequence.create(actionBy, actionByBack)); 45 | 46 | 47 | this.setTouchEnabled(true); 48 | 49 | 50 | var closeItem = cc.MenuItemImage.create( 51 | "res/CloseNormal.png", 52 | "res/CloseSelected.png", 53 | this, 54 | this.menuCloseCallback); 55 | var text = cc.MenuItemFont.create("Hello Dom", this, function () { 56 | log('hi') ; 57 | }); 58 | text.setColor({r:255, g:0, b:0}); 59 | text.setPosition(cc.p(cc.canvas.width / 2, cc.canvas.height / 2)); 60 | closeItem.setPosition(cc.p(cc.canvas.width - 20, 20)); 61 | var menu = cc.Menu.create(closeItem, text); 62 | menu.setPosition(cc.p(0, 0)); 63 | this.sprite.addChild(menu); 64 | //cc.fullscreen(); 65 | 66 | cc.DOM.convert(this.sprite, closeItem, text); 67 | return true; 68 | }, 69 | // a selector callback 70 | menuCloseCallback:function (sender) { 71 | history.go(-1); 72 | } 73 | 74 | }); 75 | var HelloWorldScene = cc.Scene.extend({ 76 | onEnter:function () { 77 | this._super(); 78 | var layer = new Helloworld(); 79 | layer.init(); 80 | this.addChild(layer); 81 | } 82 | }); 83 | 84 | 85 | -------------------------------------------------------------------------------- /bin/GameLayer.js: -------------------------------------------------------------------------------- 1 | yc.GameLayer = cc.Layer.extend({ 2 | 3 | ctor: function(){ 4 | 5 | this._super() ; 6 | 7 | this.actFadeCellInner = null ; 8 | this.actFadeCellOuterSkin = null ; 9 | this.actFadeCellOuterBuildings = null ; 10 | 11 | } 12 | 13 | , onEnter: function(){ 14 | this._super() ; 15 | 16 | // resize 事件 17 | yc.event.register(ins(yc.outer.Camera),"resize",this.onResize,this) ; 18 | var wsize = cc.Director.getInstance().getWinSize() ; 19 | this.onResize(wsize.width,wsize.height) ; 20 | 21 | // 初始动画:缩放 22 | if(g_architecture=='native') 23 | { 24 | this.actScale = cc.ScaleBy.create(1,0.1) ; 25 | } 26 | else 27 | { 28 | this.actScale = cc.ScaleBy.create(1,yc.settings.camera.firstZoom) ; 29 | } 30 | 31 | this.runAction(this.actScale) ; 32 | } 33 | 34 | , onExit: function(){ 35 | this._super() ; 36 | 37 | // 移除resize事件 38 | yc.event.unregister( ins(yc.outer.Camera), "resize", this.onResize ) ; 39 | } 40 | 41 | , onResize: function(w,h){ 42 | //this.setPosition(cc.p(0,0)) ; 43 | this.setPosition(cc.p(w/2,h/2)) ; 44 | } 45 | 46 | , setScale: function(scalex,scaley){ 47 | 48 | var outerCell = ins(yc.outer.Cell) ; 49 | 50 | // 高于 显示内部视图的缩放比例 51 | if( yc.settings.camera.switchZoomthis.getScale() ) 52 | { 53 | // log('显示') ; 54 | // 显示内部视图 55 | if(this.actFadeCellInner) 56 | { 57 | outerCell.layerInner.stopAction(this.actFadeCellInner) ; 58 | } 59 | this.actFadeCellInner = cc.FadeIn.create(0.5) ; 60 | outerCell.layerInner.runAction(this.actFadeCellInner) ; 61 | 62 | // 细胞外壳消失 63 | if(this.actFadeCellOuterSkin) 64 | { 65 | outerCell.shell.skin.stopAction(this.actFadeCellOuterSkin) ; 66 | } 67 | this.actFadeCellOuterSkin = cc.FadeTo.create(0.5,0) ; 68 | outerCell.shell.skin.runAction(this.actFadeCellOuterSkin) ; 69 | 70 | // 外部器官半透明 71 | if( this.actFadeCellOuterBuildings ){ 72 | outerCell.shell.buildings.stopAction(this.actFadeCellOuterBuildings) ; 73 | } 74 | this.actFadeCellOuterBuildings = cc.FadeTo.create(0.5,yc.settings.camera.outerBuildingOpacityLow); 75 | outerCell.shell.buildings.runAction( this.actFadeCellOuterBuildings ); 76 | } 77 | 78 | // 低于 显示内部视图的缩放比例 79 | else if( yc.settings.camera.switchZoom>scalex && yc.settings.camera.switchZoom=1) 32 | { 33 | this.got ++ ; 34 | this.cbFunc.apply(this.cbOb,this.cbArgvs) ; 35 | this._firstTick = true ; 36 | } 37 | return true ; 38 | }, 39 | 40 | isDone: function(){ 41 | return this.times == this.got ; 42 | }, 43 | 44 | /** 45 | * MoveTo reverse is not implemented 46 | */ 47 | reverse:function () { 48 | cc.Assert(0, "moveto reverse is not implemented"); 49 | } 50 | }); 51 | 52 | yc.actions.Timer.create = function (sec, times, cbOb, cbFunc, cbArgvs) { 53 | var timer = new yc.actions.Timer(); 54 | timer.initWithCallback(sec, times, cbOb, cbFunc, cbArgvs); 55 | return timer ; 56 | }; 57 | -------------------------------------------------------------------------------- /bin/dna/DNA.js: -------------------------------------------------------------------------------- 1 | yc.dna.DNA = function(){ 2 | 3 | this.genes = {} 4 | 5 | this.obtainGene = function(gene){ 6 | 7 | // 生效 8 | gene.takeEffect() ; 9 | 10 | if( typeof(this.genes[gene.name])=='undefined' ) 11 | { 12 | this.genes[gene.name] = gene ; 13 | } 14 | } 15 | } 16 | yc.dna.DNA.singleton = true ; 17 | // yc.dna.DNA.className = 'yc.dna.DNA' ; 18 | -------------------------------------------------------------------------------- /bin/dna/Gene.js: -------------------------------------------------------------------------------- 1 | yc.dna.Gene = function(opts){ 2 | 3 | for(var attr in opts) 4 | { 5 | this[attr] = opts[attr] ; 6 | } 7 | 8 | // 叠加 9 | this.superimposing = 0 ; 10 | 11 | this.takeEffect = function(){ 12 | 13 | this.superimposing ++ ; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /bin/dna/GeneBuildingUpgrader.js: -------------------------------------------------------------------------------- 1 | yc.dna.GeneBuildingUpgrader = function(opts){ 2 | 3 | for(var attr in opts) 4 | { 5 | this[attr] = opts[attr] ; 6 | } 7 | 8 | // 叠加 9 | this.superimposing = 0 ; 10 | 11 | this.takeEffect = function(){ 12 | 13 | this.superimposing ++ ; 14 | 15 | this.upgrader.maxLv ++ ; 16 | 17 | // 为建筑注册 upgrader 18 | for(var i=0; i=0; i-- ){ 35 | if( object.__mapEventHandlesByName[name][i].fn === fn ) 36 | { 37 | // 移除事件响应函数 38 | object.__mapEventHandlesByName[name].splice(i,1) ; 39 | } 40 | } 41 | } 42 | 43 | /** 44 | * handle = function(){} 45 | * handle = { fn: function(){}, args:[1,2,3] } 46 | */ 47 | yc.event.trigger = function(object,name,inArgs){ 48 | 49 | if( !('__mapEventHandlesByName' in object) ) 50 | { 51 | return ; 52 | } 53 | 54 | if( !(name in object.__mapEventHandlesByName) ) 55 | { 56 | return ; 57 | } 58 | 59 | for( var i=0; i=0 && neighborInfo.step<=nextStep ) 105 | { 106 | continue ; 107 | } 108 | 109 | neighborInfo.step = nextStep ; 110 | neighborInfo.way = this.orientationMapping[way] ; 111 | 112 | //log('HexgonAxesPathMap::_processHexgon() hexgon ('+neighbor.x+','+neighbor.y+') step:'+nextStep+' way:'+neighborInfo.way) ; 113 | 114 | nextHexgons.push(neighbor) ; 115 | } 116 | 117 | 118 | // 邻接格都设置完毕以后,再递归下去 119 | for(var i=0;i dis ) 35 | { 36 | virus.hit(tower.injure) ; 37 | bHited = true ; // 一颗子弹只命中一个敌人 38 | } 39 | 40 | // 溅射伤害(群体) 41 | if( virus.using && virus.radius+tower.sputtering > dis ) 42 | { 43 | virus.hit(tower.sputtering_injure) ; 44 | 45 | // 减速效果 46 | if( virus.using && tower.retardment && tower.retardment_duration ) 47 | { 48 | // 减速 49 | virus.speed = virus.normalSpeed*(1-tower.retardment) ; 50 | 51 | // 改变移动中的目标的前进速度 52 | if(virus.actRunning) 53 | { 54 | virus.actRunning.initWithSpeed(virus.speed) ; 55 | } 56 | 57 | // 恢复正常速度 action 58 | if( virus.actResumeSpeed ) 59 | { 60 | virus.stopAction(virus.actResumeSpeed) ; 61 | } 62 | virus.actResumeSpeed = yc.actions.Timer.create(tower.retardment_duration,1,null,function(virus){ 63 | if(virus.using) 64 | { 65 | // 恢复正常速度 66 | virus.speed = virus.normalSpeed ; 67 | virus.actRunning.initWithSpeed(virus.speed) ; 68 | } 69 | },[virus] 70 | ) ; 71 | virus.runAction(virus.actResumeSpeed) ; 72 | } 73 | } 74 | 75 | } 76 | 77 | // 回收对象 78 | bullet._parent.removeChild(bullet) ; 79 | yc.op.ins(yc.inner.building.Bullet).free(bullet) ; 80 | } 81 | 82 | this.runAction(action) ; 83 | } 84 | 85 | , draw: function(ctx){ 86 | if(g_architecture=='native') 87 | { 88 | this._super() ; 89 | return ; 90 | } 91 | 92 | 93 | ctx.fillStyle = "rgb(50,50,50)" ; 94 | 95 | ctx.beginPath() ; 96 | ctx.moveTo(0+1,0) ; 97 | ctx.arc(0,0, 1, 0, Math.PI*2 , false) ; 98 | ctx.closePath() ; 99 | 100 | ctx.fill() ; 101 | ctx.stroke() ; 102 | } 103 | 104 | }) ; 105 | yc.inner.building.Bullet.className = 'yc.inner.building.Bullet' ; 106 | 107 | yc.inner.building.Bullet.create = function(){ 108 | 109 | var bullet = yc.op.ins(yc.inner.building.Bullet).ob() ; 110 | ins(yc.inner.InnerLayer).buildings.addChild(bullet) ; 111 | bullet.setVisible(false) ; 112 | 113 | return bullet ; 114 | } 115 | 116 | yc.inner.building.Bullet.Flame = cc.Sprite.extend({ 117 | 118 | ctor: function(){ 119 | 120 | // 执行动画 121 | this.initWithSpriteFrameName("explosion_air_0001.png"); 122 | this.animationAction = yc.animations.createAction("towers.shooter.bulletflame") ; 123 | } 124 | 125 | , init: function(range,bullet){ 126 | 127 | this.range = range ; 128 | bullet._parent.addChild(this) ; 129 | var p = bullet.getPosition() ; 130 | this.setPosition(cc.p(p.x,p.y)) ; 131 | 132 | 133 | // 目前使用贴图比较大,使用一半的尺寸 134 | this.setScale(0.5) ; 135 | // this.setScale(0.1) ; 136 | 137 | // var seq = cc.Sequence.create([ 138 | // cc.Spawn.create( 139 | // cc.ScaleTo.create(0.15, 1, 1) 140 | // , cc.FadeOut.create(0.15) 141 | // ) 142 | // , cc.CallFunc.create(this,this.free) 143 | // ]) ; 144 | // this.runAction(seq) ; 145 | 146 | 147 | var seq = cc.Sequence.create([ 148 | this.animationAction 149 | , cc.CallFunc.create(this.free,this) 150 | ]) ; 151 | this.runAction(seq) ; 152 | } 153 | // , draw: function(ctx){ 154 | 155 | // ctx.globalAlpha = this._opacity/255; 156 | // ctx.fillStyle = "rgba(255,255,255,0.5)" ; 157 | 158 | // ctx.beginPath() ; 159 | // ctx.moveTo(0+this.range,0) ; 160 | // ctx.arc(0,0, this.range, 0, Math.PI*2 , false) ; 161 | // ctx.closePath() ; 162 | 163 | // ctx.fill() ; 164 | // } 165 | , free: function(){ 166 | this.removeFromParent(true) ; 167 | yc.util.ObjectPool.ins(yc.inner.building.Bullet.Flame).free(this) ; 168 | } 169 | }); 170 | -------------------------------------------------------------------------------- /bin/inner/building/PlastosomePower.js: -------------------------------------------------------------------------------- 1 | yc.inner.building.PlastosomePower = yc.inner.building.Building.extend({ 2 | 3 | ctor: function(){ 4 | 5 | this._super() ; 6 | 7 | this.increase = 1.2 ; 8 | 9 | // 开始动画 10 | this.initWithSpriteFrame(yc.animations.firstFrame("towers.shooter") ); //第一帧 11 | this.runAction(cc.RepeatForever.create( yc.animations.createAction('towers.shooter') )); 12 | 13 | this.setAnchorPoint(cc.p(0.5,0.2)) ; 14 | } 15 | 16 | , put: function(hexgon){ 17 | 18 | this._super(hexgon) 19 | 20 | yc.event.register( ins(yc.outer.Cell), "calculatePower", this.calculatePower, this ) ; 21 | ins(yc.outer.Cell).calculatePower() ; 22 | } 23 | 24 | , calculatePower: function(cell){ 25 | cell.power*= this.increase ; 26 | } 27 | 28 | }) ; -------------------------------------------------------------------------------- /bin/inner/building/ProteinFactory.js: -------------------------------------------------------------------------------- 1 | yc.inner.building.ProteinFactory = yc.inner.building.Building.extend({ 2 | // 3 | composition_progress: 0 4 | 5 | , working_formula: null 6 | 7 | // 合成效率,每秒合成 5 个氨基酸 8 | , composition_efficient: 5 9 | 10 | , ctor: function(){ 11 | this._super() ; 12 | 13 | this.timeout = null ; 14 | 15 | // 执行动画 16 | this.runAction(cc.RepeatForever.create( 17 | yc.animations.createAction('towers.mage_lvl1') 18 | )); 19 | 20 | this.setAnchorPoint(cc.p(0.5,0.4)) ; 21 | } 22 | 23 | , put: function(hexgon){ 24 | 25 | this._super(hexgon) 26 | 27 | // 开始合成 28 | this.startComposite() ; 29 | 30 | return yc.inner.building.Tower ; 31 | } 32 | 33 | , startComposite: function(){ 34 | 35 | // 停止 36 | if( this.bStop ) 37 | { 38 | return ; 39 | } 40 | 41 | var factory = this ; 42 | 43 | 44 | var loopStart = this.working_formula? this.working_formula: ins(yc.user.ProteinFormulas).last ; 45 | if(!loopStart) 46 | { 47 | return ; 48 | } 49 | 50 | var formula = loopStart ; 51 | this.working_formula = null ; 52 | 53 | do{ 54 | var formula = formula.next ; 55 | 56 | // 检查状态 57 | if(formula.status!='compositing') 58 | { 59 | continue ; 60 | } 61 | 62 | // 检查氨基酸 63 | if(!this.checkingMaterials(formula)) 64 | { 65 | // formula.ui.find('.formula-msg').text('原料不足').show() ; 66 | continue ; 67 | } 68 | else 69 | { 70 | // formula.ui.find('.formula-msg').text('暂停').hide() ; 71 | } 72 | 73 | this.working_formula = formula ; 74 | break ; 75 | 76 | }while(formula!==loopStart) ; 77 | 78 | if(!this.working_formula) 79 | { 80 | this.runAction( yc.actions.Timer.create(1, 1, factory, factory.startComposite) ) ; 81 | return ; 82 | } 83 | 84 | // 开始合成过程 85 | // var freq = Math.round( 1 * (this.working_formula.total / this.composition_efficient) / 10) ; 86 | var freq = Math.round( 1000 * (this.working_formula.total / this.composition_efficient) / 10) ; 87 | 88 | this.composition_progress = 0 ; 89 | // this.working_formula.ui.find('.protein-composite-progress').show().progressbar({value:0}) ; 90 | // this.working_formula.status = 'compositing' ; 91 | 92 | // 禁用暂停按钮 93 | // this.working_formula.ui.find('.protein-formula-togglebtn').attr('disabled',true) ; 94 | 95 | // 消耗氨基酸 96 | for(var key in formula.materials) 97 | { 98 | ins(yc.user.Character).aminoacids.increase(key,-formula.materials[key]) ; 99 | } 100 | 101 | var func = function(){ 102 | 103 | // 停止 104 | if( factory.bStop ) 105 | { 106 | return ; 107 | } 108 | 109 | // factory.composition_progress+= 10000 ; 110 | factory.composition_progress+= 10 ; 111 | // factory.working_formula.ui.find('.protein-composite-progress').show().progressbar({value:factory.composition_progress}) ; 112 | 113 | // 114 | if( factory.composition_progress<100 ) 115 | { 116 | this.runAction( yc.actions.Timer.create(freq/1000, 1, factory, func) ) ; 117 | } 118 | 119 | // 完成 120 | else 121 | { 122 | // factory.working_formula.status = 'pause' ; 123 | // factory.working_formula.ui.find('.protein-composite-progress').hide() ; 124 | 125 | // 增加蛋白质池中的存数 126 | ins(yc.user.Character).proteins.increase(factory.working_formula.name,1) ; 127 | 128 | // 恢复暂停按钮 129 | // factory.working_formula.ui.find('.protein-formula-togglebtn').attr('disabled',false) ; 130 | 131 | // next 132 | if(factory.working_formula.status == 'compositing'){ 133 | factory.startComposite() ; 134 | } 135 | /*setTimeout(function(){ 136 | 137 | // next 138 | factory.startComposite() ; 139 | 140 | },freq) ;*/ 141 | } 142 | } 143 | 144 | this.runAction( yc.actions.Timer.create(freq/1000, 1, this, func) ) ; 145 | } 146 | 147 | , singleComposite : function(formula){ 148 | // 检查氨基酸 149 | if(!this.checkingMaterials(formula)) 150 | { 151 | // formula.ui.find('.formula-msg').text('原料不足').show() ; 152 | return; 153 | } 154 | else 155 | { 156 | // formula.ui.find('.formula-msg').text('暂停').hide() ; 157 | } 158 | 159 | // 消耗氨基酸 160 | for(var key in formula.materials) 161 | { 162 | ins(yc.user.Character).aminoacids.increase(key,-formula.materials[key]) ; 163 | } 164 | 165 | // 增加蛋白质池中的存数 166 | ins(yc.user.Character).proteins.increase(formula.name,1) ; 167 | } 168 | 169 | , checkingMaterials : function(formula){ 170 | for(var key in formula.materials) 171 | { 172 | if(ins(yc.user.Character).aminoacids[key] < formula.materials[key]) 173 | { 174 | return false ; 175 | } 176 | } 177 | return true ; 178 | } 179 | 180 | }) ; 181 | 182 | 183 | yc.inner.building.ProteinFactory.upgraders = [] ; 184 | 185 | yc.inner.building.ProteinFactory.block = true ; 186 | -------------------------------------------------------------------------------- /bin/inner/building/Recycle.js: -------------------------------------------------------------------------------- 1 | yc.inner.building.Recycle = yc.inner.building.Building.extend({ 2 | 3 | ctor: function(){ 4 | this.mitochondrias = [] ; 5 | this.mitochondriaCount = 1 ; 6 | 7 | // 开始动画 8 | this.initWithSpriteFrameName("huishou_0001.png") ; //第一帧 9 | this.runAction(cc.RepeatForever.create( yc.animations.createAction('towers.factory_huishou') )); 10 | 11 | yc.util.cloneObject(this,yc.settings.building.Shooter.base) ; 12 | } 13 | 14 | , put: function(hexgon){ 15 | this._super(hexgon) ; 16 | 17 | this.releaseMitochondrias() ; 18 | } 19 | 20 | , releaseMitochondrias: function(){ 21 | while( this.mitochondrias.length < this.mitochondriaCount ) 22 | { 23 | var entity = new yc.inner.monster.Mitochondria(this) ; 24 | ins(yc.inner.monster.VirusLayer).addChild(entity) ; 25 | this.mitochondrias.push(entity) ; 26 | 27 | entity.release(cc.p( this.hexgon.center[0], this.hexgon.center[1] )) ; 28 | } 29 | } 30 | 31 | /** 32 | * 拆除 33 | */ 34 | , demolish: function(){ 35 | this._super() ; 36 | 37 | // 回收线粒体 38 | for(var m=0;m=this._script.viruses.length ) 56 | { 57 | // 结束 58 | this.releaseOver() ; 59 | return ; 60 | } 61 | 62 | else 63 | { 64 | var virusScript = this._script.viruses[ this.releaseIndex++ ] ; 65 | this.actRelease = yc.actions.Timer.create( virusScript.wait, 1, this, function(){ 66 | 67 | var virus = this._parent.createVirusSprite() ; 68 | 69 | //same theme 70 | virusScript.spriter = this._script.spriter; 71 | 72 | virus.initWithScript(virusScript) ; 73 | virus.cluster = this.outer ; 74 | 75 | var shakeRange = yc.settings.inner.hexgonSideLength/4 ; 76 | var shakeX = shakeRange - shakeRange*2*Math.random() ; 77 | var shakeY = shakeRange - shakeRange*2*Math.random() ; 78 | // virus.setPosition(cc.p(this.stay.center[0]+shakeX,this.stay.center[1]+shakeY)) ; 79 | 80 | virus.setPosition(cc.p(this.stay.center[0]+shakeX,this.stay.center[1]+shakeY)) ; 81 | 82 | virus.run() ; 83 | 84 | // next 85 | this.release() ; 86 | 87 | } ) ; 88 | this.runAction(this.actRelease) ; 89 | } 90 | } 91 | 92 | , releaseOver: function(){ 93 | this.releasing = false ; 94 | if(this.actRelease) 95 | { 96 | this.stopAction(this.actRelease) ; 97 | this.actRelease = null ; 98 | } 99 | ins(yc.inner.monster.VirusLayer).removeChild(this) ; 100 | yc.op.ins(yc.inner.monster.VirusCluster).free(this) ; 101 | } 102 | 103 | , onExit: function(){ 104 | if(this.releasing) 105 | { 106 | this.releaseOver() ; 107 | } 108 | } 109 | }); 110 | 111 | yc.inner.monster.VirusCluster.className = 'yc.inner.monster.VirusCluster' ; 112 | 113 | yc.inner.monster.VirusCluster.create = function(enterHexgon,totalNum){ 114 | var cluster = yc.op.ins(yc.inner.monster.VirusCluster).ob() ; 115 | cluster.totalNum = typeof(totalNum)=='undefined'? 10: totalNum ; 116 | cluster.init() ; 117 | return cluster ; 118 | } 119 | -------------------------------------------------------------------------------- /bin/inner/monster/VirusLayer.js: -------------------------------------------------------------------------------- 1 | yc.inner.monster.VirusLayer = cc.Layer.extend({ 2 | 3 | ctor: function(){ 4 | this._super() ; 5 | this.arrVirus = [] ; 6 | 7 | // 在 js binding 中,需要先 add 一个 child ,才能 getChildren 8 | var c = new cc.Sprite ; 9 | this.addChild(c) ; 10 | this.removeChild(c,true) ; 11 | 12 | } 13 | 14 | /** 15 | * 创建一个病毒sprite 16 | */ 17 | , createVirusSprite: function(strength){ 18 | var virus = yc.op.ins(yc.inner.monster.Virus).ob() ; 19 | 20 | this.addChild(virus) ; 21 | this.arrVirus.push(virus) ; 22 | 23 | return virus ; 24 | } 25 | /** 26 | * 创建一个病毒sprite 27 | */ 28 | , removeVirusSprite: function(virus){ 29 | 30 | yc.util.arr.remove(this.arrVirus,virus) ; 31 | 32 | this.removeChild(virus) ; 33 | yc.op.ins(yc.inner.monster.Virus).free(virus) ; 34 | } 35 | 36 | 37 | }) ; 38 | 39 | -------------------------------------------------------------------------------- /bin/inner/organ/Bottles.js: -------------------------------------------------------------------------------- 1 | yc.inner.organ.Bottles = yc.inner.organ.Organ.extend({ 2 | ctor: function(){ 3 | this._super() ; 4 | 5 | this.addSkill( 6 | new yc.inner.skill.Bottles 7 | ); 8 | 9 | // this.initWithFile('res/organ/MoShuiPing.png'); 10 | // 开始动画 11 | this.initWithSpriteFrameName("ping_0001.png") ; //第一帧 12 | this.runAction(cc.RepeatForever.create( yc.animations.createAction('towers.ping') )); 13 | } 14 | }); 15 | -------------------------------------------------------------------------------- /bin/inner/organ/Eye.js: -------------------------------------------------------------------------------- 1 | yc.inner.organ.Eye = yc.inner.organ.Organ.extend({ 2 | ctor: function(){ 3 | this._super() ; 4 | this.range = 10 ; 5 | 6 | //开始动画 7 | this.initWithSpriteFrame(yc.animations.firstFrame("towers.yan")) ; //第一帧 8 | this.runAction(cc.RepeatForever.create( yc.animations.createAction('towers.yan') )); 9 | 10 | } 11 | }); 12 | -------------------------------------------------------------------------------- /bin/inner/organ/Organ.js: -------------------------------------------------------------------------------- 1 | yc.inner.organ.Organ = yc.inner.building.Building.extend({ 2 | 3 | ctor: function(){ 4 | 5 | this._super() ; 6 | 7 | this.bBlock = false ; 8 | this.layer = "shell" ; 9 | 10 | return ; 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /bin/inner/organ/Tower.js: -------------------------------------------------------------------------------- 1 | yc.inner.organ.Tower = yc.inner.organ.Organ.extend({ 2 | ctor: function(){ 3 | this._super() ; 4 | 5 | this.addSkill( 6 | new yc.inner.skill.OutsideShooter 7 | ); 8 | 9 | //开始动画 10 | this.initWithSpriteFrame(yc.animations.firstFrame("towers.daodan")) ; //第一帧 11 | this.runAction(cc.RepeatForever.create( yc.animations.createAction('towers.daodan') )); 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /bin/inner/skill/Bottles.js: -------------------------------------------------------------------------------- 1 | yc.inner.skill.Bottles = yc.inner.skill.SkillBase.extend({ 2 | ctor : function(){ 3 | this._super(); 4 | 5 | this.setName( 'Bottles' ); 6 | this.setIcon( 'res/skill/bottles.png' ); 7 | 8 | this.sound = "Water02.ogg"; 9 | 10 | } 11 | , start: function(){ 12 | 13 | 14 | var worldName = prompt('留下您的心情!'); 15 | 16 | if(!worldName){ 17 | alert("不能为空!") 18 | return false; 19 | } 20 | 21 | if(yc.ui.font.Font.len(worldName) > 90){ 22 | alert("内容过长!") 23 | return false; 24 | } 25 | 26 | 27 | var cellPosition = ins(yc.outer.Cell); 28 | var user = unEncryptUserInfo(icell_userInfo); 29 | 30 | $.ajax({ 31 | type: "POST", 32 | url: "http://games.jecat.cn/service/bottles.php", 33 | jsonp:'jsonp_callback', 34 | data: { 35 | "act":"create", 36 | "uid":user.uid, 37 | "service":user.service, 38 | //"face":"", 39 | "x":cellPosition.x, 40 | "y":cellPosition.y, 41 | "content":worldName, 42 | "level":yc.GameScene._level 43 | }, 44 | dataType: 'jsonp', 45 | success: function(json){ 46 | 47 | var bottles = new yc.outer.Bottles ; 48 | bottles.id = json.last_id; 49 | bottles.create(); 50 | 51 | var scene = cc.Director.getInstance().getRunningScene() ; 52 | 53 | var bottlesLayer = ins(yc.outer.Bottles.bottlesLayer); 54 | scene.layerRoles.addChild(bottlesLayer) ; 55 | bottlesLayer.addChild(bottles); 56 | 57 | //console.log(cellPosition); 58 | bottles.setPosition( cc.p(cellPosition.x ,cellPosition.y)) ; 59 | 60 | 61 | // 同步微薄 62 | if( user.uid != "0"){ 63 | 64 | worldName += " 来自于:icell(我,细胞) http://games.jecat.cn/icell/"; 65 | 66 | ins(yc.oauth.weibo).publish(worldName); 67 | } 68 | 69 | } 70 | }); 71 | 72 | this._super(); 73 | } 74 | 75 | }) 76 | -------------------------------------------------------------------------------- /bin/inner/skill/Bullet.js: -------------------------------------------------------------------------------- 1 | yc.inner.skill.Bullet = cc.Sprite.extend({ 2 | ctor: function(){ 3 | this._super(); 4 | 5 | this.sound = "Wind06.ogg"; 6 | 7 | this._fromPosition = cc.p(0,0); 8 | this._targetPosition = cc.p(0,0); 9 | var _speed = 500; 10 | var _injure = 10;// 伤害 11 | var _injure_radius = 20;// 伤害半径 12 | 13 | this.setFromPosition=function(p){ 14 | this._fromPosition = p; 15 | } 16 | this.fromPosition=function(p){ 17 | return this._fromPosition; 18 | } 19 | this.setTargetPosition = function(p){ 20 | this._targetPosition = p; 21 | } 22 | this.setSpeed=function(s){ 23 | _speed = s; 24 | } 25 | this.speed=function(){ 26 | return _speed; 27 | } 28 | this.setInjure = function(i){ 29 | _injure = i; 30 | } 31 | this.injure = function(){ 32 | return _injure; 33 | } 34 | this.setInjureRadius = function(r){ 35 | _injure_radius = r; 36 | } 37 | this.injure_radius = function(){ 38 | return _injure_radius; 39 | } 40 | } 41 | , run: function(){ 42 | var from = this._fromPosition; 43 | this.setPosition(from); 44 | 45 | var target = this._targetPosition; 46 | var dis = yc.util.pointsDis( 47 | from.x, 48 | from.y, 49 | target.x, 50 | target.y 51 | ); 52 | var time = dis/this.speed() ; 53 | 54 | var action = cc.MoveTo.create(time,target) ; 55 | var bullet = this; 56 | action._stop = action.stop; 57 | action.stop = function(){ 58 | this._stop(); 59 | bullet.bomb() ; 60 | // 回收对象 61 | bullet._parent.removeChild(bullet) ; 62 | yc.op.ins(yc.inner.skill.Bullet).free(bullet) ; 63 | } 64 | this.runAction(action); 65 | } 66 | , draw: function(ctx){ 67 | if(g_architecture=='native') 68 | { 69 | this._super() ; 70 | return ; 71 | } 72 | 73 | this._super(ctx); 74 | var radius = 5; 75 | ctx.fillStyle = "rgba(0,255,0,1)" ; 76 | ctx.beginPath() ; 77 | ctx.moveTo(radius,0) ; 78 | ctx.arc(0,0, radius, 0, Math.PI*2 , false) ; 79 | ctx.closePath(); 80 | ctx.fill() ; 81 | } 82 | // 子弹到达目标是发生爆炸 83 | , bomb: function(){ 84 | var i; 85 | var virusClusterList = yc.outer.VirusCluster.instances ; 86 | var from = this.getPosition() ; 87 | for(i in virusClusterList){ 88 | var virusCluster = virusClusterList[i]; 89 | var vPos = cc.p( virusCluster.x , virusCluster.y ); 90 | var dist = yc.util.pointsDis( 91 | from.x, 92 | from.y, 93 | vPos.x, 94 | vPos.y 95 | ); 96 | if( dist < this.injure_radius() ){ 97 | virusCluster.hit( this.injure() ); 98 | } 99 | } 100 | } 101 | //, transform: yc.outer.Camera.transformSprite 102 | }); 103 | -------------------------------------------------------------------------------- /bin/inner/skill/OutsideShooter.js: -------------------------------------------------------------------------------- 1 | yc.inner.skill.OutsideShooter = yc.inner.skill.SkillBase.extend({ 2 | ctor : function(){ 3 | this._super(); 4 | this.sound = 'WarpOut.ogg'; 5 | this.setName( 'OutsideShooter' ); 6 | this.setIcon( 'res/skill/outsideShooter.png' ); 7 | this.setCoolingTime( 5 );// 冷却时间 8 | } 9 | , start: function(){ 10 | var bullet = yc.op.ins(yc.inner.skill.Bullet).ob(); 11 | var gs = scene; 12 | gs.layerFg.addChild(bullet); 13 | 14 | // injure 15 | bullet.setInjure( 3 ); 16 | bullet.setInjureRadius( 30 ); 17 | 18 | // from 19 | var b = this.building().getParent().getParent().getParent().getPosition() ; 20 | 21 | var ptr = cc.p(b.x,b.y); 22 | bullet.setFromPosition( ptr ); 23 | 24 | // target 25 | var cvc = this.findClosestVirusCluster(bullet.fromPosition()) ; 26 | var target ; 27 | if( cvc ) { 28 | target = cc.p( cvc.x , cvc.y ); 29 | }else{ 30 | target = cc.p(-100,-100); 31 | } 32 | 33 | bullet.setTargetPosition( target ) ; 34 | bullet.run() ; 35 | 36 | this._super(); 37 | } 38 | , findClosestVirusCluster: function(from){ 39 | var i; 40 | var virusClusterList = yc.outer.VirusCluster.instances ; 41 | 42 | var minDist = 100000; 43 | var minV = null; 44 | for(i in virusClusterList){ 45 | var virusCluster = virusClusterList[i]; 46 | var vPos = cc.p( virusCluster.x , virusCluster.y ); 47 | var dist = yc.util.pointsDis( 48 | from.x, 49 | from.y, 50 | vPos.x, 51 | vPos.y 52 | ); 53 | if( dist < minDist ){ 54 | minDist = dist ; 55 | minV = virusCluster ; 56 | } 57 | } 58 | return minV; 59 | } 60 | }) 61 | -------------------------------------------------------------------------------- /bin/inner/skill/SkillBase.js: -------------------------------------------------------------------------------- 1 | yc.inner.skill.SkillBase = cc.Node.extend({ 2 | ctor: function(){ 3 | var _name = 'noname'; 4 | var _icon = 'noname'; 5 | var _title = '无标题'; 6 | var _coolingTime = 30;// 冷却时间,单位是秒 7 | var _building = null; 8 | var _lastHappenTime = 0 ; 9 | this.target = this ; 10 | 11 | this.name=function(){ 12 | return _name; 13 | } 14 | this.setName=function(n){ 15 | _name = n; 16 | } 17 | this.icon=function(){ 18 | return this._icon; 19 | } 20 | this.setIcon=function(n){ 21 | this._icon = n; 22 | } 23 | this.setBuilding = function(b){ 24 | _building = b; 25 | } 26 | this.building = function(){ 27 | return _building ; 28 | } 29 | this.coolingTime = function(){ 30 | return _coolingTime ; 31 | } 32 | this.setCoolingTime = function(t){ 33 | _coolingTime = t ; 34 | } 35 | 36 | // 剩余冷却时间,为0时可以释放此技能 37 | this.leftCoolingTime = function(){ 38 | var leftCoolingTime; 39 | var timestamp = (new Date()).valueOf(); 40 | 41 | leftCoolingTime = _coolingTime*1000 - timestamp + _lastHappenTime; 42 | if( leftCoolingTime <= 0 ){ 43 | leftCoolingTime = 0; 44 | } 45 | return leftCoolingTime/1000.0; 46 | } 47 | this.fillCoolingTime = function(){ 48 | var timestamp = (new Date()).valueOf(); 49 | _lastHappenTime = timestamp; 50 | } 51 | } 52 | , start: function(){ 53 | this.fillCoolingTime(); 54 | this.skillSound(); 55 | } 56 | , skillSound: function(){ 57 | if(this.sound && !yc.settings.MUTE){ 58 | cc.AudioEngine.getInstance().playEffect( "res/sound/" + this.sound); 59 | } 60 | } 61 | , canStart: function(){ 62 | return this.leftCoolingTime() <= 0; 63 | } 64 | }); 65 | -------------------------------------------------------------------------------- /bin/levels/FreeWorld.js: -------------------------------------------------------------------------------- 1 | yc.levels.FreeWorld = yc.GameScene.extend({ 2 | 3 | onEnter: function(){ 4 | 5 | this.lft = -800 ; 6 | this.rgt = 6000 ; 7 | this.top = 1500 ; 8 | this.btm = -1500 ; 9 | 10 | // dna ---------------- 11 | // 定义基因 12 | yc.dna.genes = { 13 | 'tower:firepower': new yc.dna.GeneBuildingUpgrader({ 14 | name: 'tower:firepower' 15 | , title: '防御塔:火力' 16 | , description: '解锁:能够将“防御塔:火力”升级到更高等级' 17 | , upgrader: yc.inner.building.up.TowerFierpower 18 | }) 19 | , 'tower:bombing': new yc.dna.GeneBuildingUpgrader({ 20 | name: 'tower:bombing' 21 | , title: '防御塔:轰炸' 22 | , description: '解锁:能够将“防御塔:轰炸”升级到更高等级' 23 | , upgrader: yc.inner.building.up.TowerBombing 24 | }) 25 | , 'tower:retardment': new yc.dna.GeneBuildingUpgrader({ 26 | name: 'tower:retardment' 27 | , title: '防御塔:减速' 28 | , description: '解锁:能够将“防御塔:减速”效果升级到更高等级' 29 | , upgrader: yc.inner.building.up.TowerRetardment 30 | }) 31 | , 'grow': new yc.dna.Gene({ 32 | name: 'grow' 33 | , title: '生长' 34 | , description: '解锁:允许细胞扩充新的格子' 35 | }) 36 | } 37 | ins(yc.dna.DNA).obtainGene(yc.dna.genes['tower:firepower']) ; 38 | ins(yc.dna.DNA).obtainGene(yc.dna.genes['tower:firepower']) ; 39 | ins(yc.dna.DNA).obtainGene(yc.dna.genes['tower:firepower']) ; 40 | ins(yc.dna.DNA).obtainGene(yc.dna.genes['tower:firepower']) ; 41 | ins(yc.dna.DNA).obtainGene(yc.dna.genes['tower:bombing']) ; 42 | ins(yc.dna.DNA).obtainGene(yc.dna.genes['tower:bombing']) ; 43 | ins(yc.dna.DNA).obtainGene(yc.dna.genes['tower:bombing']) ; 44 | ins(yc.dna.DNA).obtainGene(yc.dna.genes['tower:bombing']) ; 45 | ins(yc.dna.DNA).obtainGene(yc.dna.genes['tower:retardment']) ; 46 | ins(yc.dna.DNA).obtainGene(yc.dna.genes['tower:retardment']) ; 47 | ins(yc.dna.DNA).obtainGene(yc.dna.genes['tower:retardment']) ; 48 | ins(yc.dna.DNA).obtainGene(yc.dna.genes['tower:retardment']) ; 49 | ins(yc.dna.DNA).obtainGene(yc.dna.genes['grow']) ; 50 | ins(yc.dna.DNA).obtainGene(yc.dna.genes['grow']) ; 51 | ins(yc.dna.DNA).obtainGene(yc.dna.genes['grow']) ; 52 | ins(yc.dna.DNA).obtainGene(yc.dna.genes['grow']) ; 53 | 54 | 55 | 56 | // --------------- 57 | // 初始化基本场景 58 | this._super() ; 59 | 60 | // 创建各种角色 61 | this.randomCreateEntities(yc.outer.VirusCluster,30,this.layerRoles) ; 62 | this.randomCreateEntities(yc.outer.AminoAcid,30,this.layerRoles) ; 63 | this.randomCreateEntities(yc.outer.Stain,30,this.layerStains) ; 64 | 65 | this._initBoss() ; 66 | 67 | 68 | this.testscript() ; 69 | } 70 | 71 | 72 | , _initBoss: function(){ 73 | 74 | // boss 指南针 75 | this.compassBoss = ins(yc.outer.BossCompass) ; 76 | this.layerUi.addChild(this.compassBoss) ; 77 | //this.compassBoss.setPosition(cc.p(100,100)) ; 78 | compass = this.compassBoss ; 79 | 80 | 81 | // boss 82 | var boss = new yc.outer.Boss(5800,200) ; 83 | boss.lv = 5 ; 84 | 85 | // boss掉落的基因 86 | boss.genes.push(yc.dna.genes['tower:firepower']) ; 87 | boss.genes.push(yc.dna.genes['tower:bombing']) ; 88 | boss.genes.push(yc.dna.genes['tower:retardment']) ; 89 | boss.genes.push(yc.dna.genes['grow']) ; 90 | 91 | this.compassBoss.arrBosses.push(boss); 92 | this.layerRoles.addChild(boss) ; 93 | 94 | } 95 | 96 | , _createRandomBoss: function(radius,lv){ 97 | var angle = Math.random() * 2*Math.PI ; 98 | 99 | var boss = new yc.outer.Boss() ; 100 | boss.lv = lv ; 101 | boss.x = radius*Math.sin(angle) ; 102 | boss.y = radius*Math.cos(angle) ; 103 | 104 | this.layerEnemies.addChild(boss) ; 105 | 106 | return boss ; 107 | } 108 | 109 | 110 | , testscript: function(){ 111 | 112 | return ; 113 | } 114 | }) ; 115 | -------------------------------------------------------------------------------- /bin/levels/ResourceLoadingScene.js: -------------------------------------------------------------------------------- 1 | yc.levels.ResourceLoadingScene = cc.Scene.extend({ 2 | 3 | 4 | ctor: function(loader){ 5 | this._super() ; 6 | 7 | this.loader = loader ; 8 | } 9 | 10 | , draw: function(ctx){ 11 | log("yc.levels.ResourceLoadingScene ") ; 12 | 13 | var percent = ( (this.loader.loadedResourceCount/this.loader.resourceCount) * 100 ).toFixed(2) ; 14 | 15 | yc.util.text(ctx,"hi, game is loading ……"+percent+"%",200,-200,"red","red") ; 16 | yc.util.text(ctx,this.loader.loadedResourceCount+", "+this.loader.resourceCount,200,-180,"red","red") ; 17 | } 18 | 19 | }) ; 20 | 21 | -------------------------------------------------------------------------------- /bin/levels/ResourcePreloader.js: -------------------------------------------------------------------------------- 1 | yc.level.ResourcePreloader = function(){ 2 | 3 | } -------------------------------------------------------------------------------- /bin/levels/c1/tutorial.js: -------------------------------------------------------------------------------- 1 | yc.levels.c1.tutorial = {"world":{"boundary":{"lft":null,"rgt":null,"top":null,"btm":null}},"player":{"x":29.31281004998002,"y":18.82153888537781,"cell":{"nucleus":{"x":0,"y":0}},"cytoplasms":[{"x":1,"y":0},{"x":1,"y":-1},{"x":0,"y":-1},{"x":-1,"y":-1},{"x":-1,"y":0},{"x":0,"y":1}],"membranes":[{"x":1,"y":1},{"x":2,"y":1},{"x":2,"y":0},{"x":1,"y":-2},{"x":2,"y":-1},{"x":0,"y":-2},{"x":-1,"y":-2},{"x":-2,"y":0},{"x":-2,"y":-1},{"x":-1,"y":1},{"x":-2,"y":1},{"x":0,"y":2}],"aminoacidpool":{"red":0,"yellow":0,"blue":0},"proteinpool":{}},"stains":[{"x":-79,"y":231,"linearDampingMultiple":2,"angularDampingMultiple":4,"bodyType":0,"shapes":[{"type":"polygon","density":0.5,"friction":1,"restitution":1,"color":"150,150,150","borderColor":"80,80,80","points":[[-88,52],[-88,-51],[88,-51],[88,52]],"text":null,"textStyle":"normal 16px san-serif","textColor":"0,0,0,1"}]}],"aminoacids":[],"virusclusters":[],"pinups":[{"layer":"foreground","x":0,"y":0,"anchorX":0.5,"anchorY":0.5,"rotation":0,"opacity":255,"scaleX":1,"scaleY":1,"img":"res/null-pinup.png","text":null,"textStyle":"normal 16px san-serif","textColor":"0,0,0,1"},{"layer":"background","x":"100","y":"100","anchorX":"0.5","anchorY":"0.5","rotation":"0","opacity":"255","scaleX":"1","scaleY":"1","img":"res/null-pinup.png","text":"","textStyle":"normal 16px san-serif","textColor":"0,0,0,1"}]} ; -------------------------------------------------------------------------------- /bin/outer/AminoAcid.js: -------------------------------------------------------------------------------- 1 | /*** 氨基酸 ***/ 2 | yc.outer.AminoAcid = yc.outer.PhysicalEntity.extend({ 3 | 4 | ctor: function(){ 5 | this._super() ; 6 | 7 | this.turnRate = yc.settings.outer.aminoacid.turnRate ; 8 | this.normalSpeed = yc.settings.outer.aminoacid.normalSpeed ; 9 | this.id = this.constructor.assigned ++ ; 10 | 11 | } 12 | 13 | , initRandom: function(range){ 14 | this.initWithScript({ 15 | x: range.left+(0|(Math.random()*range.width)) 16 | , y: range.bottom+(0|(Math.random()*range.height)) 17 | 18 | , num: Math.round(Math.random()*20) 19 | // red, blue, yellow 20 | , type: yc.user.AminoAcidPool.types[ 0|(Math.random()*(yc.user.AminoAcidPool.types.length)) ] 21 | }) ; 22 | } 23 | 24 | , init: function(){ 25 | this.size = 18 + Math.round(this.num/4) ; 26 | var colors = {red:'255,0,0',blue:'0,0,255',yellow:'255,255,0'} 27 | this.color = 'rgb(' + colors[this.type] + ')' ; 28 | 29 | if( this.type == "red"){ 30 | // 创建动画 31 | this.initWithSpriteFrame(yc.animations.firstFrame("towers.anjiR") ); //第一帧 32 | this.runAction(cc.RepeatForever.create( yc.animations.createAction('towers.anjiR') )); 33 | }else if( this.type == "blue"){ 34 | // 创建动画 35 | this.initWithSpriteFrame(yc.animations.firstFrame("towers.anjiB") ); //第一帧 36 | this.runAction(cc.RepeatForever.create( yc.animations.createAction('towers.anjiB') )); 37 | }else if( this.type == "yellow"){ 38 | // 创建动画 39 | this.initWithSpriteFrame(yc.animations.firstFrame("towers.anjiY") ); //第一帧 40 | this.runAction(cc.RepeatForever.create( yc.animations.createAction('towers.anjiY') )); 41 | } 42 | 43 | this.initWithCircle(this.size,this.x,this.y,yc.settings.outer.aminoacid.density) ; 44 | } 45 | 46 | //, transform: yc.outer.Camera.transformSprite 47 | , draw: function(ctx){ 48 | 49 | this._super(ctx ,true) ; 50 | 51 | if(g_architecture=='native') 52 | { 53 | return ; 54 | } 55 | 56 | 57 | // ctx.fillStyle = this.color ; 58 | // ctx.beginPath(); 59 | // ctx.arc(0, 0, this.size, 0, Math.PI*2, true); 60 | // ctx.closePath(); 61 | // ctx.fill(); 62 | // 63 | if(yc.settings.outer.aminoacid.dbgInfo) 64 | { 65 | this.drawDbgInfo(ctx) ; 66 | } 67 | } 68 | 69 | , update: function(dt){ 70 | 71 | var cell = ins(yc.outer.Cell) ; 72 | var dis = yc.util.pointsDis(this.x,this.y,cell.x,cell.y) ; 73 | if(!this.autoWakeup(dis)) 74 | { 75 | return ; 76 | } 77 | 78 | // 随机改变方向 79 | this.mosey(this.normalSpeed) ; 80 | 81 | 82 | this._super(dt) ; 83 | } 84 | 85 | , catchMe: function(){ 86 | ins(yc.user.Character).aminoacids.increase(this.type,this.num) ; 87 | 88 | // 解除物理特性 89 | this.unscheduleUpdate(); 90 | this._destoryBody() ; 91 | 92 | // 世界坐标->屏幕坐标 93 | var p = yc.util.clientToWindow(this.getParent(),this.x,this.y) ; 94 | this.removeFromParent() ; 95 | 96 | var scene = cc.Director.getInstance().getRunningScene() ; 97 | scene.layerUi.addChild(this) ; 98 | this.setPosition(p[0],p[1]); 99 | 100 | thisb = this; 101 | var seq = cc.Sequence.create( 102 | cc.MoveTo.create(1, cc.p(100, cc.Director.getInstance().getWinSize().height - 120)), 103 | cc.CallFunc.create(function(thisb){ 104 | thisb.destroy() ; 105 | },this) 106 | ); 107 | thisb.setScale(0.5); 108 | this.runAction(seq); 109 | 110 | if(!yc.settings.MUTE) 111 | cc.AudioEngine.getInstance().playEffect("res/sound/catch.mp3"); 112 | } 113 | 114 | }) ; 115 | 116 | 117 | yc.outer.AminoAcid.assigned = 0 ; 118 | yc.outer.AminoAcid.className = 'yc.outer.AminoAcid' ; 119 | -------------------------------------------------------------------------------- /bin/outer/Boss.js: -------------------------------------------------------------------------------- 1 | yc.outer.Boss = yc.outer.VirusCluster.extend({ 2 | 3 | lv: 30 4 | 5 | , ctor: function(x,y){ 6 | this._super() ; 7 | 8 | this.initWithPosition(x,y) ; 9 | this.initWithCircle(15,x,y,yc.settings.outer.virus.density) ; 10 | this.initWithFile('res/boss-a-48.png') ; 11 | 12 | this.draw = cc.Sprite.prototype.draw ; 13 | 14 | this.genes = [] ; 15 | } 16 | 17 | , createInnerSprite: function(hexgon){ 18 | 19 | var innerCluster = yc.inner.monster.VirusCluster.create(hexgon,1) ; 20 | var boss = this ; 21 | 22 | innerCluster.virusPrototype = { 23 | // 根据等级设置能力 24 | lv: this.lv 25 | , speed: 10 26 | , hpFull: this.lv*200 27 | , file: 'res/boss-a-24.png' 28 | 29 | // 直接杀死玩家 30 | , attack: function(){ 31 | ins(yc.inner.Cell).die() ; 32 | } 33 | 34 | // 击杀boss 35 | , bekill: function(){ 36 | ins(yc.ui.DlgRewardGene).show(boss); 37 | } 38 | } 39 | 40 | innerCluster.enterCell(hexgon) ; 41 | } 42 | 43 | , touchingCell: function(cell,fixture){ 44 | 45 | this._super(cell,fixture) ; 46 | 47 | // 从 boss 指南针中回收 48 | var compass = ins(yc.outer.BossCompass) ; 49 | yc.util.arr.remove(compass.arrBosses,this) ; 50 | } 51 | }) ; -------------------------------------------------------------------------------- /bin/outer/BossCompass.js: -------------------------------------------------------------------------------- 1 | yc.outer.BossCompass = cc.Sprite.extend({ 2 | 3 | arrBosses: [] 4 | 5 | , ctor: function(){ 6 | this._super() ; 7 | this.setAnchorPoint(cc.p(0.5,1)) ; 8 | this.setPosition(cc.p(100,100)) ; 9 | this.initWithFile('res/pin_map.png') ; 10 | } 11 | 12 | , nearestBoss: null 13 | , nearestDis: 0 14 | , bossPoint: null 15 | , bossAngle: 0 16 | 17 | , _visit: cc.Sprite.prototype.visit 18 | , visit: function(ctx){ 19 | 20 | // 计算最近的 boss 21 | var boss = this.findNearestBoss() ; 22 | if(!boss) 23 | { 24 | return ; 25 | } 26 | this.bossPoint = this.pointOnCameraBorder(boss) ; 27 | 28 | this._visit(ctx) ; 29 | } 30 | 31 | , draw: function(ctx){ 32 | 33 | if(g_architecture=='native') 34 | { 35 | this._super() ; 36 | return ; 37 | } 38 | 39 | if(this.bossPoint) 40 | { 41 | //ctx.translate(this.bossPoint[0],-this.bossPoint[1]) ; 42 | } 43 | 44 | ctx.rotate(this.bossAngle); 45 | 46 | this._super(ctx) ; 47 | 48 | //yc.util.drawPolygon( [ [20,40], [-20,40], [0,0] ], ctx, null, 'red' ) ; 49 | 50 | ctx.fillStyle = 'white' ; 51 | ctx.fillText('Lv '+this.nearestBoss.lv,-10,5) ; 52 | ctx.fillStyle = 'yellow' ; 53 | ctx.fillText('Boss '+Math.round(this.nearestDis)+' km',-40,30) ; 54 | } 55 | 56 | , findNearestBoss: function(){ 57 | 58 | var cell = ins(yc.outer.Cell) ; 59 | this.nearestDis = 0 ; 60 | this.nearestBoss = null ; 61 | 62 | for(var i=0;i0.5? -1: 1 ) ; 39 | } 40 | 41 | , mosey: function(speed){ 42 | 43 | this.speed = typeof(speed)=='undefined'? 0.5: speed ; 44 | 45 | // 返回原始点 46 | if(this.homeX!==null && this.homeY!==null && Math.random()<0.05) 47 | { 48 | var rHome = yc.util.radianBetweenPoints(this.x,this.y,this.homeX,this.homeY) ; 49 | if( this.angle > rHome ) 50 | { 51 | this.incAngle( this.angle-rHome>Math.PI?1: -1 ) ; 52 | } 53 | else 54 | { 55 | this.incAngle( rHome-this.angle>Math.PI?-1: 1 ) ; 56 | } 57 | } 58 | 59 | // 随机方向 60 | if( Math.random()<0.1 ) 61 | { 62 | this.randomTurn() ; 63 | } 64 | 65 | // 移动 66 | this.moving() ; 67 | } 68 | 69 | , accelerating: function(){ 70 | 71 | var accel = this.accel>0? 72 | this.accel*this.runDamping: 73 | this.accel ; 74 | 75 | if(accel) 76 | { 77 | var maxSpeed = this.maxSpeed*this.runDamping ; 78 | 79 | if (this.speed > maxSpeed) 80 | { 81 | this.speed-= 0.5 82 | } 83 | else 84 | { 85 | this.speed += accel ; 86 | 87 | if(this.speed > maxSpeed) 88 | { 89 | this.speed = maxSpeed ; 90 | } 91 | else if(this.speed<0) 92 | { 93 | this.speed = 0; 94 | } 95 | } 96 | } 97 | } 98 | 99 | 100 | , run: function(accel){ 101 | this.accel = typeof(accel)=='undefined'? 0.3: accel ; 102 | } 103 | , stopRun: function(){ 104 | this.accel = -0.1 ; 105 | } 106 | 107 | , setWorldPosition: function(x,y){ 108 | this.x = x ; 109 | this.y = y ; 110 | } 111 | 112 | , moving: function(){ 113 | 114 | var x = this.x + this.speed * Math.sin(this.angle); 115 | var y = this.y + this.speed * Math.cos(this.angle); 116 | 117 | // 检查世界边界 118 | var pos = cc.Director.getInstance().getRunningScene().testWorldBoard(x,y) ; 119 | 120 | 121 | this.x = pos[0] ; 122 | this.y = pos[1] ; 123 | } 124 | 125 | //, transform: yc.outer.Camera.transformSprite 126 | }) ; -------------------------------------------------------------------------------- /bin/outer/PlayerLayer.js: -------------------------------------------------------------------------------- 1 | yc.outer.PlayerLayer = cc.Layer.extend({ 2 | 3 | ctor: function () { 4 | 5 | this._super() ; 6 | 7 | if(typeof this.setKeyboardEnabled!='undefined') 8 | { 9 | this.setKeyboardEnabled(true); 10 | } 11 | this.setTouchEnabled(true); 12 | 13 | this.setAnchorPoint(cc.p(0,0)) ; 14 | 15 | this.cell = ins(yc.outer.Cell) ; 16 | outerCell = this.cell ; 17 | 18 | this.hMoving = 0 ; 19 | this.vMoving = 0 ; 20 | 21 | this.followPoint = false ; 22 | this.dontMoving = false ; 23 | 24 | //细胞头部是否面向光标 25 | this.setNeedFaceToPoint(true) ; 26 | } 27 | 28 | , onEnter: function(){ 29 | this._super() ; 30 | 31 | this.cell.init() ; 32 | this.addChild(this.cell) ; 33 | } 34 | 35 | , onTouchesBegan: function(touches, event){ 36 | if(!this.dontMoving) 37 | { 38 | this.followPoint = true ; 39 | this.cell.run(4) ; 40 | this.onTouchesMoved(touches, event) ; 41 | } 42 | } 43 | 44 | , onTouchesMoved: function(touches, event){ 45 | var cellPos = this.cell.getPosition() ; 46 | var touchPos = yc.util.windowToClient(this,touches[0]._point.x,touches[0]._point.y) ; 47 | 48 | var innerCell = ins(yc.inner.Cell) ; 49 | if( innerCell.farthest ) 50 | { 51 | if( yc.util.pointsDis(0,0,touchPos[0],touchPos[1]) < yc.util.pointsDis(0,0,innerCell.farthest.center[0],innerCell.farthest.center[1]) + yc.settings.inner.hexgonSideLength ) 52 | { 53 | return ; 54 | } 55 | } 56 | 57 | var radianBetweenPoints = yc.util.radianBetweenPoints( 58 | cellPos.x 59 | ,cellPos.y 60 | ,touchPos[0] 61 | ,touchPos[1] 62 | ) ; 63 | 64 | if(this.getNeedFaceToPoint()){ 65 | this.cell.rotationTarget = radianBetweenPoints; 66 | } 67 | 68 | if(!this.dontMoving) 69 | { 70 | if(this.followPoint) 71 | { 72 | this.cell.direction = radianBetweenPoints; 73 | this.cell.updateVelocity() ; 74 | } 75 | } 76 | 77 | } 78 | , onTouchesEnded:function (touches, event) { 79 | if(!this.dontMoving) 80 | { 81 | this.followPoint = false ; 82 | this.cell.stopRun() ; 83 | } 84 | } 85 | 86 | , onKeyUp:function (e) { 87 | switch(e.keyCode) 88 | { 89 | // left 90 | case 65 : // s 91 | case 37 : 92 | var prop = 'hMoving' ; 93 | var v = -1 ; 94 | break; 95 | 96 | // up 97 | case 87 : // w 98 | case 38 : 99 | var prop = 'vMoving' ; 100 | var v = 1 ; 101 | break; 102 | 103 | // right 104 | case 68 : // d 105 | case 39 : 106 | var prop = 'hMoving' ; 107 | var v = 1 ; 108 | break; 109 | 110 | // down 111 | case 83 : // s 112 | case 40 : 113 | var prop = 'vMoving' ; 114 | var v = -1 ; 115 | break; 116 | 117 | // 其他按键 跳过 updateCellMoving() 118 | default: 119 | return ; 120 | } 121 | 122 | if( this[prop]==v ) 123 | { 124 | this[prop] = 0 ; 125 | } 126 | 127 | this.updateCellMoving() ; 128 | } 129 | 130 | , onKeyDown:function (e) { 131 | switch(e.keyCode) 132 | { 133 | // left 134 | case 65 : // s 135 | case 37 : 136 | this.hMoving = -1 ; 137 | break; 138 | 139 | // up 140 | case 87 : // w 141 | case 38 : 142 | this.vMoving = 1 ; 143 | break; 144 | 145 | // right 146 | case 68 : // d 147 | case 39 : 148 | this.hMoving = 1 ; 149 | break; 150 | 151 | // down 152 | case 83 : // s 153 | case 40 : 154 | this.vMoving = -1 ; 155 | break; 156 | 157 | // 其他按键 跳过 updateCellMoving() 158 | default: 159 | return ; 160 | } 161 | 162 | this.updateCellMoving() ; 163 | } 164 | 165 | , updateCellMoving: function(){ 166 | 167 | if(!this.hMoving&&!this.vMoving) 168 | { 169 | this.cell.stopRun() ; 170 | } 171 | else 172 | { 173 | this.cell.direction = yc.util.radianBetweenPoints(0,0,this.hMoving,this.vMoving) ; 174 | this.cell.run(4) ; 175 | this.cell.updateVelocity() ; 176 | } 177 | } 178 | , setNeedFaceToPoint : function(bNeed){ 179 | this.bNeedFaceToPoint = Boolean(bNeed); 180 | } 181 | , getNeedFaceToPoint : function(){ 182 | return Boolean( this.bNeedFaceToPoint ); 183 | } 184 | 185 | //, transform: yc.cocos2d.patchs.Node.transform 186 | }); -------------------------------------------------------------------------------- /bin/outer/Portal.js: -------------------------------------------------------------------------------- 1 | yc.outer.Portal = yc.outer.PhysicalEntity.extend({ 2 | 3 | ctor: function(){ 4 | 5 | this.initWithFile('res/Goal.png'); 6 | }, 7 | 8 | 9 | initWithScript: function(script){ 10 | this._script = script ; 11 | 12 | this.setWorldPosition(script.x,script.y) ; 13 | 14 | this.initWithCircle(20,script.x,script.y,1,b2Body.b2_staticBody) ; 15 | 16 | } 17 | 18 | , touchingCell: function(){ 19 | var level = eval('yc.levels.'+this._script.level) ; 20 | if(level) 21 | { 22 | yc.levels.LevelSelector.enterLevel(level) ; 23 | } 24 | } 25 | 26 | , draw: function(ctx){ 27 | 28 | this._super(ctx,true) ; 29 | 30 | if(g_architecture=='native') 31 | { 32 | return ; 33 | } 34 | 35 | /* 36 | log(this.getScale()) ; 37 | 38 | ctx.globalAlpha = this._opacity/255 ; 39 | 40 | yc.util.drawCircle(ctx,0,0,10,10,"rgba(0,0,0,0.6)") ; 41 | yc.util.drawCircle(ctx,0,0,8,8,"rgba(0,0,0,0.5)") ; 42 | yc.util.drawCircle(ctx,0,0,6,6,"rgba(0,0,0,0.4)") ; 43 | yc.util.drawCircle(ctx,0,0,4,4,"rgba(0,0,0,0.3)") ; 44 | */ 45 | } 46 | 47 | , open: function(){ 48 | 49 | this.setScale(1); 50 | var seq = cc.Spawn.create( 51 | cc.RepeatForever.create(cc.RotateBy.create(2, 360)) 52 | ) 53 | 54 | this.runAction(seq) ; 55 | } 56 | }) ; -------------------------------------------------------------------------------- /bin/outer/RandomRolesLayer.js: -------------------------------------------------------------------------------- 1 | yc.outer.RandomRolesLayer = cc.Layer.extend({ 2 | 3 | ctor:function(roleClass,maxNum) { 4 | 5 | this._super () ; 6 | 7 | this.roleClass = roleClass ; 8 | this.randomNumMax = 0 ; 9 | 10 | this.setAnchorPoint(cc.p(0,0)) ; 11 | 12 | var layer = this ; 13 | setInterval(function(){layer.update()},1000) ; 14 | this.update() ; 15 | } 16 | 17 | , update: function() 18 | { 19 | var camera = ins(yc.outer.Camera) ; 20 | var wsize = cc.Director.getInstance().getWinSize() ; 21 | var range = { 22 | left: 0|(camera.x - wsize.width) 23 | , right: 0|(camera.x + 2*wsize.width) 24 | , top: 0|(camera.y + 2*wsize.height) 25 | , bottom: 0|(camera.y - wsize.height) 26 | } ; 27 | range.width = range.right - range.left ; 28 | range.height = range.top - range.bottom ; 29 | 30 | 31 | 32 | // 回收范围以外的对象 33 | for(var id in yc.util.ObjectPool.ins(this.roleClass).usingObjects) 34 | { 35 | var aRole = yc.util.ObjectPool.ins(this.roleClass).usingObjects[id] ; 36 | // dbgOutput+= '
AminoAcid:'+Math.round(aAminoAcid.x)+','+Math.round(aAminoAcid.y) ; 37 | 38 | if( aRole.xrange.right || aRole.y>range.top || aRole.y0.5? 1: -1) ; // 角度 115 | this.velocity[0] = Math.sin(this.velocity[2]) * this._script.moseySpeed ; // x 方向 116 | this.velocity[1] = Math.cos(this.velocity[2]) * this._script.moseySpeed ; // y 方向 117 | } 118 | 119 | var toPositionX = this.x+ dt * this.velocity[0] ; 120 | var toPositionY = this.y+ dt * this.velocity[1] ; 121 | 122 | 123 | if ( Math.abs(yc.util.pointsDis(toPositionX, toPositionY ,this.originPosition[0] ,this.originPosition[1] )) < this._script.moseyArea ) 124 | { 125 | this.x= toPositionX; 126 | this.y= toPositionY; 127 | this.setPosition(cc.p(this.x,this.y)) ; 128 | }else{ 129 | ///掉头 130 | this.velocity[2] = yc.util.radianBetweenPoints(this.x,this.y,this.originPosition[0] , this.originPosition[1]) - 1.5; 131 | this.x += dt * Math.sin(this.velocity[2]) * this._script.moseySpeed ; // x 方向 132 | this.y += dt * Math.cos(this.velocity[2]) * this._script.moseySpeed ; // y 方向 133 | this.setPosition(cc.p(this.x,this.y)) ; 134 | } 135 | 136 | } 137 | 138 | }) ; 139 | 140 | yc.outer.pinups.Pinup.insId = -1 ; 141 | yc.outer.pinups.Pinup.pool = {} -------------------------------------------------------------------------------- /bin/test.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | function moremoney(AminoAcid , Protein) 4 | { 5 | if(!$.isNumeric(AminoAcid)){ 6 | AminoAcid = 100; 7 | } 8 | if(!$.isNumeric(Protein)){ 9 | Protein = 500; 10 | } 11 | // 氨基酸池 12 | ins(yc.user.Character).aminoacids.increase('red',AminoAcid) 13 | ins(yc.user.Character).aminoacids.increase('yellow',AminoAcid) 14 | ins(yc.user.Character).aminoacids.increase('blue',AminoAcid) 15 | 16 | // 蛋白质 17 | ins(yc.user.Character).proteins.increase('red',Protein) ; 18 | ins(yc.user.Character).proteins.increase('yellow',Protein) ; 19 | ins(yc.user.Character).proteins.increase('blue',Protein) ; 20 | ins(yc.user.Character).proteins.increase('orange',Protein) ; 21 | ins(yc.user.Character).proteins.increase('green',Protein) ; 22 | ins(yc.user.Character).proteins.increase('violet',Protein) ; 23 | } 24 | 25 | function newVirusCluster(){ 26 | var cell = ins(yc.inner.Cell) ; 27 | 28 | var v = yc.util.ObjectPool.ins(yc.outer.VirusCluster ).ob() ; 29 | v.x = cell.x + 100 ; 30 | v.y = cell.y + 100 ; 31 | v.init() ; 32 | 33 | cc.Director.getInstance().getRunningScene().layerEnemies.addChild(v) ; 34 | } 35 | 36 | function testVirusRun(startX,startY){ 37 | 38 | var layer = ins(yc.inner.monster.VirusLayer) ; 39 | var virus = layer.createVirusSprite() ; 40 | 41 | virus.run(startX,startY) ; 42 | 43 | } 44 | 45 | function resize(w,h){ 46 | 47 | var director = cc.Director.getInstance() ; 48 | director.getWinSize() ; 49 | 50 | 51 | //缩放比例 52 | var xScale = cc.canvas.width / cc.originalCanvasSize.width; 53 | 54 | yc.util.drawLine( 55 | [0,0],[1000,1000] 56 | , $("#gameCanvas") 57 | //.width(w) 58 | //.height(h) 59 | .attr("width",w) 60 | .attr("height",h) 61 | [0].getContext('2d') 62 | , "red" ) ; 63 | 64 | /*$("#gameCanvas") 65 | .width(w) 66 | .height(h) 67 | .attr({ 68 | width: w 69 | , height: h 70 | }) ;*/ 71 | 72 | //director._winSizeInPixels = director._winSizeInPoints = cc.size(w,h) ; 73 | //director._winSizeInPixels = cc.size(director._winSizeInPoints.width * this._contentScaleFactor, director._winSizeInPoints.height * this._contentScaleFactor); 74 | } 75 | 76 | function test1(){ 77 | 78 | var c = yc.dbg.canvasContextWapper.create() ; 79 | 80 | yc.event.register(c,"before_translate",function(x,y){ 81 | 82 | yc.util.drawCircle(this,x,y,5,5,"green") ; 83 | 84 | if(x>500&&x<1000) 85 | { 86 | log("before_translate:"+x,","+y) 87 | } 88 | }) 89 | } 90 | 91 | 92 | function traceNode(node){ 93 | while(node && node!==undefined){ 94 | 95 | var archor = node.getAnchorPoint() ; 96 | //log(node) ; 97 | log(node.constructor.className+"//anchor:"+archor.x+","+archor.y+"; ") ; 98 | 99 | node = node._parent ; 100 | } 101 | } 102 | 103 | 104 | function moregene(name){ 105 | ins(yc.user.Character).dna.obtainGene( yc.dna.genes[name] ) ; 106 | log(yc.dna.genes,ins(yc.user.Character).dna) 107 | } 108 | 109 | function unlockAll(){ 110 | for(var name in yc.dna.genes){ 111 | ins(yc.user.Character).dna.obtainGene( yc.dna.genes[name] ) ; 112 | } 113 | unlockAllUpgrade(); 114 | log('unlock all towers'); 115 | } 116 | function unlockAllUpgrade(){ 117 | yc.inner.building.isIgnoreAllUpgradeLock = true; 118 | log('unlock all tower`s upgrade'); 119 | } 120 | 121 | function savecell(){ 122 | ins(yc.user.Character).cell = ins(yc.inner.Cell).exportScript() ; 123 | ins(yc.user.Character).save() ; 124 | } 125 | 126 | -------------------------------------------------------------------------------- /bin/ui/CreateBuildingBtn.js: -------------------------------------------------------------------------------- 1 | var CREATEBUILDINGBTN_STATE_GRABBED = 0; 2 | var CREATEBUILDINGBTN_STATE_UNGRABBED = 1; 3 | 4 | var CreateBuildingBtn = cc.Sprite.extend({ 5 | _state:CREATEBUILDINGBTN_STATE_UNGRABBED, 6 | // _rect:null, 7 | type:"CreateBuildingBtn", 8 | 9 | rect:function () { 10 | return cc.rect(-this._rect.size.width / 2, -this._rect.size.height / 2, this._rect.size.width, this._rect.size.height); 11 | }, 12 | initWithImg:function (sImgName) { 13 | this._state = CREATEBUILDINGBTN_STATE_UNGRABBED; 14 | 15 | this.initWithFile(sImgName); 16 | 17 | this._rect = cc.rect(0, 0, this.getContentSize().width , this.getContentSize().height); 18 | 19 | return true; 20 | }, 21 | onEnter:function () { 22 | if(this.isLocked()){ 23 | this.setFaceType('l'); 24 | this.setBuildable(false); 25 | } 26 | 27 | cc.Director.getInstance().getTouchDispatcher().addTargetedDelegate(this, 0, true); 28 | this._super(); 29 | }, 30 | onExit:function () { 31 | cc.Director.getInstance().getTouchDispatcher().removeDelegate(this); 32 | this._super(); 33 | }, 34 | containsTouchLocation:function (touch) { 35 | var getPoint = touch.getLocation(); 36 | var myRect = this.rect(); 37 | 38 | myRect.origin.x += this.getParent().getPosition().x + this.getPosition().x; 39 | myRect.origin.y += this.getParent().getPosition().y + this.getPosition().y; 40 | return cc.Rect.CCRectContainsPoint(myRect, getPoint);//this.convertTouchToNodeSpaceAR(touch)); 41 | } 42 | ,onTouchBegan:function (touch, event) { 43 | if (this._state != CREATEBUILDINGBTN_STATE_UNGRABBED) return false; 44 | if (!this.containsTouchLocation(touch)){ 45 | ins(yc.ui.BuildingCreateMenu).touchMiss(touch); 46 | return false; 47 | } 48 | this._state = CREATEBUILDINGBTN_STATE_GRABBED; 49 | return true; 50 | } 51 | ,onTouchMoved:function (touch, event) { 52 | } 53 | ,onTouchEnded:function (touch, event) { 54 | var that = this; 55 | cc.Assert(this._state == CREATEBUILDINGBTN_STATE_GRABBED, "CreateBuildingBtn - Unexpected state!"); 56 | this._state = CREATEBUILDINGBTN_STATE_UNGRABBED; 57 | 58 | var BuildingCreateMenu = ins(yc.ui.BuildingCreateMenu); 59 | 60 | BuildingCreateMenu.showBuildingDes(this.hexgon , this.building , this.getPosition() , this.bBuildable); 61 | 62 | console.log( this.building.title + ' building btn touch end'); 63 | 64 | // window.event.cancelBubble = true; //stop event go through 65 | } 66 | , touchDelegateRetain:function () { 67 | } 68 | , touchDelegateRelease:function () { 69 | } 70 | 71 | , addTexture : function(aTexture){ 72 | if(!this._arrTextures){ 73 | this._arrTextures = []; 74 | } 75 | this._arrTextures.push(aTexture); 76 | } 77 | //type : nm = noMoney ; l = lock ; other = normal 78 | , setFaceType : function(type){ 79 | if(type==='nm'){ 80 | this.initWithFile(this._arrTextures[2]); 81 | }else if(type==='l'){ 82 | this.initWithFile(this._arrTextures[1]); 83 | }else{ 84 | this.initWithFile(this._arrTextures[0]); 85 | } 86 | } 87 | , setBuildable: function( bBuildable ){ 88 | this.bBuildable = bBuildable ? true:false; 89 | } 90 | , isLocked : function(){ 91 | return false; 92 | } 93 | }); 94 | 95 | CreateBuildingBtn.buildingBtnWithTexture = function (sImgName1,sImgName2,sImgName3 ) { 96 | var buildingBtn = new CreateBuildingBtn(); 97 | 98 | buildingBtn.addTexture(sImgName1); 99 | buildingBtn.addTexture(sImgName2); 100 | buildingBtn.addTexture(sImgName3); 101 | 102 | buildingBtn.setBuildable(true); 103 | 104 | buildingBtn.initWithImg(sImgName1); 105 | 106 | return buildingBtn; 107 | }; -------------------------------------------------------------------------------- /bin/ui/DlgRewardGene.js: -------------------------------------------------------------------------------- 1 | yc.ui.DlgRewardGene = function(){ 2 | 3 | this.ui = $('#dialog-killboss-reward') ; 4 | var dlg = this ; 5 | 6 | this.show = function(boss){ 7 | 8 | this.ui.find('#reward-genes-outer').html('') ; 9 | 10 | for(var g=0;g♫ 0") ; 16 | }) ; 17 | $(window).bind('yc.user.ProteinPool::onAfterChange',null,function(e,pool,name,total,num){ 18 | $('.protein-num-'+name).text( '♫ '+total ) ; 19 | }) ; 20 | 21 | 22 | // 合成蛋白质 23 | this.toggleProteinComposion = function(){ 24 | 25 | $("#dialog-protein-composite") 26 | .width(400).height(300) 27 | .css({ 28 | top: ($(window).height()-300)/2 29 | , left: ($(window).width()-400)/2 30 | , position: 'absolute' 31 | , 'z-index': 100 32 | }) 33 | .toggle() ; 34 | } 35 | 36 | // HP 状态 37 | $(window).bind('yc.inner.Cell::onAfterChange',null,function(e,o,val,hp){ 38 | $('#dashboard-hp').html('HP:'+hp+'/'+o.hpMax) ; 39 | }) ; 40 | 41 | } 42 | 43 | 44 | if(g_architecture=='html5') 45 | { 46 | yc.ui.UI.ins = new yc.ui.UI ; 47 | } -------------------------------------------------------------------------------- /bin/ui/UILayer.js: -------------------------------------------------------------------------------- 1 | yc.ui.UILayer = cc.Layer.extend({ 2 | ctor: function(){ 3 | this._super() ; 4 | 5 | // 层:仪表盘 6 | this.dashboard = ins(yc.ui.dashboard.Dashboard) ; 7 | 8 | // 层:主菜单按钮(屏幕右上角) 9 | this.pauseMenu = ins(yc.ui.PauseMenu) ; 10 | 11 | // 层:缩放(屏幕右) 12 | this.zoomBar = ins(yc.ui.ZoomBar) ; 13 | 14 | // 层:技能栏 15 | this.skillBar = new yc.ui.skill.SkillBar ; 16 | } 17 | , onEnter: function(){ 18 | this._super() ; 19 | this.addChild(this.dashboard) ; 20 | this.addChild(this.zoomBar) ; 21 | this.addChild(this.pauseMenu) ; 22 | this.addChild(this.skillBar); 23 | } 24 | , onExit: function(){ 25 | this._super() ; 26 | this.removeChild(this.dashboard) ; 27 | this.removeChild(this.zoomBar) ; 28 | this.removeChild(this.pauseMenu) ; 29 | this.removeChild(this.skillBar); 30 | } 31 | }) ; -------------------------------------------------------------------------------- /bin/ui/UpgradeBuildingBtn.js: -------------------------------------------------------------------------------- 1 | var UPGRADEBUILDINGBTN_STATE_GRABBED = 0; 2 | var UPGRADEBUILDINGBTN_STATE_UNGRABBED = 1; 3 | 4 | var UpgradeBuildingBtn = cc.Sprite.extend({ 5 | _state:UPGRADEBUILDINGBTN_STATE_UNGRABBED, 6 | // _rect:null, 7 | type:"UpgradeBuildingBtn", 8 | 9 | rect:function () { 10 | return cc.rect(-this._rect.size.width / 2, -this._rect.size.height / 2, this._rect.size.width, this._rect.size.height); 11 | }, 12 | initWithImg:function (aTexture) { 13 | this._state = UPGRADEBUILDINGBTN_STATE_UNGRABBED; 14 | 15 | this.initWithFile(aTexture); 16 | 17 | this._rect = cc.rect(0, 0, this.getContentSize().width , this.getContentSize().height); 18 | 19 | return true; 20 | }, 21 | onEnter:function () { 22 | cc.Director.getInstance().getTouchDispatcher().addTargetedDelegate(this, 0, true); 23 | this._super(); 24 | }, 25 | onExit:function () { 26 | cc.Director.getInstance().getTouchDispatcher().removeDelegate(this); 27 | this._super(); 28 | }, 29 | containsTouchLocation:function (touch) { 30 | var getPoint = touch.getLocation(); 31 | var myRect = this.rect(); 32 | 33 | myRect.origin.x += this.getParent().getPosition().x + this.getPosition().x; 34 | myRect.origin.y += this.getParent().getPosition().y + this.getPosition().y; 35 | return cc.Rect.CCRectContainsPoint(myRect, getPoint);//this.convertTouchToNodeSpaceAR(touch)); 36 | } 37 | ,onTouchBegan:function (touch, event) { 38 | if (this._state != UPGRADEBUILDINGBTN_STATE_UNGRABBED) return false; 39 | if (!this.containsTouchLocation(touch)){ 40 | ins(yc.ui.BuildingUpgradeMenu).touchMiss(touch); 41 | return false; 42 | } 43 | this._state = UPGRADEBUILDINGBTN_STATE_GRABBED; 44 | return true; 45 | } 46 | ,onTouchMoved:function (touch, event) { 47 | } 48 | ,onTouchEnded:function (touch, event) { 49 | var that = this; 50 | cc.Assert(this._state == UPGRADEBUILDINGBTN_STATE_GRABBED, "UpgradeBuildingBtn - Unexpected state!"); 51 | this._state = UPGRADEBUILDINGBTN_STATE_UNGRABBED; 52 | 53 | var BuildingUpgradeMenu = ins(yc.ui.BuildingUpgradeMenu); 54 | 55 | BuildingUpgradeMenu.showBuildingDes(this.hexgon , this.building ,this.upgrader, this.getPosition() , this.bBuildable , this) ; 56 | 57 | console.log( this.upgrader.title + ' building btn touch end'); 58 | } 59 | , touchDelegateRetain:function () { 60 | } 61 | , touchDelegateRelease:function () { 62 | } 63 | , addTexture : function(aTexture){ 64 | if(!this._arrTextures){ 65 | this._arrTextures = []; 66 | } 67 | this._arrTextures.push(aTexture); 68 | } 69 | , setFaceType : function(type){ 70 | if(type==='nm'){ 71 | this.initWithFile(this._arrTextures[2]); 72 | }else if(type==='l'){ 73 | this.initWithFile(this._arrTextures[1]); 74 | }else{ 75 | this.initWithFile(this._arrTextures[0]); 76 | } 77 | } 78 | , setBuildable: function( bBuildable ){ 79 | this.bBuildable = bBuildable ? true:false; 80 | } 81 | }); 82 | 83 | UpgradeBuildingBtn.buildingBtnWithTexture = function (sImgName1,sImgName2,sImgName3 ) { 84 | var buildingBtn = new UpgradeBuildingBtn(); 85 | 86 | buildingBtn.addTexture(sImgName1); 87 | buildingBtn.addTexture(sImgName2); 88 | buildingBtn.addTexture(sImgName3); 89 | 90 | buildingBtn.setBuildable(true); 91 | 92 | buildingBtn.initWithImg(sImgName1); 93 | 94 | return buildingBtn; 95 | }; -------------------------------------------------------------------------------- /bin/ui/dashboard/Star.js: -------------------------------------------------------------------------------- 1 | var STAR_STATE_GRABBED = 0; 2 | var STAR_STATE_UNGRABBED = 1; 3 | 4 | var Star = cc.Sprite.extend({ 5 | _state:STAR_STATE_UNGRABBED, 6 | // _rect:null, 7 | 8 | rect:function () { 9 | return cc.rect(-this._rect.size.width / 2, -this._rect.size.height / 2, this._rect.size.width, this._rect.size.height); 10 | }, 11 | initWithImg:function (sImgName) { 12 | 13 | this._state = STAR_STATE_UNGRABBED; 14 | 15 | this.initWithFile(sImgName); 16 | 17 | this._rect = cc.rect(0, 0, this.getContentSize().width, this.getContentSize().height); 18 | 19 | return true; 20 | }, 21 | addTexture : function(aTexture){ 22 | if(!this._arrTextures){ 23 | this._arrTextures = []; 24 | } 25 | this._arrTextures.push(aTexture); 26 | }, 27 | onEnter:function () { 28 | cc.Director.getInstance().getTouchDispatcher().addTargetedDelegate(this, 0, true); 29 | this._super(); 30 | }, 31 | onExit:function () { 32 | cc.Director.getInstance().getTouchDispatcher().removeDelegate(this); 33 | this._super(); 34 | }, 35 | containsTouchLocation:function (touch) { 36 | var getPoint = touch.getLocation(); 37 | var myRect = this.rect(); 38 | 39 | myRect.origin.x += this.getPosition().x; 40 | myRect.origin.y += this.getPosition().y; 41 | return cc.Rect.CCRectContainsPoint(myRect, getPoint);//this.convertTouchToNodeSpaceAR(touch)); 42 | } 43 | ,onTouchBegan:function (touch, event) { 44 | if(!this.bClickable){ 45 | return false; 46 | } 47 | 48 | if (this._state != STAR_STATE_UNGRABBED) return false; 49 | if (!this.containsTouchLocation(touch)) return false; 50 | 51 | this._state = STAR_STATE_GRABBED; 52 | 53 | this.initWithFile(this._arrTextures[1]); 54 | 55 | this.timer(); 56 | 57 | return true; 58 | } 59 | ,onTouchMoved:function (touch, event) { 60 | } 61 | ,onTouchEnded:function (touch, event) { 62 | cc.Assert(this._state == STAR_STATE_GRABBED, "Star - Unexpected state!"); 63 | this._state = STAR_STATE_UNGRABBED; 64 | 65 | ins(yc.inner.building.ProteinFactory).singleComposite( this.getFormula() ); 66 | 67 | if(!this.bAutoMode){ 68 | this.initWithFile(this._arrTextures[0]); 69 | } 70 | 71 | if(this.interval !== undefined){ 72 | clearInterval(this.interval); 73 | } 74 | 75 | this.nTime = 0 ; 76 | } 77 | , toglleAutoMode : function(bAuto){ 78 | if(this.bAutoMode === undefined){ 79 | this.bAutoMode = false; 80 | } 81 | if(bAuto === undefined){ 82 | bAuto = this.bAutoMode; 83 | } 84 | 85 | if(bAuto === false){ 86 | this.initWithFile(this._arrTextures[2]); 87 | this.bAutoMode = true; 88 | }else{ 89 | this.initWithFile(this._arrTextures[0]); 90 | this.bAutoMode = false; 91 | } 92 | ins(yc.user.ProteinFormulas).toggle( this.getFormula().name ); 93 | } 94 | 95 | , setClickable : function(bAble){ 96 | this.bClickable = bAble; 97 | } 98 | , setFormula : function(aFormula){ 99 | this.aFormula = aFormula; 100 | } 101 | , getFormula : function(){ 102 | return this.aFormula ; 103 | } 104 | , timer : function(){ 105 | var target = this; 106 | this.nTime = Date.parse(new Date())/1000 ; 107 | this.interval = setInterval(function(){ 108 | var howLongPress = Date.parse(new Date())/1000 - target.nTime; 109 | if( howLongPress > 1){ 110 | target.toglleAutoMode(); 111 | clearInterval(target.interval); 112 | target.nTime = 0 ; 113 | } 114 | },300); 115 | } 116 | , touchDelegateRetain:function () { 117 | } 118 | , touchDelegateRelease:function () { 119 | } 120 | 121 | }); 122 | 123 | Star.starWithTexture = function (sImgName1, sImgName2 , sImgName3) { 124 | 125 | var star = new Star(); 126 | 127 | star.setClickable(true); 128 | 129 | star.nTime = 0; 130 | 131 | star.addTexture(sImgName1); 132 | star.addTexture(sImgName2); 133 | star.addTexture(sImgName3); 134 | 135 | star.initWithImg(sImgName1); 136 | return star; 137 | }; -------------------------------------------------------------------------------- /bin/ui/editer/ObjectEditer.js: -------------------------------------------------------------------------------- 1 | yc.ui.editer.ObjectEditer = function(object,eleUi,indent){ 2 | 3 | /*if(typeof(indent)=='undefined') 4 | { 5 | indent = 1 ; 6 | }*/ 7 | this.ui = eleUi ; 8 | this.object = object ; 9 | 10 | this._displayEle = function(parent,key){ 11 | 12 | var item = parent[key] ; 13 | var liUi = $('
  • ') ; 14 | 15 | var keyHtml = key+':' ; 16 | switch(typeof(item)) 17 | { 18 | case 'object': 19 | 20 | liUi.html(keyHtml) ; 21 | 22 | if(item===null) 23 | { 24 | liUi.append('null') ; 25 | break ; 26 | } 27 | else if(item.constructor.name=='Array') 28 | { 29 | var hrefUi = $('[...]').appendTo(liUi) ; 30 | } 31 | else 32 | { 33 | var hrefUi = $('{...}').appendTo(liUi) ; 34 | } 35 | 36 | var childUl = $('
      ').appendTo(liUi) ; 37 | 38 | hrefUi 39 | .data('ui',childUl) 40 | .data('object',item) 41 | .click(function(){ 42 | var ui = $(this).data('ui') ; 43 | if(!ui.data('scaned')) 44 | { 45 | new yc.ui.editer.ObjectEditer($(this).data('object'),ui) ; 46 | ui.data('scaned',true) ; 47 | } 48 | 49 | ui.toggle() ; 50 | }) ; 51 | 52 | break ; 53 | 54 | case 'function': 55 | return ; 56 | 57 | default: 58 | 59 | liUi.html(keyHtml) ; 60 | var ipt = $("") 61 | .appendTo(liUi) 62 | .addClass('object-editer-input') 63 | .data({ 64 | parent: parent 65 | , name: key 66 | }) 67 | .blur(function(){ 68 | $(this).data('parent')[$(this).data('name')] = eval( $(this).val() ) ; 69 | }) ; 70 | 71 | if(typeof(item)=='string') 72 | { 73 | ipt.val('"'+item+'"') ; 74 | } 75 | else if(typeof(item)=='undefined') 76 | { 77 | ipt.val('undefined') ; 78 | } 79 | else 80 | { 81 | ipt.val(item.toString()) ; 82 | } 83 | } 84 | 85 | 86 | liUi.appendTo(this.ui) ; 87 | } 88 | 89 | 90 | this.ui.html('') ; 91 | if( object.constructor.name=='Array' ) 92 | { 93 | for(var i=0;i 255) { 12 | _length = _length + 2; 13 | } 14 | else { 15 | _length++; 16 | } 17 | } 18 | return _length; 19 | } -------------------------------------------------------------------------------- /bin/ui/menu/Menu.js: -------------------------------------------------------------------------------- 1 | yc.ui.menu.Menu = cc.Layer.extend( 2 | { 3 | items : null, 4 | title : null, 5 | titleHeight : 155, 6 | buttons : [], 7 | BtnCallBack: function(sender){ 8 | var idx = sender.getZOrder(); 9 | this.items[idx].action(); 10 | this.setVisible(false) ; 11 | }, 12 | setTitle : function( title){ 13 | this.title = title; 14 | }, 15 | setTitleHeight : function( titleHeight){ 16 | this.titleHeight = titleHeight; 17 | }, 18 | setItems : function( items){ 19 | this.items = items; 20 | }, 21 | run: function(){ 22 | 23 | var screenSize = cc.Director.getInstance().getWinSize(); 24 | 25 | //button height 26 | var buttonHeight = 150; 27 | var titleHeight = this.titleHeight; 28 | 29 | var midX = screenSize.width / 2; 30 | var midY = screenSize.height / 2; 31 | 32 | 33 | //bj////////////////////////////////////////////////////////////////// 34 | var bj = cc.LayerColor.create(cc.c4(0, 0, 0, 200), screenSize.width, screenSize.height); 35 | 36 | //buttons////////////////////////////////////////////////////// 37 | var buttonY = 0; 38 | for(var i =0;i 0.95){ 101 | Scale = 0.95; 102 | } 103 | 104 | kuang.addChild(kuangTop); 105 | kuang.addChild(kuangMid); 106 | kuang.addChild(kuangBut); 107 | kuang.addChild(menu); 108 | kuang.addChild(fontSprinte); 109 | kuang.setScale(Scale , Scale); 110 | kuang.setPosition(cc.p(midX - (414*Scale) , midY + (kuangHeight/2)*Scale )); 111 | //bj.addChild(kuang); 112 | 113 | this.addChild(bj); 114 | this.addChild(kuang); 115 | //this.addChild(dot); 116 | 117 | var scene = cc.Director.getInstance().getRunningScene() ; 118 | scene.layerUi.addChild(this); 119 | 120 | return true; 121 | } 122 | }) ; 123 | 124 | yc.ui.menu.Menu.test = function(){ 125 | 126 | var items = [ 127 | { 128 | title:"[解锁]防御塔(射击)", 129 | action:function () { 130 | 131 | } 132 | },{ 133 | title:"[解锁]防御塔(火炮)", 134 | action:function () { 135 | 136 | } 137 | },{ 138 | title:"[解锁]防御塔(减速)", 139 | action:function () { 140 | 141 | } 142 | }] 143 | 144 | var menu = ins( yc.ui.menu.Menu ); 145 | menu.setTitle("ddddddddddddd"); 146 | //menu.setTitleHeight(50); 147 | menu.setItems(items); 148 | menu.run(); 149 | } -------------------------------------------------------------------------------- /bin/ui/skill/OutsideShooterButton.js: -------------------------------------------------------------------------------- 1 | yc.ui.skill.OutsideShooterButton = yc.ui.skill.ButtonBase.extend({}); 2 | -------------------------------------------------------------------------------- /bin/ui/skill/SkillBar.js: -------------------------------------------------------------------------------- 1 | yc.ui.skill.SkillBar = cc.Layer.extend({ 2 | marginLeft: 50 3 | , buttons : {} 4 | , buttonsIndex : [] 5 | , ctor: function(){ 6 | this.buttons = {}; 7 | } 8 | , createButtonForSkill: function(skill){ 9 | var name = skill.name(); 10 | var button ; 11 | if( this.buttons[name] != undefined ){ 12 | button = this.buttons[name]; 13 | }else{ 14 | switch(name){ 15 | case 'xxxxxxxxxxx'://OutsideShooter 16 | button = new yc.ui.skill.OutsideShooterButton; 17 | break; 18 | default: 19 | 20 | var title = 1; 21 | var key = 49; 22 | for(var attr in this.buttons) 23 | { 24 | if( this.buttons[attr] != undefined ){ 25 | title++; 26 | key++; 27 | } 28 | } 29 | 30 | button = new yc.ui.skill.ButtonBase(); 31 | button.setTitle( title); 32 | button.setKeyCode( key); 33 | if(skill.icon()){ 34 | button.setIcon( skill.icon()); 35 | }else{ 36 | button.setIcon( "res/tower_yellow.png"); 37 | } 38 | 39 | break; 40 | } 41 | 42 | this.addChild( button ); 43 | 44 | var index = 1 ; 45 | for(var attr in this.buttons) 46 | { 47 | if( this.buttons[attr] != undefined ){ 48 | index++; 49 | } 50 | } 51 | 52 | button.setPosition( cc.p( this.marginLeft + index*button.boxWidth + button.boxWidth / 2 , button.boxHeight / 2 ) ); 53 | 54 | this.buttons[name] = button ; 55 | this.buttonsIndex.push( name); 56 | } 57 | button.addSkill( skill ); 58 | return button; 59 | } 60 | , removeButtonForSkill: function(skill){ 61 | var name = skill.name(); 62 | var button = this.buttons[name]; 63 | button.removeSkill( skill ); 64 | 65 | if( button.skillList().length == 0){ 66 | for(var attr in this.buttons) 67 | { 68 | if( attr == name){ 69 | this.buttons[attr] = undefined; 70 | 71 | // 维护按钮排序 72 | for(var i=0; i♫ = ' ; 61 | // var i = 0 ; 62 | // for(var key in formula.materials) 63 | // { 64 | // if(i++) 65 | // { 66 | // formula.detail+= ' + ' ; 67 | // } 68 | // formula.detail+= '♪ '+formula.materials[key]+'' ; 69 | // } 70 | // ui.find('.formula-display').html(formula.detail) ; 71 | 72 | // 维护链表 73 | if( !this.first ) 74 | { 75 | this.first = formula ; 76 | this.first.first = 'first'; 77 | this.last = formula ; 78 | } 79 | 80 | this.last.next = formula ; 81 | this.last.last = null; 82 | 83 | this.last = formula ; 84 | formula.last = 'last' ; 85 | formula.next = this.first ; 86 | 87 | 88 | this.formulaNum ++ ; 89 | 90 | 91 | this.worldFormulas[formula.name] = formula ; 92 | 93 | 94 | // 触发事件 95 | // $(window).trigger('yc.user.ProteinFormulas::onAfterAppend',[this,formula]) ; 96 | 97 | return this ; 98 | } 99 | 100 | this.toggle = function(name) 101 | { 102 | if(this.worldFormulas[name].status=='compositing') 103 | { 104 | this.worldFormulas[name].status = 'pause' 105 | }else if(this.worldFormulas[name].status=='pause') 106 | { 107 | this.worldFormulas[name].status = 'compositing' ; 108 | } 109 | 110 | // if(this.worldFormulas[name].status=='compositing') 111 | // { 112 | // return ; 113 | // } 114 | // else if(this.worldFormulas[name].status=='pause') 115 | // { 116 | // this.worldFormulas[name].status = 'waiting' ; 117 | // // this.worldFormulas[name].ui.find('.protein-formula-togglebtn').text('暂停') ; 118 | // // this.worldFormulas[name].ui.find('.formula-msg').text('').hide() ; 119 | // } 120 | // else if(this.worldFormulas[name].status=='waiting') 121 | // { 122 | // this.worldFormulas[name].status = 'pause' ; 123 | // // this.worldFormulas[name].ui.find('.protein-formula-togglebtn').text('自动') ; 124 | // // this.worldFormulas[name].ui.find('.formula-msg').text('暂停').show() ; 125 | // } 126 | } 127 | 128 | 129 | // 初始化蛋白质公式 130 | for(var name in yc.settings.protein ) 131 | { 132 | this.addNewFormula(yc.settings.protein[name]) ; 133 | } 134 | } 135 | 136 | // 由物理三原色 转换为屏幕三原色 137 | yc.user.ProteinFormulas.transColor = function(tricolor){ 138 | red = typeof(tricolor.red)=='undefined'? 0: tricolor.red ; 139 | red+= green = typeof(tricolor.yellow)=='undefined'? 0: tricolor.yellow ; 140 | blue = typeof(tricolor.blue)=='undefined'? 0: tricolor.blue ; 141 | return {red:red,green:green,blue:blue} ; 142 | } 143 | 144 | yc.user.ProteinFormulas.proteinColor = function(materials){ 145 | materials = yc.user.ProteinFormulas.transColor(materials) ; 146 | var max = Math.max(materials.red,materials.green,materials.blue); 147 | 148 | return { 149 | red: Math.round((materials.red/max)*255) 150 | , green: Math.round((materials.green/max)*255) 151 | , blue: Math.round((materials.blue/max)*255) 152 | } 153 | } -------------------------------------------------------------------------------- /bin/user/ProteinPool.js: -------------------------------------------------------------------------------- 1 | yc.user.ProteinPool = function () 2 | { 3 | this.mapProteins = {} 4 | this.total = 0 ; 5 | 6 | this.increase = function(name,num){ 7 | 8 | // 触发事件 9 | $(window).trigger('yc.user.ProteinPool::onBeforeChange',[this,name,this.mapProteins[name],num]) ; 10 | 11 | if(typeof(this.mapProteins[name])=='undefined') 12 | { 13 | // 触发事件 14 | $(window).trigger('yc.user.ProteinPool::onBeforeNewType',[this,name]) ; 15 | 16 | this.mapProteins[name] = 0 ; 17 | 18 | // 触发事件 19 | $(window).trigger('yc.user.ProteinPool::onAfterNewType',[this,name]) ; 20 | } 21 | 22 | this.mapProteins[name]+= num ; 23 | 24 | this.total+= num ; 25 | 26 | // 触发事件 27 | $(window).trigger('yc.user.ProteinPool::onAfterChange',[this,name,this.mapProteins[name],num]) ; 28 | } 29 | 30 | this.num = function(name){ 31 | if(typeof(this.mapProteins[name])=='undefined') 32 | { 33 | this.mapProteins[name] = 0 ; 34 | } 35 | return this.mapProteins[name] ; 36 | } 37 | 38 | this.clear = function(){ 39 | for(var key in this.mapProteins) 40 | { 41 | this.increase(key,-this.mapProteins[key]) ; 42 | } 43 | } 44 | } 45 | 46 | yc.user.ProteinPool.singleton = true ; -------------------------------------------------------------------------------- /bin/util/DbgPannel.js: -------------------------------------------------------------------------------- 1 | yc.util.DbgPannel = function(){ 2 | 3 | var pannel = this ; 4 | this.output = {} ; 5 | 6 | // 在ui上输出游戏状态 7 | setInterval(function(){ 8 | var output = '' ; 9 | for(var key in pannel.output){ 10 | output+= key+': '+pannel.output[key]+'
      '; 11 | } 12 | $('#player-status').html(output) ; 13 | 14 | },500) ; 15 | } -------------------------------------------------------------------------------- /bin/util/Instance.js: -------------------------------------------------------------------------------- 1 | 2 | var ins = yc.util.ins = function(className) 3 | { 4 | 5 | var name = typeof(className.className)=='undefined'? className.name: className.className ; 6 | 7 | if( !name || typeof(name)=='undefined' ) 8 | { 9 | return null ; 10 | } 11 | 12 | // 单件对象 13 | if( 'singleton' in className && className.singleton!==undefined && className.singleton ) 14 | { 15 | if( !('_singletonInstance' in className) || !className._singletonInstance ) 16 | { 17 | if(className === yc.user.Character){ 18 | console.log(1); 19 | } 20 | 21 | className._singletonInstance = new className ; 22 | } 23 | return className._singletonInstance ; 24 | } 25 | 26 | // 当前场景中唯一 27 | else 28 | { 29 | var scene = cc.Director.getInstance().getRunningScene() ; 30 | if(!scene) 31 | { 32 | return ; 33 | } 34 | 35 | if( typeof(scene._instances)=='undefined' ) 36 | { 37 | scene._instances = {} ; 38 | } 39 | if( typeof(scene._instances[name])=='undefined' ) 40 | { 41 | scene._instances[name] = new className ; 42 | } 43 | return scene._instances[name] ; 44 | } 45 | } 46 | 47 | 48 | function extend(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;imaxY) 35 | { 36 | maxYPtIdx = i ; 37 | maxY = p[1] ; 38 | } 39 | } 40 | // log([maxYPtIdx,maxY]) ; 41 | 42 | // ------- 43 | var output = [] ; 44 | var pt = this._points[maxYPtIdx] ; 45 | this._points[maxYPtIdx].used = true ; 46 | output.push(pt.p) ; 47 | var preR = 0 ; 48 | 49 | while(1){ 50 | 51 | // 用完了 52 | if(this._points.length<1) 53 | { 54 | break ; 55 | } 56 | 57 | var nearestPtR = 0 ; 58 | var nearestPtIdx = -1 ; 59 | 60 | for(var i=0;ir) 79 | { 80 | nearestPtR = r ; 81 | nearestPtIdx = i ; 82 | } 83 | } 84 | } 85 | 86 | // 断了 …… 87 | if(nearestPtIdx==-1) 88 | { 89 | log('break') ; 90 | break ; 91 | } 92 | 93 | // 完成 94 | if(this._points[nearestPtIdx].used) 95 | { 96 | break ; 97 | } 98 | 99 | this._points[nearestPtIdx].used = true ; 100 | output.push( this._points[nearestPtIdx].p ) ; 101 | pt = this._points[nearestPtIdx] ; 102 | 103 | preR = nearestPtR - Math.PI ; 104 | 105 | this._points.splice(nearestPtIdx,1) ; 106 | 107 | } 108 | 109 | this._points = [] ; 110 | return output ; 111 | } 112 | } -------------------------------------------------------------------------------- /bin/util/debug.js: -------------------------------------------------------------------------------- 1 | 2 | if(typeof("log")=="undefined") 3 | { 4 | function log(message){ 5 | console.log.apply(console,arguments) ; 6 | } 7 | } 8 | 9 | 10 | yc.dbg = {} ; 11 | yc.dbg.canvasContextWapper = function (ctx){ 12 | 13 | for(var k in ctx) 14 | { 15 | if( typeof(ctx[k])=='function' ) 16 | { 17 | this[k] = function(){ 18 | 19 | yc.event.trigger(this,"before_"+arguments.callee.originName,arguments) ; 20 | 21 | var ret = arguments.callee.origin.apply(ctx,arguments) ; 22 | 23 | yc.event.trigger(this,"after_"+arguments.callee.originName,arguments) ; 24 | 25 | return ret ; 26 | } 27 | this[k].origin = ctx[k] ; 28 | this[k].originName = k ; 29 | } 30 | } 31 | } 32 | 33 | yc.dbg.canvasContextWapper.create = function(){ 34 | return cc.renderContext = new yc.dbg.canvasContextWapper(cc.renderContext) ; 35 | } 36 | 37 | function here(){ 38 | try{ 39 | throw new Error() ; 40 | } 41 | catch(e){ 42 | 43 | if( g_architecture=='html5' ) 44 | { 45 | var res = e.stack.split("\n")[2].match(/^\s+at( (.+) \()?.+:(\d+):(\d+)\)?\s*$/) ; 46 | if(res) 47 | { 48 | //log( (res[2]===undefined? "global": (res[2]+"()")) + ":" + res[3] ) ; 49 | } 50 | } 51 | else if(g_architecture=='native') 52 | { 53 | // here@/Users/alee/Library/Application Support/iPhone Simulator/6.0/Applications/82A6D96C-8751-48CC-8AF5-8BDAB63FF827/icell.app/bin/util/debug.js:39 54 | var res = e.stack.split("\n")[1].match(/^\s*(.+)@.+:(\d+)\s*$/) ; 55 | if(res) 56 | { 57 | log( (res[1]===undefined? "global": (res[1]+"()")) + ":" + res[2] ) ; 58 | } 59 | } 60 | } 61 | } -------------------------------------------------------------------------------- /bin/util/declareClassName.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | var func = function (pkg,prefix){ 3 | 4 | for(var n in pkg) 5 | { 6 | // 递归包 7 | if( typeof(pkg[n])=='object' ) 8 | { 9 | func(pkg[n],prefix+n+'.') ; 10 | } 11 | // 遇到类 12 | else if( typeof(pkg[n])=='function' ) 13 | { 14 | // 定义 className 15 | if( !('className' in pkg[n]) ) 16 | { 17 | pkg[n].className = prefix + n ; 18 | } 19 | 20 | } 21 | } 22 | 23 | } ; 24 | 25 | func(yc,'yc.') ; 26 | }) () ; 27 | -------------------------------------------------------------------------------- /bin/util/node.funcs.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * 将窗口坐标x,y转换成node内部的坐标 4 | * 计算node各级父窗口的锚点、缩放 和 旋转 5 | */ 6 | yc.util.windowToClient = function(node,x,y){ 7 | var iptX = x ; 8 | var iptY = y ; 9 | if(yc.util.windowToClient.debug) 10 | { 11 | log(['input ',x,y]) ; 12 | } 13 | 14 | var path = [] ; 15 | do{ 16 | path.push(node) ; 17 | } while( node=node._parent ) 18 | 19 | for(var i=path.length-1;i>=0;i--) 20 | { 21 | node = path[i] ; 22 | 23 | if( node.transform===yc.outer.Camera.transformSprite ) 24 | { 25 | if(yc.util.windowToClient.debug) 26 | { 27 | log('a physical entity') ; 28 | } 29 | var p = yc.outer.Camera.transformPosition(node) ; 30 | } 31 | else 32 | { 33 | var p = node.getPosition() ; 34 | } 35 | x-= p.x ; 36 | y-= p.y ; 37 | 38 | // zoom 39 | x/= node._scaleX ; 40 | y/= node._scaleY ; 41 | 42 | // 43 | if(yc.util.windowToClient.debug) 44 | { 45 | log(['trans to ',x,y, ' by ',node.constructor.className, p.x, p.y, node._scaleX, node._scaleY]) ; 46 | } 47 | 48 | // 计算角度 49 | var r = node.getRotation() ; 50 | if(r) 51 | { 52 | var l = Math.sqrt(x*x+y*y) ; 53 | r = yc.util.radianBetweenPoints(0,0,x,y) - r ; 54 | x = l * Math.sin(r) ; 55 | y = l * Math.cos(r) ; 56 | 57 | if(yc.util.windowToClient.debug) 58 | { 59 | log(['rotation to ',x,y, ' by ',node.constructor.className]) ; 60 | } 61 | } 62 | } 63 | 64 | yc.util.windowToClient.debug = false ; 65 | 66 | return [x,y] ; 67 | } 68 | yc.util.windowToClient.debug = false ; 69 | 70 | 71 | /** 72 | * 将node内部的坐标x,y 转换成窗口坐标x,y 73 | * 计算node各级父窗口的锚点、缩放 和 旋转 74 | */ 75 | yc.util.clientToWindow = function(node,x,y,winNode) { 76 | 77 | 78 | var parent = node.getParent() ; 79 | if( !parent ) 80 | { 81 | return [x,y] ; 82 | } 83 | 84 | // zoom 85 | x*= node.getScaleX() ; 86 | y*= node.getScaleY() ; 87 | 88 | // 计算角度 89 | var r = - node.getRotation() ; 90 | if(r) 91 | { 92 | var l = Math.sqrt(x*x+y*y) ; 93 | r = yc.util.radianBetweenPoints(0,0,x,y) - r ; 94 | x = l * Math.sin(r) ; 95 | y = l * Math.cos(r) ; 96 | 97 | if(yc.util.clientToWindow.debug) 98 | { 99 | log(['rotation to ',x,y, ' by ',node.constructor.className]) ; 100 | } 101 | } 102 | 103 | // 平移位置 104 | if( parent.transform===yc.outer.Camera.transformSprite ) 105 | { 106 | if(yc.util.windowToClient.debug) 107 | { 108 | log('a physical entity') ; 109 | } 110 | var p = yc.outer.Camera.transformPosition(parent) ; 111 | } 112 | else 113 | { 114 | var p = node.getPosition() ; 115 | } 116 | 117 | x+= p.x ; 118 | y+= p.y ; 119 | 120 | 121 | if( parent===winNode ) 122 | { 123 | return [x,y] ; 124 | } 125 | else 126 | { 127 | // 递归处理 128 | return yc.util.clientToWindow(parent,x,y,winNode) ; 129 | } 130 | } 131 | yc.util.clientToWindow.debug = false ; 132 | 133 | 134 | 135 | yc.util.traceNode = function(node){ 136 | do{ 137 | log(node) ; 138 | } while( node=node._parent ) 139 | } 140 | 141 | /** 142 | * 将 node 相对于窗口摆正 143 | */ 144 | yc.util.correctRotation = function(node){ 145 | 146 | var ajustR = 0 ; 147 | 148 | // 从自己的父窗口开始 149 | while( node=node._parent ) 150 | { 151 | ajustR-= node.getRotation() ; 152 | } 153 | 154 | return ajustR ; 155 | } 156 | 157 | 158 | yc.util.dissolvedScene = function(node){ 159 | 160 | var children = node.getChildren() ; 161 | for(var i=children.length-1; i>=0; i--) 162 | { 163 | // 递归 164 | if( !('singleton' in children[i].constructor) || children[i].constructor.singleton ) 165 | { 166 | yc.util.dissolvedScene(children[i]) ; 167 | } 168 | 169 | // 解除 child 引用 170 | node.removeChild(children[i]) ; 171 | } 172 | } 173 | -------------------------------------------------------------------------------- /iframeSaveWorld.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 无标题文档 6 | 7 | 8 | 9 |
      10 | 11 | 12 | 13 | 14 | 15 |
      16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /jquery.json.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | // the code of this function is from 3 | // http://lucassmith.name/pub/typeof.html 4 | $.type = function(o) { 5 | var _toS = Object.prototype.toString; 6 | var _types = { 7 | 'undefined': 'undefined', 8 | 'number': 'number', 9 | 'boolean': 'boolean', 10 | 'string': 'string', 11 | '[object Function]': 'function', 12 | '[object RegExp]': 'regexp', 13 | '[object Array]': 'array', 14 | '[object Date]': 'date', 15 | '[object Error]': 'error' 16 | }; 17 | return _types[typeof o] || _types[_toS.call(o)] || (o ? 'object' : 'null'); 18 | }; 19 | // the code of these two functions is from mootools 20 | // http://mootools.net 21 | var $specialChars = { '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '"': '\\"', '\\': '\\\\' }; 22 | var $replaceChars = function(chr) { 23 | return $specialChars[chr] || '\\u00' + Math.floor(chr.charCodeAt() / 16).toString(16) + (chr.charCodeAt() % 16).toString(16); 24 | }; 25 | $.toJSON = function(o) { 26 | var s = []; 27 | switch ($.type(o)) { 28 | case 'undefined': 29 | return 'undefined'; 30 | break; 31 | case 'null': 32 | return 'null'; 33 | break; 34 | case 'number': 35 | case 'boolean': 36 | case 'date': 37 | case 'function': 38 | return o.toString(); 39 | break; 40 | case 'string': 41 | return '"' + o.replace(/[\x00-\x1f\\"]/g, $replaceChars) + '"'; 42 | break; 43 | case 'array': 44 | for (var i = 0, l = o.length; i < l; i++) { 45 | s.push($.toJSON(o[i])); 46 | } 47 | return '[' + s.join(',') + ']'; 48 | break; 49 | case 'error': 50 | case 'object': 51 | for (var p in o) { 52 | s.push('"' + p.replace(/[\x00-\x1f\\"]/g, $replaceChars) + '"' + ':' + $.toJSON(o[p])); 53 | } 54 | return '{' + s.join(',') + '}'; 55 | break; 56 | default: 57 | return ''; 58 | break; 59 | } 60 | }; 61 | $.evalJSON = function(s) { 62 | if ($.type(s) != 'string' || !s.length) return null; 63 | return eval('(' + s + ')'); 64 | }; 65 | })(jQuery); -------------------------------------------------------------------------------- /jquery.ui/images/expand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/jquery.ui/images/expand.png -------------------------------------------------------------------------------- /jquery.ui/images/pbar-ani.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/jquery.ui/images/pbar-ani.gif -------------------------------------------------------------------------------- /jquery.ui/images/ui-bg_diagonals-thick_18_b81900_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/jquery.ui/images/ui-bg_diagonals-thick_18_b81900_40x40.png -------------------------------------------------------------------------------- /jquery.ui/images/ui-bg_diagonals-thick_20_666666_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/jquery.ui/images/ui-bg_diagonals-thick_20_666666_40x40.png -------------------------------------------------------------------------------- /jquery.ui/images/ui-bg_flat_10_000000_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/jquery.ui/images/ui-bg_flat_10_000000_40x100.png -------------------------------------------------------------------------------- /jquery.ui/images/ui-bg_glass_100_f6f6f6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/jquery.ui/images/ui-bg_glass_100_f6f6f6_1x400.png -------------------------------------------------------------------------------- /jquery.ui/images/ui-bg_glass_100_fdf5ce_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/jquery.ui/images/ui-bg_glass_100_fdf5ce_1x400.png -------------------------------------------------------------------------------- /jquery.ui/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/jquery.ui/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /jquery.ui/images/ui-bg_gloss-wave_35_f6a828_500x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/jquery.ui/images/ui-bg_gloss-wave_35_f6a828_500x100.png -------------------------------------------------------------------------------- /jquery.ui/images/ui-bg_highlight-soft_100_eeeeee_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/jquery.ui/images/ui-bg_highlight-soft_100_eeeeee_1x100.png -------------------------------------------------------------------------------- /jquery.ui/images/ui-bg_highlight-soft_75_ffe45c_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/jquery.ui/images/ui-bg_highlight-soft_75_ffe45c_1x100.png -------------------------------------------------------------------------------- /jquery.ui/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/jquery.ui/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /jquery.ui/images/ui-icons_228ef1_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/jquery.ui/images/ui-icons_228ef1_256x240.png -------------------------------------------------------------------------------- /jquery.ui/images/ui-icons_ef8c08_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/jquery.ui/images/ui-icons_ef8c08_256x240.png -------------------------------------------------------------------------------- /jquery.ui/images/ui-icons_ffd27a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/jquery.ui/images/ui-icons_ffd27a_256x240.png -------------------------------------------------------------------------------- /jquery.ui/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/jquery.ui/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /jquery.ui/images/uibtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/jquery.ui/images/uibtn.png -------------------------------------------------------------------------------- /jquery.ui/images/uitit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/jquery.ui/images/uitit.jpg -------------------------------------------------------------------------------- /res/CellMembran.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/CellMembran.png -------------------------------------------------------------------------------- /res/CloseNormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/CloseNormal.png -------------------------------------------------------------------------------- /res/CloseSelected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/CloseSelected.png -------------------------------------------------------------------------------- /res/Goal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/Goal.png -------------------------------------------------------------------------------- /res/Static_poly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/Static_poly.png -------------------------------------------------------------------------------- /res/Stone_poly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/Stone_poly.png -------------------------------------------------------------------------------- /res/Wood_poly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/Wood_poly.png -------------------------------------------------------------------------------- /res/b_bg_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/b_bg_1.png -------------------------------------------------------------------------------- /res/b_bg_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/b_bg_2.jpg -------------------------------------------------------------------------------- /res/b_bgtop_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/b_bgtop_1.png -------------------------------------------------------------------------------- /res/b_qiu_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/b_qiu_1.png -------------------------------------------------------------------------------- /res/b_wuzi_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/b_wuzi_1.jpg -------------------------------------------------------------------------------- /res/b_wuzi_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/b_wuzi_2.jpg -------------------------------------------------------------------------------- /res/b_wuzi_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/b_wuzi_3.jpg -------------------------------------------------------------------------------- /res/b_wuzi_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/b_wuzi_4.jpg -------------------------------------------------------------------------------- /res/background/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/background/bg.png -------------------------------------------------------------------------------- /res/bg200x300.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/bg200x300.png -------------------------------------------------------------------------------- /res/bg300x200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/bg300x200.png -------------------------------------------------------------------------------- /res/btn-back-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/btn-back-1.png -------------------------------------------------------------------------------- /res/btn-back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/btn-back.png -------------------------------------------------------------------------------- /res/btn-composition-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/btn-composition-light.png -------------------------------------------------------------------------------- /res/btn-composition-selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/btn-composition-selected.png -------------------------------------------------------------------------------- /res/btn-composition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/btn-composition.png -------------------------------------------------------------------------------- /res/btn-main-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/btn-main-1.png -------------------------------------------------------------------------------- /res/btn-main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/btn-main.png -------------------------------------------------------------------------------- /res/btn-no-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/btn-no-1.png -------------------------------------------------------------------------------- /res/btn-no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/btn-no.png -------------------------------------------------------------------------------- /res/btn-pause-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/btn-pause-1.png -------------------------------------------------------------------------------- /res/btn-pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/btn-pause.png -------------------------------------------------------------------------------- /res/btn-sound-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/btn-sound-off.png -------------------------------------------------------------------------------- /res/btn-sound-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/btn-sound-on.png -------------------------------------------------------------------------------- /res/btn-yes-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/btn-yes-1.png -------------------------------------------------------------------------------- /res/btn-yes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/btn-yes.png -------------------------------------------------------------------------------- /res/building/Bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/Bullet.png -------------------------------------------------------------------------------- /res/building/addbuild.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/addbuild.png -------------------------------------------------------------------------------- /res/building/bottles-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/bottles-l.png -------------------------------------------------------------------------------- /res/building/bottles-nm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/bottles-nm.png -------------------------------------------------------------------------------- /res/building/bottles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/bottles.png -------------------------------------------------------------------------------- /res/building/build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/build.png -------------------------------------------------------------------------------- /res/building/cannon-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/cannon-l.png -------------------------------------------------------------------------------- /res/building/cannon-nm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/cannon-nm.png -------------------------------------------------------------------------------- /res/building/cannon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/cannon.png -------------------------------------------------------------------------------- /res/building/dec_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/dec_bg.png -------------------------------------------------------------------------------- /res/building/eye-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/eye-l.png -------------------------------------------------------------------------------- /res/building/eye-nm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/eye-nm.png -------------------------------------------------------------------------------- /res/building/eye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/eye.png -------------------------------------------------------------------------------- /res/building/factory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/factory.png -------------------------------------------------------------------------------- /res/building/grow-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/grow-l.png -------------------------------------------------------------------------------- /res/building/grow-nm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/grow-nm.png -------------------------------------------------------------------------------- /res/building/grow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/grow.png -------------------------------------------------------------------------------- /res/building/jetter-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/jetter-l.png -------------------------------------------------------------------------------- /res/building/jetter-nm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/jetter-nm.png -------------------------------------------------------------------------------- /res/building/jetter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/jetter.png -------------------------------------------------------------------------------- /res/building/oshooter-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/oshooter-l.png -------------------------------------------------------------------------------- /res/building/oshooter-nm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/oshooter-nm.png -------------------------------------------------------------------------------- /res/building/oshooter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/oshooter.png -------------------------------------------------------------------------------- /res/building/power-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/power-l.png -------------------------------------------------------------------------------- /res/building/power-nm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/power-nm.png -------------------------------------------------------------------------------- /res/building/power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/power.png -------------------------------------------------------------------------------- /res/building/recycle-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/recycle-l.png -------------------------------------------------------------------------------- /res/building/recycle-nm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/recycle-nm.png -------------------------------------------------------------------------------- /res/building/recycle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/recycle.png -------------------------------------------------------------------------------- /res/building/remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/remove.png -------------------------------------------------------------------------------- /res/building/rocket-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/rocket-l.png -------------------------------------------------------------------------------- /res/building/rocket-nm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/rocket-nm.png -------------------------------------------------------------------------------- /res/building/rocket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/rocket.png -------------------------------------------------------------------------------- /res/building/shooter-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/shooter-l.png -------------------------------------------------------------------------------- /res/building/shooter-nm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/shooter-nm.png -------------------------------------------------------------------------------- /res/building/shooter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/shooter.png -------------------------------------------------------------------------------- /res/building/slower-l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/slower-l.png -------------------------------------------------------------------------------- /res/building/slower-nm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/slower-nm.png -------------------------------------------------------------------------------- /res/building/slower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/slower.png -------------------------------------------------------------------------------- /res/building/tower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/tower.png -------------------------------------------------------------------------------- /res/building/up_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/building/up_1.png -------------------------------------------------------------------------------- /res/cellshell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/cellshell.png -------------------------------------------------------------------------------- /res/cocos20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/cocos20.png -------------------------------------------------------------------------------- /res/cocos64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/cocos64.png -------------------------------------------------------------------------------- /res/dashboard/HP_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/dashboard/HP_bg.png -------------------------------------------------------------------------------- /res/dashboard/HP_hp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/dashboard/HP_hp.png -------------------------------------------------------------------------------- /res/dashboard/HP_hp_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/dashboard/HP_hp_bg.png -------------------------------------------------------------------------------- /res/dashboard/dashboard_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/dashboard/dashboard_bg.png -------------------------------------------------------------------------------- /res/deselect-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/deselect-1.png -------------------------------------------------------------------------------- /res/deselect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/deselect.png -------------------------------------------------------------------------------- /res/dna-icons-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/dna-icons-16.png -------------------------------------------------------------------------------- /res/dna-icons-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/dna-icons-32.png -------------------------------------------------------------------------------- /res/fire.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/fire.png -------------------------------------------------------------------------------- /res/level-flag-flash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/level-flag-flash.png -------------------------------------------------------------------------------- /res/level-flag-gr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/level-flag-gr.png -------------------------------------------------------------------------------- /res/level-flag-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/level-flag-normal.png -------------------------------------------------------------------------------- /res/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/logo.png -------------------------------------------------------------------------------- /res/mainscene/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/mainscene/background.jpg -------------------------------------------------------------------------------- /res/mainscene/cocos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/mainscene/cocos.png -------------------------------------------------------------------------------- /res/mainscene/electricity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/mainscene/electricity.png -------------------------------------------------------------------------------- /res/mainscene/freeworld.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/mainscene/freeworld.png -------------------------------------------------------------------------------- /res/mainscene/freeworld1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/mainscene/freeworld1.png -------------------------------------------------------------------------------- /res/mainscene/jindutiao_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/mainscene/jindutiao_bg.png -------------------------------------------------------------------------------- /res/mainscene/lb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/mainscene/lb.png -------------------------------------------------------------------------------- /res/mainscene/line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/mainscene/line.png -------------------------------------------------------------------------------- /res/mainscene/login_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/mainscene/login_bg.png -------------------------------------------------------------------------------- /res/mainscene/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/mainscene/logo.png -------------------------------------------------------------------------------- /res/mainscene/pao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/mainscene/pao.png -------------------------------------------------------------------------------- /res/mainscene/sina.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/mainscene/sina.png -------------------------------------------------------------------------------- /res/mainscene/sina1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/mainscene/sina1.png -------------------------------------------------------------------------------- /res/mainscene/story.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/mainscene/story.png -------------------------------------------------------------------------------- /res/mainscene/story1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/mainscene/story1.png -------------------------------------------------------------------------------- /res/mainscene/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/mainscene/test.png -------------------------------------------------------------------------------- /res/mainscene/test1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/mainscene/test1.png -------------------------------------------------------------------------------- /res/mainscene/world.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/mainscene/world.png -------------------------------------------------------------------------------- /res/mainscene/world1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/mainscene/world1.png -------------------------------------------------------------------------------- /res/map-c1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/map-c1.png -------------------------------------------------------------------------------- /res/menu/btn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/menu/btn.png -------------------------------------------------------------------------------- /res/menu/btn2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/menu/btn2.png -------------------------------------------------------------------------------- /res/menu/but.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/menu/but.png -------------------------------------------------------------------------------- /res/menu/dot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/menu/dot.png -------------------------------------------------------------------------------- /res/menu/mid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/menu/mid.png -------------------------------------------------------------------------------- /res/menu/top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/menu/top.png -------------------------------------------------------------------------------- /res/null-pinup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/null-pinup.png -------------------------------------------------------------------------------- /res/null.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/null.png -------------------------------------------------------------------------------- /res/organ/Bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/organ/Bullet.png -------------------------------------------------------------------------------- /res/organ/Msg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/organ/Msg.png -------------------------------------------------------------------------------- /res/organ/Tower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/organ/Tower.png -------------------------------------------------------------------------------- /res/pin_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/pin_map.png -------------------------------------------------------------------------------- /res/role/boss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/role/boss.png -------------------------------------------------------------------------------- /res/role/role.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/role/role.png -------------------------------------------------------------------------------- /res/role/virus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/role/virus.png -------------------------------------------------------------------------------- /res/skill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/skill.png -------------------------------------------------------------------------------- /res/skill/bottles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/skill/bottles.png -------------------------------------------------------------------------------- /res/skill/outsideShooter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/skill/outsideShooter.png -------------------------------------------------------------------------------- /res/skill/rocket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/skill/rocket.png -------------------------------------------------------------------------------- /res/skillbj.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/skillbj.png -------------------------------------------------------------------------------- /res/smoke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/smoke.png -------------------------------------------------------------------------------- /res/sound/Attack01.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/sound/Attack01.ogg -------------------------------------------------------------------------------- /res/sound/Beam01.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/sound/Beam01.ogg -------------------------------------------------------------------------------- /res/sound/Bom01.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/sound/Bom01.ogg -------------------------------------------------------------------------------- /res/sound/Elec01.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/sound/Elec01.ogg -------------------------------------------------------------------------------- /res/sound/Fire05.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/sound/Fire05.ogg -------------------------------------------------------------------------------- /res/sound/Hit08.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/sound/Hit08.ogg -------------------------------------------------------------------------------- /res/sound/WarpOut.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/sound/WarpOut.ogg -------------------------------------------------------------------------------- /res/sound/Water02.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/sound/Water02.ogg -------------------------------------------------------------------------------- /res/sound/Wind06.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/sound/Wind06.ogg -------------------------------------------------------------------------------- /res/sound/catch.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/sound/catch.mp3 -------------------------------------------------------------------------------- /res/sound/music/Arrivee-distante.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/sound/music/Arrivee-distante.mp3 -------------------------------------------------------------------------------- /res/sound/music/Confiant.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/sound/music/Confiant.mp3 -------------------------------------------------------------------------------- /res/sound/music/Desert.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/sound/music/Desert.mp3 -------------------------------------------------------------------------------- /res/sound/music/Hors-du-grenier.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/sound/music/Hors-du-grenier.mp3 -------------------------------------------------------------------------------- /res/sound/music/Parmi-les-automates.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/sound/music/Parmi-les-automates.mp3 -------------------------------------------------------------------------------- /res/sound/music/bardo.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/sound/music/bardo.mp3 -------------------------------------------------------------------------------- /res/star2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/star2.png -------------------------------------------------------------------------------- /res/star3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/star3.png -------------------------------------------------------------------------------- /res/victory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/victory.png -------------------------------------------------------------------------------- /res/weibo_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/weibo_login.png -------------------------------------------------------------------------------- /res/xibaohecheng.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeCat/games-icell/fcbd71d89f09e97bb143a8593f53e925dddccfd3/res/xibaohecheng.png -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | /* CSS reset */ 5 | body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, textarea, p, blockquote, th, td { 6 | margin:0; 7 | padding:0; 8 | } 9 | table { 10 | border-collapse:collapse; 11 | border-spacing:0; 12 | } 13 | fieldset, img { 14 | border:0; 15 | } 16 | address, caption, cite, code, dfn, em, strong, th, var, i { 17 | font-style:normal; 18 | font-weight:normal; 19 | } 20 | ol, ul { 21 | list-style:none; 22 | } 23 | caption, th { 24 | text-align:left; 25 | } 26 | h1, h5, h6 { 27 | font-size:100%; 28 | font-weight:normal; 29 | } 30 | q:before, q:after { 31 | content:''; 32 | } 33 | abbr, acronym { 34 | border:0; 35 | } 36 | img { 37 | color: transparent; 38 | font-size: 0; 39 | vertical-align: middle; 40 | -ms-interpolation-mode: bicubic;/*Only fot IE7*/ 41 | } 42 | b, strong { 43 | /* 44 | Makes browsers agree. 45 | IE + Opera = font-weight: bold. 46 | Gecko + WebKit = font-weight: bolder. 47 | */ 48 | font-weight: bold; 49 | } 50 | *:focus { 51 | /* 去掉获得焦点时出现的虚线框 */ 52 | outline: none; 53 | } 54 | textarea { 55 | /* chrome 不允许 textarea 可更改大小 */ 56 | resize:none; 57 | } 58 | .clearfix:after { 59 | clear: both; 60 | content: "."; 61 | display: block; 62 | height: 0; 63 | visibility: hidden; 64 | } 65 | .clearfix { 66 | display: inline-block; 67 | } 68 | * html .clearfix { 69 | height: 1%; 70 | } 71 | .clearfix { 72 | display: block; 73 | } 74 | .clear { 75 | clear: both; 76 | display: block; 77 | overflow: hidden; 78 | visibility: hidden; 79 | width: 0; 80 | height: 0; 81 | } 82 | 83 | /* CSS reset */ 84 | 85 | 86 | html{ 87 | overflow-x: hidden; overflow-y: hidden; 88 | } 89 | 90 | body{ 91 | background: #aaaaaa; 92 | margin: 0px; 93 | } 94 | 95 | .ui-progressbar .ui-progressbar-value { 96 | background-image: url(jquery.ui/images/pbar-ani.gif); 97 | margin: 0px; 98 | } 99 | 100 | #aminoacid-dashboard { 101 | margin-top: 10px; 102 | } 103 | #aminoacid-dashboard .aminoacid-num{ 104 | margin-bottom: 10px; 105 | } 106 | 107 | #protein-pool-dashboard{ 108 | margin-top: 10px; 109 | } 110 | #protein-pool-dashboard .protein-num { 111 | margin-bottom: 10px; 112 | } 113 | 114 | #dialog-protein-composite{ 115 | background-color: #dedede ; 116 | padding: 10px ; 117 | } 118 | .protein-formula{ 119 | margin-top: 5px ; 120 | } 121 | 122 | 123 | .bulding-menu{ 124 | width: 300px ; 125 | padding: 10px ; 126 | background-color: #cdcdcd ; 127 | } 128 | 129 | .bulding-items{ 130 | clear: both ; 131 | } 132 | .bulding-menu h3{ 133 | float: left ; 134 | } 135 | .bulding-menu .btn-close{ 136 | float: right ; 137 | } 138 | 139 | .bulding-upgrader{ 140 | padding-top: 15px ; 141 | font-size: 10px ; 142 | } 143 | .bulding-create{ 144 | padding-top: 15px ; 145 | font-size: 10px ; 146 | } 147 | 148 | 149 | #dialog-killboss-reward{ 150 | width: 300px ; 151 | padding: 10px ; 152 | background-color: #cdcdcd ; 153 | } 154 | .reward-gene{ 155 | width: 150px ; 156 | float:left ; 157 | } 158 | 159 | #ui-levels-selector { 160 | position:absolute; 161 | display:none; 162 | width: 300px ; 163 | padding: 10px ; 164 | background-color: #cdcdcd ; 165 | } 166 | 167 | #ui-levels-selector-menu{ 168 | display: none; 169 | } 170 | 171 | #worldListDiv{ 172 | display: none; 173 | position: relative; 174 | } 175 | 176 | #worldListDiv .worldListDiv_thumb{ 177 | width:160px; 178 | height:90px; 179 | } 180 | 181 | #worldListDiv_title h2{ 182 | display: block; 183 | width:500px; 184 | } 185 | 186 | #worldListDiv_newMapBtn{ 187 | display:block; 188 | float:right; 189 | } -------------------------------------------------------------------------------- /users.js: -------------------------------------------------------------------------------- 1 | yc.oauth = {}; 2 | yc.oauth.weibo = function(){ 3 | 4 | this.login = function( callback){ 5 | thisb = this; 6 | WB2.login( function(){ 7 | thisb.getUserInfo(function( o){ 8 | callback(o); 9 | }); 10 | }); 11 | } , 12 | this.logout = function( callback){ 13 | WB2.logout( callback); 14 | } , 15 | this.checkLogin = function( ){ 16 | return WB2.checkLogin(); 17 | } , 18 | this.getUserInfo = function( callback){ 19 | WB2.anyWhere( 20 | function(W) 21 | { 22 | W.parseCMD("/account/get_uid.json", function(sResult, bStatus){ 23 | W.parseCMD("/users/show.json", function(sResult2, bStatus2){ 24 | callback( {id:sResult2.id , service:'weibo'}) ; 25 | },{ 26 | uid : sResult.uid 27 | },{ 28 | method: 'get' 29 | }); 30 | },{ 31 | 32 | },{ 33 | method: 'get' 34 | }); 35 | } 36 | ); 37 | } , 38 | this.publish = function( string){ 39 | WB2.anyWhere( 40 | function(W) 41 | { 42 | W.parseCMD("/statuses/update.json", function(sResult, bStatus){ 43 | 44 | },{ 45 | status : string 46 | },{ 47 | method: 'POST' 48 | }); 49 | } 50 | ); 51 | } 52 | } 53 | 54 | function loginCallback(data){ 55 | icell_userInfo = data; 56 | if(!icell_userInfo){ 57 | // $("#ui-levels-selector-login").append("login error"); 58 | alert("login error"); 59 | return; 60 | } 61 | 62 | var username = icell_userInfo; 63 | 64 | // $("#login_error_msg").remove(); 65 | 66 | // $("#ui-levels-selector-login").html("

      "+username+"

      "); 67 | 68 | // $("#ui-levels-selector-menu").stop(false,true).slideDown(600); 69 | } 70 | 71 | function unEncryptUserInfo(icell_userInfo){ 72 | var userInfo = icell_userInfo.split('#'); 73 | return {'uid':userInfo[0],'service':userInfo[1]}; 74 | } 75 | 76 | --------------------------------------------------------------------------------