zoukankan      html  css  js  c++  java
  • cocos 简便斗地主发牌动画

    niuniuSend : function (int) {
    switch(int)
    {
    case 0:
    for(var i=0;i<5;i++){
    var sp = new ccui.ImageView("cards/card_a1.png", ccui.Widget.PLIST_TEXTURE);
    sp.setPosition(cc.p(cc.winSize.width / 2, cc.winSize.height / 2));
    sp.setScale(0.8);
    this.addChild(sp);
    var bezier = [cc.p(cc.winSize.width / 2, cc.winSize.height / 2 ), cc.p(cc.winSize.width / 2 - 200+(i*80) , cc.winSize.height / 2), cc.p((cc.winSize.width / 2-150) +(i*80), 100)];
    sp.runAction(cc.sequence(cc.spawn(cc.delayTime(1+(i/20)),cc.bezierTo(1, bezier))));
    }
    this.niuniuSend(1);
    break;
    case 1:
    for(var i=0;i<5;i++){
    var sp = new ccui.ImageView("cards/card_a1.png", ccui.Widget.PLIST_TEXTURE);
    sp.setPosition(cc.p(cc.winSize.width / 2, cc.winSize.height / 2 ));
    sp.setScale(0.5);
    this.addChild(sp);
    var bezier = [cc.p(cc.winSize.width / 2, cc.winSize.height / 2 ), cc.p(cc.winSize.width / 2 + 300 , cc.winSize.height / 2 + 300), cc.p(cc.winSize.width / 2 + 700 -(i*50), cc.winSize.height/2)];
    sp.runAction(cc.sequence(cc.spawn(cc.delayTime(1+(i/20)),cc.bezierTo(1,bezier ))));
    }
    this.niuniuSend(2);
    break;
    case 2:
    for(var i=0;i<5;i++){
    var sp = new ccui.ImageView("cards/card_a1.png", ccui.Widget.PLIST_TEXTURE);
    sp.setPosition(cc.p(cc.winSize.width / 2, cc.winSize.height / 2 ));
    sp.setScale(0.5);
    this.addChild(sp);
    var bezier = [cc.p(cc.winSize.width / 2, cc.winSize.height / 2 ), cc.p(cc.winSize.width / 2 - 300 , cc.winSize.height / 2 + 300), cc.p(cc.winSize.width / 2 - 700 + (i*50), cc.winSize.height/2)];
    sp.runAction(cc.sequence(cc.spawn(cc.delayTime(1+(i/20)),cc.bezierTo(1,bezier ))));
    }
    break;

    default:
    break;
    }
    },
  • 相关阅读:
    Locust:简介和基本用法
    linux more less 用法
    Pytest测试用例之setup与teardown方法
    app测试之monkey
    理解yield以及和return的区别
    Python 数据驱动工具:DDT
    requests 使用 proxies 代理时ValueError: check_hostname requires server_hostname
    from urllib.parse import urlparse 使用
    linux 三剑客 使用总结 grep sed awk
    企查查和天眼查哪个好用
  • 原文地址:https://www.cnblogs.com/luorende/p/7797959.html
Copyright © 2011-2022 走看看