Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
351 views
in Technique[技术] by (71.8m points)

javascript - 如何手动启动使用Javascript库的游戏? [关闭](How to manually start the game which is using Javascript library? [closed])

I'm learning to build a game using a Javascript library called propulsionjs.

(我正在学习使用名为propulsionjs的Javascript库构建游戏。)

The Demo game can be accessed here http://www.propulsionjs.com/demos/balloons/game.html .

(可以在http://www.propulsionjs.com/demos/balloons/game.html上访问演示游戏。)

Here actually game starts automatically as soon as pages loads into the browser.

(实际上,只要页面加载到浏览器中,游戏就会自动开始。)

I wanted to start manually.

(我想手动开始。)

Can anyone help me out?

(谁能帮我吗?)

The working code of the game is given here: http://pastie.org/2095519

(此处提供了游戏的工作代码: http : //pastie.org/2095519)

  ask by huduga translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I think you can just remove the line at the end that says

(我认为您可以删除最后一行)

loop.room = rm.play;

and bind it to some button to start a new game

(并将其绑定到某个按钮以开始新游戏)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...