Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
soo ao long tian1,111 Points
for example, I build an html file with some image and sound file, and i uploaded those file into a web server, after that the user can access those source file by press F12 on the keyboard, and downloaded all my hardwork, for example picture i design and sound file that i compose. is there a way to prevent this from happening? for example in this html game https://ft.o4games.com/ when we press F12, we couldn't see those source file, but if you open my game and press F12, u can see all my file in there, this is my game link, http://www.ebuymalaysia.com/ u need to press mouse left button to have the game start
Well, you can't really get "protect" your files if you share them with someone. If somebody can read something, there's always a way of copying it. Though all of that, you still own the files you made by copyright law. When somebody uses your work without permission, you can put a lawsuit on him.
Technically you may want to have a look at the DRM features of HTML5, though I think they are a bit too complicated for your project.
Best Regards, Philip
I'm sure you can find their sprites if you are skilled enough/put great efford to it. However, you can obfuscate it from normal users. Most basic one(which I personally REALLY do not recommend):
<body oncontextmenu="return false"> </body>
It is better to put some sort of encryption (maybe AES) to the images (Server-Side with PHP), and dynamically decrypt it on the client side. Also, obfuscate the JS Code.