Code Monkey home page Code Monkey logo

lbxgame's Issues

请问下初始化游戏的时候向量是怎么计算的?

你的demo是个六角形的消除游戏,
我的项目是正方形的消除游戏8*8格,初始化的时候位置怎么调整呢

` //要加的单位向量
var addVec = cc.pMult(cc.pForAngle(240 * (2 * Math.PI / 360)), this["liubianxingH"] * 2)

    //偏移至源点0,0的向量
    var pianyiTo0p0Vec = cc.pMult(cc.pForAngle(120 * (2 * Math.PI / 360)), this["liubianxingH"] * 2 * 4)


    var frameList = []

    var fPosList = []
        //一列列来生成
    for (var i = 0; i < posList.length; i++) {
        var count = posList[i].count //数量
        var oneSrcPos = cc.pAdd(posList[i].srcPos, pianyiTo0p0Vec) //起始位置
        var aimPos = cc.pAdd(srcPos, oneSrcPos) //一条的起始位置

        for (var j = 0; j < count; j++) {
            var fPos = cc.pAdd(aimPos, cc.pMult(addVec, j))
            fPosList.push(fPos)
        }
    }`

六边形消除

您好,我想请问一下六边形消除用cocos2d-x该怎么实现呢?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.