Game Cloud Wiki
13 Posts
Mira Laime
Swordman97
RisingSun2013
Ftiercel
Sebrex
All Contributors
Ftiercel
RisingSun2013
Sebrex
• 3/1/2014

More badges to get!

I have created new special badges to get.

Those badges will reward the ones who have improved the game engine of the site. Those badges are the most honorific ones on the site. For instance, one can get a badge if they:

  • Animate the bombs.
  • Find a bug.
  • Add the possibility to know if a game is feasible.
  • Add music...

You can ask me for help and see this page. I would also be happy to teach you JavaScript!

1 8
  • Upvote
  • Reply
Ftiercel
RisingSun2013
Sebrex
0
• 3/1/2014
Cool.
0
• 3/2/2014

On chrome, on a game page, you can play with JavaScript going to "Tools" -> "Developer Tools" -> Console. For example, type: alert(gameModel);

You should see the text of the game.

0
• 3/2/2014
I don't use chrome.
0
• 3/2/2014

On Firefox, type Shift F4, type alert(gameModel); and click on "Execute" on a game page. Next time, I will explain how to find an element of the page.

0
• 3/5/2014
what about on internet explorer? i use that and sometimes chrome.
0
• 3/6/2014

Directly type javascript:alert(gameModel); in the address bar when you are on a game page. You should see the x and the dot of the game in a dialog. If it does not work, you can first try to type javascript:alert("hello"); in the address bar. It should display hello, but it's less interesting. Does it work for you?

0
• 3/6/2014
yep
0
• 3/6/2014

OK. Let's have some fun now! We will add a new button to the editor! Here is what the JavaScript code looks like:

var space = document.createElement("span");
space.innerHTML = ' ';

var editButton = document.createElement("button");
editButton.id = "checkButton";
editButton.title = "Check if the game is feasible.";
editButton.innerHTML = "Check";

var publishButton = document.getElementById("updateButton");

if (publishButton.nextSibling) {
  publishButton.parentNode.insertBefore(editButton, publishButton.nextSibling);
  publishButton.parentNode.insertBefore(space, publishButton.nextSibling);
} else {
  publishButton.parentNode.appendChild(space);
  publishButton.parentNode.appendChild(editButton);
}

Type the following code and see what happens: javascript:var%20space%20=%20document.createElement("span");%20space.innerHTML%20=%20' ';%20%20var%20editButton%20=%20document.createElement("button");%20editButton.id%20=%20"checkButton";%20editButton.title%20=%20"Check%20if%20the%20game%20is%20feasible.";%20editButton.innerHTML%20=%20"Check";%20%20var%20publishButton%20=%20document.getElementById("updateButton");%20if%20(publishButton.nextSibling)%20{%20%20%20publishButton.parentNode.insertBefore(editButton,%20publishButton.nextSibling);%20%20%20publishButton.parentNode.insertBefore(space,%20publishButton.nextSibling);%20}%20else%20{%20%20%20publishButton.parentNode.appendChild(space);%20%20%20publishButton.parentNode.appendChild(editButton);%20}%20void%200;

Write a reply...