Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

随机地图后 #1

Open
biganans opened this issue May 23, 2017 · 1 comment
Open

随机地图后 #1

biganans opened this issue May 23, 2017 · 1 comment

Comments

@biganans
Copy link

biganans commented May 23, 2017

生存了以后怎么样去确定怪物或者人物或者传送门的位置呢

还有就是 你的起点和终点 好像没有加入到可走路径 只是为什么呢?
while(true){ var start = getRandomPosition(this.row,this.col); var end = getRandomPosition(this.row,this.col); if(start.x - end.x > (this.row * 0.5) && start.y - end.y > (this.col * 0.5)){ map.createLine(start,end,true); console.log("start %d %d",start.x,start.y); console.log("end %d %d",end.x,end.y); break; } }

@bastarder
Copy link
Owner

怪物的地点 跟传送门的位置 就看你自己想怎么做了, 比如 随机生成位置, 起点和终点 想加就加 不加就不加, 加的话 就是长一点 不加就是短一点。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants