Github Help

Hello! I have seen people having a github site with their game (Just the game) and nothing else!
I have a game and I want the code to be a secret because there is secrets and codes in it!
So how do I make these things with just my game?
Thank you!

1 Like

*inhales*

So I’m guessing you want a site like https://unsignedarduino.github.io/Crossy-Roads-3/ which shows a nice big simulator:

(SHAMELESS SELF PROMOTION for my Crossy Roads 3 :stuck_out_tongue:)

How to make a GitHub project

Note: These instructions apply even if you have already started a project.

First, make sure you have a GitHub account. If you do not have one, sign up - it’s free! Once you finish signing up, do all the usual stuff like verifying yourself, etc.

Next, (you can close all the GitHub windows for now) go to MakeCode Arcade and create a new project.

At the very bottom of the screen there should be the GitHub logo:

Click on it! Sign in if needed - it will redirect you to a GitHub login page. Then you should go right back to the Create GitHub repository dialog:

For Repository name, you can name it whatever you want but that will be the project’s name and it’s a pain in the butt to change later so choose wisely! Also there are special rules on how you can name it - it will tell you when you do something wrong.

For Repository description, write a description - not required and you can change it later easily.

And make sure to make your repo public! Otherwise, you will need a GitHub Pro account or something like that to enable GitHub pages on private repos.

Then it may take a while to create the GitHub repo.

Once it finishes, at the bottom of the screen it there should be a check mark next to the GitHub logo. You will also note that the option to save the project as a .png disappears.

That check mark indicates all your changes (non-currently, because you haven’t written any code yet) are saved on GitHub. Once you change something, the checkmark turns into a up arrow:

image

That means that your changes haven’t been saved on GitHub yet, To save it - you need to commit it.

Commiting

You’ve probably been coding for quite some time now, and you are at a perfect place to take a break. Maybe you just finished designing the tilemaps or the art, or you got a core feature of your game ready. Now is the perfect time to commit, which is basically saving your code to GitHub. If you have unsaved changes, there will be an up arrow to the right of the GitHub logo. Click on it and a new “window” (idk what to call it) pops up:

Now, to save your changes to GitHub, you need to describe what you have done. For me, I’m gonna say that I’ve finished the character art. (not really this is for demonstration) Type that into the Describe your changes box. Once you are ready to save, press Commit and push changes.

If it says No local changes found, that means it saved!

Updating GitHub pages

Now if you go to the repo’s page (which you can find by going to github.com, click on your icon in the top right, select Your repositories, and click on the link to your repo you just made) it should look something like this:

You see that link under the About section? That’s where your big simulator-only page is. If you click on it, it will load up the page. Sweet!

Or maybe not, since it’s probably not gonna reflect your recent commits. Now go back to the Arcade project and open the GitHub “window.” If you closed it, just click on the GitHub logo button at the bottom again.

If you look in the Release zone, it says Commit & create release to update Pages. So to create a release, click on the Create release button. A dialog should pop up:

Now you can choose what to call the release, like either 0.0.1, 0.1.0, of 1.0.0. Then, click on Create release.

Once it’s finished, you will see the words Pages building, it may take a few minutes.

Once it’s done, then it will say Open Pages. Click on that and it will open the Pages again but now it should reflect your changes!

1 Like

Thanks! I did that! (not putting in the link bc there is secret codes and more)! Is there a way to not make it editable? So you can play it but not edit the game?
Thanks! saves info for later
(Also I like the Crossy Roads)

1 Like

No you can’t :frowning:

1 Like

There is a way to hide the edit link, but if you publish the code to github everyone can already see it anyways. If you just want to hide the edit link, you will need to edit the code in github. Go to your repo page, then click the file that says index.html. You should see a file open up containing the source code for the website. On the top right of the file, you should see some buttons that say “Raw” and “Blame”, then next to that is a button that looks like a computer and one that looks like a pen. Click the pen button, then scroll down until you find the section that says something like this:

        <a target="blank" rel="nofollow noopener" href="https://{{ site.github.owner_name }}.github.io/{{ site.github.repository_name }}/README">Manual</a>
        <a target="blank" rel="nofollow noopener" href="https://arcade.makecode.com/#pub:github:{{ site.github.owner_name }}/{{ site.github.repository_name }}">Edit</a>
        <a target="blank" rel="nofollow noopener" href="https://github.com/{{ site.github.owner_name }}/{{ site.github.repository_name }}">GitHub</a>

Delete the lines that have “Edit” and “GitHub” in them. You can also delete the “Manual” line but that is up to you. Now, scroll down and you should commit the changes. It should automatically rebuild the site, and tada! The Edit and GitHub links are now gone. But beware - it only removes the links, if people want to they can still see the code.
Hope this helped!

2 Likes

Well… I did what you said… I removed the 3 (pen thing clicked) I did the one with “Master” and pressed ok! It rebuilt and I clicked the link… But the 3 are still there and working…

Hmm, are you sure you removed the right links? It might be a bit hard to help you without your code haha
If you don’t want to share your game code maybe you can paste the index.html file here (or DM it to me) so I can see if you did it right?

well I deleted the 3 things you showed me!
(These:)

Try refreshing the page, it might have not saved yet

1 Like

I restarted my PC and It worked! Thanks for your help!

1 Like

See? Restarting your computer is the solution to 95% of tech problems. :joy:
image

2 Likes