Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7742157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:12:43+00:00 2026-06-01T09:12:43+00:00

My focus in this question is making HTML5 games. The aim is to help

  • 0

My focus in this question is making HTML5 games. The aim is to help reduce/prevent cheating.

If a variable in global scope held the score, for example var score = 0, then it’s really easy to cheat just by running javascript:void(score = 9999999999);.

But if I had something more like this:

(function() {
    var score = 0;
    // game logic here
})();

Is score accessible by anything outside the closure? Is there any way for the player to modify it and thus falsify their points?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:12:44+00:00Added an answer on June 1, 2026 at 9:12 am

    Outside of that closure, score does not exist (or at least, that score doesn’t).

    If you want to prevent cheaters, the only real way when the whole game runs on the client side is to recreate the game environment and user input on the server and validate that.

    Otherwise, anyone can modify your client side code and send what they wish to your server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is a bit awkward. Is it possible to transfer the touch focus
Well to begin i would like to mention that the aim of this question
This question is probably language-agnostic, but I'll focus on the specified languages. While working
I have basically the opposite problem to this question: How to prevent iframe from
$(document).ready(function() { $('#username').focus(function() { $(this).val(''); }) $('#username').blur(function() { var l = $(this).val.length; if (l
$('#div1').focus(function () { callAnotherFunction(); $(this).animate({}); } I'm trying to make $(this).animate({}); execute after callAnotherFunction();
1194.21 Software applications and operating systems has this to say about focus: (c) A
Hello i have this form filling javascript: function onLine(code,nn) { document.writeform.bericht.value+=code; document.writeform.bericht.focus(); document.writeform.nickname.value+=nn; write1();
I am trying to subclass the window that currently has focus. I do this
I'm using webBrowser.Navigate(url) control to display page. I noticed this action steals focus from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.