计算机网络面试常见问题,Cocos Creator 入门篇-描摹小游戏,那些进了大厂的程序员面试前都做了哪些准备

部署运行你感兴趣的模型镜像
//获取坐标点

getXYPoints (num) {

    return this.arr[num]

},

});




*   mmGraphics.js 描摹的画笔实现



cc.Class({

extends: cc.Component,



properties: {

    touchNode: {

        default: null,

        type: cc.Node,

        tooltip: '绘制点(箭头)'

    },



    guijiNode: {

        default: null,

        type: cc.Node,

        tooltip: '描摹区域'

    },

    isMiaoMobg: {

        default: false,

        type: Boolean,

        tooltip: '是否作为描摹的底层'

    },

    isAudioGetGj: {

        default: false,

        type: Boolean,

        tooltip: '是否能自动描摹获取轨迹坐标点'

    }

},



// LIFE-CYCLE CALLBACKS:



onLoad() {

    console.log(this.guijiNode);

    let miaomoNum = 2;

    // alert(1);

    this.arr = this.guijiNode.getComponent("guiji").getXYPoints(miaomoNum);

    this.gj = this.guijiNode.getComponent("guiji").getGj(miaomoNum);

},





start() {

    cc.log("画笔开始绘制");

    this.graphics = this.getComponent(cc.Graphics);

    let lv = 1;



    if (this.isMiaoMobg) {//绘制描摹底部

        for (let index = 0; index < this.gj.length; index++) {

            const element = this.gj[index];

            if (element.type === "moveto") {

                this.graphics.moveTo(element.point01.x, element.point01.y);

            } else if (element.type === "bezier") {

                this.graphics.bezierCurveTo(element.point01.x, element.point01.y, element.point02.x, element.point02.y, element.point03.x, element.point03.y);

            } else if (element.type === "lineto") {

                this.graphics.lineTo(element.point01.x, element.point01.y)

            }

        }

        this.graphics.stroke();

    } else {

        if (this.isAudioGetGj) {

            this.actionRun = true;

            this.index = 0;

            this.loadArr = [];



            this.touchNode.x = this.gj[0].point01.x;

            this.touchNode.y = this.gj[0].point01.y;



            let seq = cc.callFunc(() => {



            }, this);



            for (let index = 0; index < this.gj.length; index++) {

                const element = this.gj[index];

                if (element.type === "moveto") {

                    cc.log("moveto: " + element.point01.x + "   " + element.point01.y)

                } else if (element.type === "bezier") {

                    let bezier = [element.point01, element.point02, element.point03];

                    let bezierTo = cc.bezierTo(element.time, bezier);

                    seq = cc.sequence(seq, bezierTo)

                } else if (element.type === "lineto") {

                    let moveTo = cc.moveTo(element.time, element.point01);

                    seq = cc.sequence(seq, moveTo)

                }

            }



            let callFunc = cc.callFunc(() => {

                this.actionRun = false;



                cc.log(JSON.stringify(this.loadArr));

            }, this);



            seq = cc.sequence(seq, callFunc);



            this.touchNode.runAction(seq);

        }

    }



},



update(dt) {

    if (this.isAudioGetGj) {

        if (!this.isMiaoMobg && this.actionRun) {

            // cc.log("this.touchNode update: "+this.touchNode.x+"   "+this.touchNode.y)

            this.loadArr[this.index] = cc.v2(Math.round(this.touchNode.x * 100) / 100, Math.round(this.touchNode.y * 100) / 100)



            this.index += 1

        }

    }

},



setPos(index) {

    if (this.isMiaoMobg) {

        return

    }



    for (let a = this.newIndex; a < index; a++) {



        const elementold = this.arr[a - 1] || this.arr[a];

        const elementnew = this.arr[a];



        this.graphics.moveTo(elementold.x, elementold.y);



        this.graphics.lineTo(elementnew.x, elementnew.y);



        this.graphics.stroke();

        this.graphics.fill();

    }



    this.newIndex = index;





},



clearDraw() {

    this.graphics.clear();

    // this.touchNode.x = this.arr[0].x

    // this.touchNode.y = this.arr[0].y

    this.touchNode.x = this.gj[0].point01.x;

    this.touchNode.y = this.gj[0].point01.y;

}



// update (dt) {},

});




*   mmTouch.js 处理用户触摸实现描摹



cc.Class({

extends: cc.Component,



properties: {

    //描摹的画笔

    graphicsNode: {

        default: null,

        type: cc.Node,

        tooltip: '用来描摹的画笔'

    },



    //在那个区域描摹

    guijiNode: {

        default: null,

        type: cc.Node,

        tooltip: '轨迹所在区域'

    }

},





onLoad() {

    let miaomoNum = 2;//描摹2



    //获取描摹2需要的轨迹点

    this.arr = this.guijiNode.getComponent("guiji").getXYPoints(miaomoNum);

},

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数Java工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
img
img
img
img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Java开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新

如果你觉得这些内容对你有帮助,可以添加V获取:vip1024b (备注Java)
img

总结

总体来说,如果你想转行从事程序员的工作,Java开发一定可以作为你的第一选择。但是不管你选择什么编程语言,提升自己的硬件实力才是拿高薪的唯一手段。

如果你以这份学习路线来学习,你会有一个比较系统化的知识网络,也不至于把知识学习得很零散。我个人是完全不建议刚开始就看《Java编程思想》、《Java核心技术》这些书籍,看完你肯定会放弃学习。建议可以看一些视频来学习,当自己能上手再买这些书看又是非常有收获的事了。

一个人可以走的很快,但一群人才能走的更远。如果你从事以下工作或对以下感兴趣,欢迎戳这里加入程序员的圈子,让我们一起学习成长!

AI人工智能、Android移动开发、AIGC大模型、C C#、Go语言、Java、Linux运维、云计算、MySQL、PMP、网络安全、Python爬虫、UE5、UI设计、Unity3D、Web前端开发、产品经理、车载开发、大数据、鸿蒙、计算机网络、嵌入式物联网、软件测试、数据结构与算法、音视频开发、Flutter、IOS开发、PHP开发、.NET、安卓逆向、云计算

频来学习,当自己能上手再买这些书看又是非常有收获的事了。

[外链图片转存中…(img-A6UOgB8G-1712542261360)]

一个人可以走的很快,但一群人才能走的更远。如果你从事以下工作或对以下感兴趣,欢迎戳这里加入程序员的圈子,让我们一起学习成长!

AI人工智能、Android移动开发、AIGC大模型、C C#、Go语言、Java、Linux运维、云计算、MySQL、PMP、网络安全、Python爬虫、UE5、UI设计、Unity3D、Web前端开发、产品经理、车载开发、大数据、鸿蒙、计算机网络、嵌入式物联网、软件测试、数据结构与算法、音视频开发、Flutter、IOS开发、PHP开发、.NET、安卓逆向、云计算

您可能感兴趣的与本文相关的镜像

Linly-Talker

Linly-Talker

AI应用

Linly-Talker是一款创新的数字人对话系统,它融合了最新的人工智能技术,包括大型语言模型(LLM)、自动语音识别(ASR)、文本到语音转换(TTS)和语音克隆技术

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值