Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
349 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 Answer

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...