What programming language would you need to learn in order to create a virtual pet game, and which ones are most commonly used in the industry?

Scorpion

Well-known member
55
8
To make a virtual pet game, you should consider learning programming languages like Python, JavaScript, or C#. Python is a good choice for beginners because it's easy to understand and helps you build things quickly. JavaScript is important for games that run on the web, while C# is often used in game-making tools like Unity. Which language do you think would be the best to start with for making this game?
 
To make a virtual pet game, you should consider learning programming languages like Python, JavaScript, or C#. Python is a good choice for beginners because it's easy to understand and helps you build things quickly. JavaScript is important for games that run on the web, while C# is often used in game-making tools like Unity. Which language do you think would be the best to start with for making this game?
You can make a pet game with javascript, however, this wouldn’t be a full fledged browser based one.

In order to make a full fledged browser based one, you’ll need to code it in php/mysql.

This tutorial explains more in depth how you can make one with javascript:


There's a tutorial that provides tips and advice on how you can make one with unity with the use of C# as well:


If you'd like to take a deeper dive and learn how to make a browser based one, I'd recommend watching this tutorial on how to make one with php/mysql.

Siteground has some great guides and articles relating to php/mysql as well. I'd check out their articles as well. It's an awesome resource site.

Freecodecamp is also great. They have tons of guides and articles as well. The PHP Handbook – Learn PHP for Beginners
 
  • Like
Reactions: Sleepysaur
Thank you for those resources cpvr! I have tried to find tutorials on youtube before but I've never seen any of these videos before, I'll check them out.
 
You can make a pet game with javascript, however, this wouldn’t be a full fledged browser based one.

In order to make a full fledged browser based one, you’ll need to code it in php/mysql.
This tutorial explains more in depth how you can make one with javascript:


There's a tutorial that provides tips and advice on how you can make one with unity with the use of C# as well:


If you'd like to take a deeper dive and learn how to make a browser based one, I'd recommend watching this tutorial on how to make one with php/mysql.

Siteground has some great guides and articles relating to php/mysql as well. I'd check out their articles as well. It's an awesome resource site.

Freecodecamp is also great. They have tons of guides and articles as well. The PHP Handbook – Learn PHP for Beginners


You can't pull content from the database with Javascript. It's okay to use Javascript on your pet sites, but I would recommend using PHP as the base with a solid framework such as Laravel. The kittokittokitto project is using the Laravel framework that would be a good starting point to build your virtual pet sites.
 
Thank you for those resources cpvr! I have tried to find tutorials on youtube before but I've never seen any of these videos before, I'll check them out.
You're welcome! There's also a full course php tutorial that provides about 7 hours of information if you'd like to take a look at that one as well.


There's a shorter one that's 2 hours long that's just as good though.



PHP Tutorial - Learn PHP Programming is also a great resource site as well. Good luck with your journey on learning how to code! 😀

You can't pull content from the database with Javascript. It's okay to use Javascript on your pet sites, but I would recommend using PHP as the base with a solid framework such as Laravel. the kittokittokitto project is using the Laravel framework that would be a good starting point to build your virtual pet sites.

it is possible to fetch data from a database with JavaScript, however JavaScript runs on the client-side and can't directly query a database. But, you can use JavaScript's fetch() method to make requests to a server-side script (like PHP, Node.js, or similar) that will handle the database query and return the data.


This example is how you can use fetch() to retrieve data:

Code:
fetch('your-endpoint.php')
  .then(response => response.json())  // Parse the JSON data
  .then(data => console.log(data))    // Do something with the data
  .catch(error => console.error('Error fetching data:', error)); // Handle errors
The URL 'your-endpoint.php' would be a server-side script that queries the database and returns the data in JSON format.


For more details on using fetch() and handling requests, these resource sites explain more:


Fetch makes asynchronous HTTP requests.​

  • It returns a Promise, which can be handled with .then() for successful responses or .catch() for errors.
  • On the server-side, you'll need PHP, Node.js, or another backend language to query your database and return the data to the client.

By using fetch(), you can dynamically load content from your database without reloading the page!