How to embed games.

Games used from external CDN websites.
  • Sticky - Post
User avatar
Someone
Site Admin
Site Admin
Posts: 1610
Joined: Sun Oct 12, 2014 7:58 pm
Gender: Male

How to embed games.

Post by Someone »

Since we currently support games on a website, we will describe an example of embedding zygomatic.nl games here.

First and foremost, I recommend everyone to download this game, which is a good example: Zuma Ball

As a first step, let's look at the process of embedding the game's "Flower Triple Mahjong."

1. Open the game - https://www.htmlgames.com/game/Flower+Triple+Mahjong
2. Click the "<Embed>" button.

3. Create an ads.txt file in the root directory of your domain and after paste the following into the ads.txt file:
google.com, pub-5029257013560698, RESELLER, f08c47fec0942fa0
You only need to do this once.

4. Copy the game url from the "Direct link" field. https://cdn.htmlgames.com/FlowerTripleMahjong/
5. To save the score you need to add the following to the link: ?omitHiscore
So the final link will look like this: https://cdn.htmlgames.com/FlowerTripleMahjong/?omitHiscore
6. Download the image of the game (200x200), click on the image to download it.

Now that we have the necessary data, we can create the files needed to install the game.
The fastest way to do this is to modify the files of the already downloaded Zuma Ball game.

1. Open the index.html file, for example using notepad++, and change the game name between the <title>:
Zuma Ball to Flower Triple Mahjong
2. Change the name of the game installation file: ZumaBall_ZM to FlowerTripleMahjong_ZM
3. Delete the ZumaBall_ZM.png file.
4. The downloaded game image is resized to 60x60 pixels and saved in PNG format and the file name must match the name of the installation file FlowerTripleMahjong_ZM
5. Modify the data of the game installation file:
  1. In the game_name field, enter the name of the game: Flower Triple Mahjong
  2. In the game_desc field, enter a description for the game.
  3. Modify the value of game_control if necessary. See the description inside the installation file.
  4. In the game_width, game_height field, enter the correct size of the game.
    Fortunately, zygomatic games are always used to the same size, so it’s easy.
    For a landscape game, we always use: width: 720, height: 432
    For a portrait game, we always use: width: 330, height: 550
  5. In the game_inherit field, copy the game link: https://cdn.htmlgames.com/FlowerTripleMahjong/?omitHiscore
6. Now that you have completed the three required files you are wrapping them in tar or zip format. Here, too, the file name must match the name of the installation file. FlowerTripleMahjong_ZM
7. Upload the game to the arcade/install folder and unzip and install.

The game can already be played on our website.

The description may seem like a lot, but the whole thing doesn’t take more than 3-5 minutes.

What are the benefits of embedded games?

1. Do not violate the game license.
2. Game files do not take up space on our own server.
3. If a game may be defective, no update is required, just report the game owner of the error.
4. Once the game is released, you can install it right away.
5. No additional adaptation user is required.
User avatar
Someone
V.I.P.
V.I.P.
Posts: 58
Joined: Thu Dec 25, 2014 11:02 am
Gender: Male

Re: How to embed games.

Post by Someone »

I made a game like this and it works grate: SnowMan

Than I made another one and this one has a problem with score submit:
MahjongTitans_ZM.tar
Can you see what I did wrong? I'm a little lost now. I gues I did something wrong but I don't know what smile(43)
You do not have the required permissions to view the files attached to this post.
User avatar
Someone
Site Admin
Site Admin
Posts: 1610
Joined: Sun Oct 12, 2014 7:58 pm
Gender: Male

Re: How to embed games.

Post by Someone »

The Mahjong Titans game does not include a score function.
User avatar
Someone
V.I.P.
V.I.P.
Posts: 58
Joined: Thu Dec 25, 2014 11:02 am
Gender: Male

Re: How to embed games.

Post by Someone »

KillBill wrote: Tue Aug 25, 2020 5:14 pm The Mahjong Titans game does not include a score function.
Ah ok, thanks KillBill,... is there a way to check this before I embed a game?

Greetings,
Ruud

Ps. I gues it is: play a game and see if it can submit score and if not, it will also not work on my website, right?
User avatar
Someone
Site Admin
Site Admin
Posts: 1610
Joined: Sun Oct 12, 2014 7:58 pm
Gender: Male

Re: How to embed games.

Post by Someone »

Ruud66 wrote: Tue Aug 25, 2020 6:22 pm
KillBill wrote: Tue Aug 25, 2020 5:14 pm The Mahjong Titans game does not include a score function.
Ah ok, thanks KillBill,... is there a way to check this before I embed a game?

Greetings,
Ruud

Ps. I gues it is: play a game and see if it can submit score and if not, it will also not work on my website, right?
if play original website and contain game highscore button = contain score function ;)
User avatar
Someone
V.I.P.
V.I.P.
Posts: 6
Joined: Mon Dec 27, 2021 10:32 pm
Gender: Male
Location: Staten Island, New York

Re: How to embed games.

Post by Someone »

When I first read this earlier this week, I was overwhelmed. I thought that there was no way that I could do it, and I wanted it done for me. I was wrong, it's simple and takes under 10 minutes. Thank you Yoda, your tutorial was spot on! smile(54)
You do not have the required permissions to view the files attached to this post.
User avatar
Someone
Site Admin
Site Admin
Posts: 1610
Joined: Sun Oct 12, 2014 7:58 pm
Gender: Male

Re: How to embed games.

Post by Someone »

Terry Action wrote: Sat Jan 08, 2022 10:26 am When I first read this earlier this week, I was overwhelmed. I thought that there was no way that I could do it, and I wanted it done for me. I was wrong, it's simple and takes under 10 minutes. Thank you Yoda, your tutorial was spot on! smile(54)
smile(31)