devrsi0n / React-2048-game

:video_game: A fancy 2048 game build with react, redux best practices.
https://devrsi0n.github.io/React-2048-game/
MIT License
466 stars 87 forks source link

2048 #1

Open devrsi0n opened 6 years ago

devrsi0n commented 6 years ago

https://devrsi0n.github.io/React-2048-game/

devrsi0n commented 6 years ago

test

xinglee23 commented 6 years ago

继续深挖,加油。文档可以写的更详细一点

e3gs commented 6 years ago

回退后分数没回退。。

devrsi0n commented 6 years ago

@eennoo 已修复。

CristL commented 6 years ago

COOL~

leeggco commented 6 years ago

666

danielfengyu commented 6 years ago

666 666

shenzekun commented 6 years ago

移动的时候不太顺畅希望改进一下

devrsi0n commented 6 years ago

@shenzekun 是桌面端还是移动端呢?

shenzekun commented 6 years ago

桌面端 @devrsi0n

ysc123 commented 6 years ago

我感觉,代码应该写点注释的!

LeesinChen commented 6 years ago

...

devrsi0n commented 6 years ago

@ysc123 ok,我再完善下。

douhaoi commented 6 years ago

19632

devrsi0n commented 6 years ago

@douhaoi 这是你的分数?我最高分 56100。

screenshot
LeeRayno commented 6 years ago

你好,我想问下关于eslint怎么配置,create-react-app 他自带eslint吗? 比如该2个空格的,我敲4个空格,他没有报错,方法()之间该有空格的,我没有空格他也不报错。我怎么找都没有找到create-react-app 里面的eslint的配置。我看你这里有关于stylelint的配置。目录还有.eslintignore这个文件,但是也没有.eslintric这个文件啊。------- 就是想问下在create-react-app 怎么配置eslint -------

devrsi0n commented 6 years ago

@LeeRayno create-react-app 是有 eslint,只不过他用的是自己的规则,而且校验不怎么严格。如果你要配置自己的 eslint 配置需要 reject 后自己添加 eslint 的配置,建议用 airbnb 那套规则。这个项目之所以没有 .eslintrc 是 eslint 的配置都在 package.json 这里,像 babel,jest,stylelint 这些配置都在 package.json 里面。

LeeRayno commented 6 years ago

@devrsi0n 好的,谢谢。我之前reject了的。也配置了eslint依旧无效。下次按照你package.json里面的配置试试。

stanNo1 commented 6 years ago

good job

liuxiaole commented 6 years ago

欢迎交流。我实现的一个动画版 https://liuxiaole.github.io/2048-react-redux/

Natumsol commented 6 years ago

快速移动的时候会卡顿,方块合并的算法感觉需要优化。附上我之前实现的一个:https://github.com/Natumsol/2048-react-redux

devrsi0n commented 6 years ago

@Natumsol 这个是故意加了一定 debounce 去抖的缘故。

devrsi0n commented 6 years ago

@liuxiaole 不错,有动画给人的感觉很丝滑。👏

YutHelloWorld commented 6 years ago

如果引入Route, 你的项目结构如何排布?

devrsi0n commented 6 years ago

@YutHelloWorld React 的 Route 还不是很熟悉,但是感觉和 Vue 的 Route 有些类似,如果要引入 Route 的话,这篇文章这种结构还不错,再加个导航栏组件,组件里面再添加 Route,应该就差不多了。

YutHelloWorld commented 6 years ago

@devrsi0n react-router4和vue的router差别还是很大的,我之前做了个包含react-router4和redux、react的脚手架,感觉结构划分不是太好,可以交流交流

devrsi0n commented 6 years ago

@YutHelloWorld 很有参考价值,已 star,结构划分的话我想到的是多参考 github 一些优秀的 boilerplate 项目。话说如果把 router 之类的全家桶加进来,我这个项目也可以把骨架提出来做一个 boilerplate 2333😄

YutHelloWorld commented 6 years ago

@devrsi0n 带有route的组件和常见的smart dumb结构还是有区别的,举个🌰:<Route component={MyComponent} />,在这里MyComponent 可以是smart, 也可以是dumb, 还可以是HoC, 甚至是多个地方复用的smart,那么这个MyComponent 到底应该放在哪里呢?这个可以好好思考思考, 期待你的建议。

ghost commented 6 years ago
venkatsingireddi commented 6 years ago

test