i already gone through other web game cheating question on this forum but i did not get answer for my problem that’s why i am posting it under a similar title.
Here is the issue:
i am developing a web -based game in which three similar boxes are shown on the web page by using simple html.
<img src="box.jpg" />
<img src="box.jpg" />
<img src="box.jpg" />
now with use of jquery.path plugin i am rotating these boxes on random path and as per game requirements at the end of the animation a user need to identify the position of the middle box by clicking on of the three boxes.
but if a user using firebug or chrome web developer tools then by just inspecting the dom’s elements he/she can easily identify the position of the middle box.
so please give me suggestion to resolve this issue.
P.S.
i am mainly using simple jquery animations because i want to make game compatible to older browser also,so is it better to use canvas or css3 animation in my situation?will they resolve this kind of cheating issue?
try considering the use if javascript closures. Although it can be tracked by a JS debugger, learning to use the debugger would be a higher level knowledge than just peering into the source or the DOM tree.
build an object that has a private scope. using that object, create the 3 images you need. assign these 3 images to 3 private variables in that object. only that object knows which image is which. you don’t even need to give them distinction in it’s attributes since you can track them in the object using those 3 private variables.
In my example, i’m using the $.data() which is viewable. although they can know the ID of the box, they don’t know the value of the
targetvariable inside the closure.consider randomizing the
targetvalue instead and place whatever box that has that value in the middle. that way, they won’t be tracking, the same box all the time.after this, just call
game.randomize()to do your path stuff (since only randomize is available publicly in the code)tried logging the
gameobject as well as the divs, no sign of the realtarget.