【机器人小游戏---html(附源代码)】,2024年最新自学编程找工作容易吗

先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前阿里P7

深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年最新Web前端全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
img
img
img
img
img
img

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

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

如果你需要这些资料,可以添加V获取:vip1024c (备注前端)
img

正文

const dx = p0.x - p1.x;

const dy = p0.y - p1.y;

const dist = Math.sqrt(dx * dx + dy * dy);

if (dist) {

const tw = p0.w + p1.w;

const r1 = p1.w / tw;

const r0 = p0.w / tw;

const dz = (link.distance - dist) * link.force;

const sx = dx / dist * dz;

const sy = dy / dist * dz;

p1.x -= sx * r0;

p1.y -= sy * r0;

p0.x += sx * r1;

p0.y += sy * r1;

}

}

// ---- update points ----

for (const point of this.points) {

// ---- dragging ----

if (this === dancerDrag && point === pointDrag) {

point.x += (pointer.x - point.x) * 0.1;

point.y += (pointer.y - point.y) * 0.1;

}

// ---- dance ----

if (this !== dancerDrag) {

point.fn && point.fn(16 * Math.sqrt(this.size), this.dir);

}

// ---- verlet integration ----

point.vx = point.x - point.px;

point.vy = point.y - point.py;

point.px = point.x;

point.py = point.y;

point.vx *= 0.995;

point.vy *= 0.995;

point.x += point.vx;

point.y += point.vy + 0.01;

}

// ---- ground ----

for (const link of this.links) {

const p1 = link.p1;

if (p1.y > canvas.height * ground - link.size * 0.5) {

p1.y = canvas.height * ground - link.size * 0.5;

p1.x -= p1.vx;

p1.vx = 0;

p1.vy = 0;

}

}

// ---- center position ----

const delta = (this.x - this.points[0].x) * 0.0002;

this.points[9].x += delta;

this.points[10].x += delta;

}

draw() {

for (const link of this.links) {

if (link.size) {

const dx = link.p1.x - link.p0.x;

const dy = link.p1.y - link.p0.y;

const a = Math.atan2(dy, dx);

const d = Math.sqrt(dx * dx + dy * dy);

// ---- shadow ----

ctx.save();

ctx.translate(link.p0.x + link.size * 0.25, link.p0.y + link.size * 0.25);

ctx.rotate(a);

ctx.drawImage(

link.shadow,

-link.size * 0.5,

-link.size * 0.5,

d + link.size,

link.size

);

ctx.restore();

// ---- stroke ----

ctx.save();

ctx.translate(link.p0.x, link.p0.y);

ctx.rotate(a);

ctx.drawImage(

link.image,

-link.size * 0.5,

-link.size * 0.5,

d + link.size,

link.size

);

ctx.restore();

}

}

}

}

Robot.Link = class Link {

constructor(parent, p0, p1, dist, size, light, force, disk) {

// ---- cache strokes ----

function stroke(color, axis) {

const image = document.createElement(“canvas”);

image.width = dist + size;

image.height = size;

const ict = image.getContext(“2d”);

ict.beginPath();

ict.lineCap = “round”;

ict.lineWidth = size;

ict.strokeStyle = color;

if (disk) {

ict.arc(size * 0.5 + dist, size * 0.5, size * 0.5, 0, 2 * Math.PI);

ict.fillStyle = color;

ict.fill();

} else {

ict.moveTo(size * 0.5, size * 0.5);

ict.lineTo(size * 0.5 + dist, size * 0.5);

ict.stroke();

}

if (axis) {

const s = size / 10;

ict.fillStyle = “#000”;

ict.fillRect(size * 0.5 - s, size * 0.5 - s, s * 2, s * 2);

ict.fillRect(size * 0.5 - s + dist, size * 0.5 - s, s * 2, s * 2);

}

return image;

}

this.p0 = p0;

this.p1 = p1;

this.distance = dist;

this.size = size;

this.light = light || 1.0;

this.force = force || 0.5;

this.image = stroke(

“hsl(” + parent.color + " ,30%, " + parent.light * this.light + “%)”,

true

);

this.shadow = stroke(“rgba(0,0,0,0.5)”);

}

};

Robot.Point = class Point {

constructor(x, y, fn, w) {

this.x = x;

this.y = y;

this.w = w || 0.5;

this.fn = fn || null;

this.px = x;

this.py = y;

this.vx = 0.0;

this.vy = 0.0;

}

};

// ---- set canvas ----

const canvas = {

init() {

this.elem = document.querySelector(“canvas”);

this.resize();

window.addEventListener(“resize”, () => this.resize(), false);

return this.elem.getContext(“2d”);

},

resize() {

this.width = this.elem.width = this.elem.offsetWidth;

this.height = this.elem.height = this.elem.offsetHeight;

ground = this.height > 500 ? 0.85 : 1.0;

for (let i = 0; i < dancers.length; i++) {

dancers[i].x = (i + 2) * canvas.width / 9;

}

}

};

