Snowball Fight
Tools/Skills: Browser's Developer Tools, HTML, JavaScript, Runtime Modifications
SYNOPSIS
Play a snowball fight against Santa and his Elves with another player. If you can, find a way to hack the game to make it a one-player game and/or make it easier to win.
Using Chrome's browser developer tools, I modified the URL to make it a single-player game and changed variables to make it easier to win.
SOLUTION
Clicked on private room
Right Clicked → Inspect
Clicked Console → selected Room
Examined the variables and code
Modified the URL programmatically
const urlParams = new URLSearchParams(window.location.search);
urlParams.set('singlePlayer', 'true');
const newUrl = `${window.location.pathname}?${urlParams}`;
window.history.replaceState({}, '', newUrl);
location.reload();
Re-displayed global variables
Changed Variables
PROCESS
I initially saw that I would have to pair up with another player, unless I could find a way to hack the game. I’ve never hacked a game, but decided I wanted to learn.
The Basics: What is the iframe? Where is the client-side code? How can I find the variables?
Updating “Single Player”
Further Exploration
What more can I do?
Updated variables such as speed and the size of the hit box. I managed to give myself a lot of health and made it so the elves and santa couldn’t throw snowballs. BUT I accidentally made it so that Santa couldn’t be damaged
Problem Identified: I thought of “hitbox” as the opposite of what they are.I thought playerhitbox, for instance, was about how effective the player would be when they attacked someone. But, it turns out, it’s about when they will get damaged.
Prompts:
What does hitboxsize refer to in the context of computer game code?
So, if the box is too small, that would make the object hard to ever hit?
Problem Solved: I then changed my hitbox to zero, so that I could not ever be damaged. And increased the numbers of the elves and santa and they would become easy targets.
Last updated