| by Arround The Web | No comments

How to Install CodeCombat on Ubuntu

For any gamer who wants to learn to program, CodeCombat is a great coding gaming to learn it by playing games. The CodeCombat is a dungeon-delving-type coding game that helps young kids to learn how to code by playing games. You control the movement of the players by writing code in various languages, including Python and JavaScript.

CodeCombat is available online without needing to install it. But for someone who loves getting their grip on things, installing the game on your Ubuntu is a good idea. There are various steps to get CodeCombat up and running and this guide covers it.

How to Install CodeCombat on Ubuntu

CodeCombat is not available as a package that you can easily install. Instead, there are various requirements that you must first install before eventually having CodeCombat on your system. First, ensure you have a stable internet connection to save time.

You must install various dependencies for CodeCombat to run on Ubuntu. Install nodejs, build-essential. Python 2.7, and Git.

The command below installs the four packages.

$ sudo apt-get install git build-essential nodejs python2.7

 

Ensure you allow all the packages to install. It may take time, depending on your internet speed.

Once installed, update the apt database using the command below:

$ sudo apt update

 

Next, we need to add the public gpg key for MongoDB. Copy the command below and paste it onto your terminal.

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

 

Once the public key is added, update the database, as in the image below.

Also, it would be best if you install the Node Package Manager (npm) to help manage the needed dependencies by CodeCombat. Use the command below to install npm.

$ sudo apt install npm

 

CodeCombat uses Python 2.7. Therefore, if your default python version is not 2.7, you must set it to use version 2.7. If you are running the latest Ubuntu versions, the default is Python3, so use the command below. Remember, you must have Python 2.7 installed as we did in the earlier section for you to set it as the default one.

$ npm config set python `which python2.7`

 

We need Git for cloning the CodeCombat repository. Therefore, we must set up Git on your terminal, including the username and password. So, set up your Git with the syntax below.

$ git config --global user.name "$YOUR_NAME"

$ git config --global user.email "$YOUR_EMAIL_ADDRESS"

 

With Git configured, we can now clone the CodeCombat repository. Use the command below.

$ git clone https://github.com/codecombat/codecombat.git

 

Once the cloning is done, you will note that updating all files will get completed at the bottom of the file, as in the image below.

Once cloned, navigate to the CodeCombat directory.

Now, track the upstream using the command below.

$ git remote add -f upstream https://github.com/codecombat/codecombat.git

 

CodeCombat also relies on bower. Instead of installing bower separately, you can use rpm to install bower and build the asset files simultaneously. For that, run the command below.

$ npm install

 

Once the bower dependencies are taken care of, we need to run the development server using Node Package Manager.

For that, we have two options. You can either start the brunch and nodemon using the command below.

$ npm run dev

 

Alternatively, you can use the commands below watch client files and route the server calls to the production servers of CodeCombat.

$ npm run webpack -- --watch

 

Now, run the command below to start the server.

$ npm run proxy

 

Either of the two options will start the development server. You can open your localhost using the URL below and access the CodeCombat.

http://localhost:3000

 

You should get the CodeCombat welcome screen like the one below.

Have fun playing CodeCombat.

Conclusion

CodeCombat is a great way for beginners and kids to learn to code by manipulating how they want their game to be by writing code. This guide presented installing CodeCombat on Ubuntu.

Share Button

Source: linuxhint.com

Leave a Reply