Hello everybody, I'm newtogameQuery,and I'mtrying to understandthe conceptsof the framework.I diddowonlaodthegame "SuperjavascriptfigtherII"and addedonly 3lines in thejavascript file"superjavascriptfighter2.js."Theline: "varcollided=$("#cvs").collision("Abobo#"); if (collided) alert (collided.length);"
My intentionis to testthe conceptof a collision.But I realizedthat eventouchingthe fightersfor several timesduring the game, nocollision is detected.The lineswere placedafterthissnippet: "varcenterPos=(al-cl) / 2 +cl; scrollStage(-(centerPos-400) * 0.5);"
SelimHello,thanksfor the reply.With regard tosyntax errorsjavascriptto whichyou referwereerrorsin mytypingdirectlyin the text boxof theforum,followinga"copy /paste"of theoriginalcode:
var centerPos = (al - cl)/2 + cl; scrollStage(-(centerPos-400)*0.5); var collided = $("#cvs").collision("#abobo"); if(collided && collided.length>0) alert(collided.length);