Make button click more than once -


Trying to make a simple single-shooter game for my disabled son, I have a good shooter to shoot a bullet, but it's 2, 3, etc., when the button is clicked. Get to I'm new to original coding so that the answer with the actual line of coding is helpful. Thanks, this is my code game tester

  & lt; Style id = "game-css" & gt; #missile {status: fixed; Top: 640px; Left: 820px; Width: 0px; Height: 0px; Background: #ffffff; } # Missile & gt; Div {status: absolute; Top: -4 pixels; Width: 4px; Height: 10px; Range radius: 10px 10px 0 0; Background: black; } #fire {image: shooter.jpg; Width: 140px; Height: 190px; } & Lt; / Style & gt; & Lt; / Head & gt; & Lt; Body bgcolor = "# ffffff" & gt; & Lt; Marquee behavior = "scroll" direction = "left" scrollamount = "15" & gt; & Lt; Img src = "diamond.jpg" /> & Lt; Img src = "diamond.jpg" /> & Lt; Img src = "star.jpg" /> & Lt; Img src = "diamond.jpg" /> & Lt; IMG src = "star.jpg" /> & Lt; Img src = "bomm.jpg" /> & Lt; Img src = "diamond.jpg" /> & Lt; Img src = "star.jpg" /> & Lt; / Marquee & gt; & Lt; Br> & Lt; Marquee behavior = "scroll" direction = "right" scrollamount = "10" & gt; & Lt; Img src = "diamond.jpg" /> & Lt; Img src = "diamond.jpg" /> & Lt; IMG src = "bomm.jpg" /> & Lt; Img src = "diamond.jpg" /> & Lt; Img src = "diamond.jpg" /> & Lt; IMG src = "diamond.jpg" /> & Lt; Img src = "bomm.jpg" /> & Lt; Img src = "diamond.jpg" /> & Lt; Img src = "star.jpg" /> & Lt; / Marquee & gt; & Lt; Br> & Lt; Marquee behavior = "scroll" direction = "left" scrollamount = "20" & gt; & Lt; Img src = "diamond.jpg" /> & Lt; Img src = "star.jpg" /> & Lt; Img src = "bomm.jpg" /> & Lt; Img src = "diamond.jpg" /> & Lt; Img src = "star.jpg" /> & Lt; Img src = "diamond.jpg" /> & Lt; Img src = "star.jpg" /> & Lt; / Marquee & gt; & Lt; Table border = "# ffffff" cell_spacing = "0" cellpadding = "0" width = "100%" range = "0" & ​​gt; & Lt; TR valign = Align = Center & gt; & Lt; -! Left - & gt; & Lt; Align TD = center width = "30%" bg color = "#ffff" & gt; & Gt; Font face = "arial, helventica" size = "6" color = "# 000000" & gt; & Lt; Br> & Lt; Br> & Lt; Br> & Lt; Br> & Lt; Br> & Lt; Img src = "rules.jpg" & gt; & Lt; / Font & gt; & Lt; / TD> & Lt; -! MIDDLE - & gt; & Lt; TD alignment = center width = "40%" bgcolor = "# ffffff" & gt; Font face = "arial, helventica" size = "6" color = "# 000000" & gt; & Gt; & Lt; Br> ; & Lt; Br> & Lt; Br> IMG src = "shooter.jpg" range = "0" id = "fire" alt = "click to shoot"> gt; & Lt; / Font & gt; & Lt; / TD & gt; & Lt; -! Correct - & gt; & Lt; Align TD = center width = "30%" bg color = "#ffff" & gt; & Gt; Font face = "arial, helventica" size = "6" color = "# 000000" & gt; & Lt; Br> & Lt; Br> & Lt; Br> & Lt; Br> & Lt; Br> & Lt; Img src = "goal.jpg" & gt; & Lt; Br> & Lt; Br> & Lt; Img src = "bullets.jpg" & gt; & Lt; / Font & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt; & Lt; Div id = "missile" & gt; & Lt; Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Script & gt; $ (Document) .ready (function () {$ ('# fire'). Click (function () {$ ('# missile'). Anamat ({top: -400}, 1500);});} ); & Lt; / Script & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

The problem is solved thanks to

you can do something like this ({Top: -400}, 1500, Function () / Your Callback $ ('# Missile'). CSS ({top: 'auto', bottom: '-100 px'});}); );

Then you are resetting the status in your callback function, and if you click again, the animation will run again.


Comments