Can it be done?

I have finished the my first squiffy puzzle game.
Is there any chance to hide the html code to see because it is reveiling the solutions to the player?


Well, if someone wants to cheat, I'd just let them. If someone is hacking your game to look at your code to solve it, I don't know if I'd bother to do anything about it. It's like cheating in Solitaire.

Just my thoughts, anyway.

Maybe you could mask the critical game issues in JS code? Not sure if that helps.

I wouldn't necessarily try to stop them either. If a person is resorting to this they may be having difficulty but still have enough interest to continue playing. If you try to stop them you may just end up having those players quit playing entirely instead.

Perhaps those puzzles are too difficult for some players? If people are cheating at specific points in your game maybe those areas deserve a review or some revision.

I would agree with this; by hiding the code, you would just be frustrating players who want to look at it.
I've looked into the source behind games in the past so that I can point out exactly why some section isn't working properly and how to fix it.

But if you really want to, it should be possible. You'd probably want to modify the javascript; either by using my _transition hack or by modifying your squiffy.template.js. You could then run the text sections through a simple substitution cipher.

Alternatively, at the point of publication, you could encrypt the whole object. I think that might actually be simpler, but I don't have a story.js handy to test the process.
Basically, I would find the part in story.js where squiffy.story.sections is defined, cut out that whole part, and encode it (perhaps base64?). Then wrap a function around it to decode it again when the game is loaded; that way all your content is there, but getting at it isn't as simple as reading the source. Perhaps it might be efficient to use a library like LZstring; which is similar to a Javascript implementation of the algorithm used for zip files. A pretty good way of obfuscating your code, although anyone familiar with javascript could probably figure out how to reverse it.

A decade ago, a minimalist html game Candy Box! was quite popular. If you looked under the hood, you'd find lighthearted trolling messages. Something like, "Looking at the code, eh? Cheater!"

This topic is now closed. Topics are closed after 60 days of inactivity.