// ---- set pointer ----

const pointer = {

init(canvas) {

this.x = 0;

this.y = 0;

window.addEventListener(“mousemove”, e => this.move(e), false);

canvas.elem.addEventListener(“touchmove”, e => this.move(e), false);

window.addEventListener(“mousedown”, e => this.down(e), false);

window.addEventListener(“touchstart”, e => this.down(e), false);

window.addEventListener(“mouseup”, e => this.up(e), false);

window.addEventListener(“touchend”, e => this.up(e), false);

},

down(e) {

this.move(e);

for (const dancer of dancers) {

for (const point of dancer.points) {

const dx = pointer.x - point.x;

const dy = pointer.y - point.y;

const d = Math.sqrt(dx * dx + dy * dy);

if (d < 60) {

dancerDrag = dancer;

pointDrag = point;

dancer.frame = 0;

}

}

}

},

up(e) {

dancerDrag = null;

},

move(e) {

let touchMode = e.targetTouches,

pointer;

if (touchMode) {

e.preventDefault();

pointer = touchMode[0];

} else pointer = e;

this.x = pointer.clientX;

this.y = pointer.clientY;

}

};

// ---- init ----

const dancers = [];

let ground = 1.0;

const ctx = canvas.init();

pointer.init(canvas);

let dancerDrag = null;

let pointDrag = null;

// ---- main loop ----

const run = () => {

requestAnimationFrame(run);

ctx.clearRect(0, 0, canvas.width, canvas.height);

ctx.fillStyle = “#222”;

ctx.fillRect(0, 0, canvas.width, canvas.height * 0.15);

ctx.fillRect(0, canvas.height * 0.85, canvas.width, canvas.height * 0.15);

for (const dancer of dancers) {

dancer.update();

dancer.draw();

}

};

// ---- robot structure ----

const struct = {

points: [

{

x: 0,

y: -4,

f(s, d) {

this.y -= 0.01 * s;

}

},

{

x: 0,

y: -16,

f(s, d) {

this.y -= 0.02 * s * d;

}

},

{

x: 0,

y: 12,

f(s, d) {

this.y += 0.02 * s * d;

}

},

{ x: -12, y: 0 },

{ x: 12, y: 0 },

{

x: -3,

y: 34,

f(s, d) {

if (d > 0) {

this.x += 0.01 * s;

this.y -= 0.015 * s;

} else {

this.y += 0.02 * s;

}

}

},

{

x: 3,

y: 34,

f(s, d) {

if (d > 0) {

this.y += 0.02 * s;

} else {

this.x -= 0.01 * s;

this.y -= 0.015 * s;

}

}

},

{

x: -28,

y: 0,

f(s, d) {

this.x += this.vx * 0.035;

this.y -= 0.001 * s;

}

},

{

x: 28,

y: 0,

总结

前端资料汇总

  • 框架原理真的深入某一部分具体的代码和实现方式时,要多注意到细节,不要只能写出一个框架。

  • 算法方面很薄弱的,最好多刷一刷,不然影响你的工资和成功率😯

  • 在投递简历之前,最好通过各种渠道找到公司内部的人,先提前了解业务,也可以帮助后期优秀 offer 的决策。

  • 要勇于说不,对于某些 offer 待遇不满意、业务不喜欢,应该相信自己,不要因为当下没有更好的 offer 而投降,一份工作短则一年长则 N 年,为了幸福生活要慎重选择!!!
    喜欢这篇文章文章的小伙伴们点赞+转发支持,你们的支持是我最大的动力!

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化的资料的朋友,可以添加V获取:vip1024c (备注前端)
img

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
g.cn/img_convert/6e0ba223f65e063db5b1b4b6aa26129a.png)

  • 框架原理真的深入某一部分具体的代码和实现方式时,要多注意到细节,不要只能写出一个框架。

  • 算法方面很薄弱的,最好多刷一刷,不然影响你的工资和成功率😯

  • 在投递简历之前,最好通过各种渠道找到公司内部的人,先提前了解业务,也可以帮助后期优秀 offer 的决策。

  • 要勇于说不,对于某些 offer 待遇不满意、业务不喜欢,应该相信自己,不要因为当下没有更好的 offer 而投降,一份工作短则一年长则 N 年,为了幸福生活要慎重选择!!!
    喜欢这篇文章文章的小伙伴们点赞+转发支持,你们的支持是我最大的动力!

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化的资料的朋友,可以添加V获取:vip1024c (备注前端)
[外链图片转存中…(img-neqoEvXE-1713218280736)]

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

  • 9
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值