【发布时间】:2016-07-01 08:28:40
【问题描述】:
Js
//Called when application is started.
function OnStart()
{
// Set counter default to zero
var $counter = 0;
function increase()
{
$counter++;
return false;
}};
HTML
<div id="counter">0</div>
<img src="Chop.png" alt="some_text" id="chopper">
<img src="monster1.png" alt="mon" id="monster1">
<img src="shot.png" alt="bang" id="shot">
<button type="button" class="btn btn-danger btn-circle" id="fire" onClick="counter++;"><p>123</p>
我只是想制作一个基本的增量按钮,因为没有出现错误消息,所以真的看不到出了什么问题。
我基本上是在尝试制作一个非常基本的 html 游戏,您可以在其中使用按钮开火,因此从怪物生活中获得 -1...
谢谢
【问题讨论】:
标签: increment