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?
If you're looking to make a text based virtual pet game similar to Neopets. I'd recommend learning PHP and MySQL. Once you grasp a basic understanding of PHP you'll need to learn a framework to develop projects faster. I recommend the Laravel framework.
PHP handles pages like a register, login, and more.
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?
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.
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 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:
PHP is an older language that's falling out of favor. Many sites still use it, but it was originally designed as a way of adding small interactivity to websites that was later retrofitted for making larger applications, and that origin has hurt its usability relative to other languages with clearer design goals. Personally, I like Python for backend web development, although I have considered rewriting my server code in Java for better performance. (These performance gains would probably not be worth the lost development time that could be better spent implementing new features, though.)