First off, it's my first time doing a little bit of game development, and I have no idea of the normal flow of making a game, let alone a browser game.
My game uses the phaser framework of HTML and JavaScript. It is a simple game based on the 2D space impact game. I was able to run the game on an empty HTML site with only head, title, and body tags.
This is the code to plug in my game to the blank HTML site:
<script type="text/javascript" src="game.js" type="text/javascript"></script>
But when I tried to add it to my pre-made website, it won't show. Am I missing anything? Do I need to put it in an iFrame, although I know phaser builds on a canvas.
parent
option with an ID or element, so that Phaser knows where to put your game. I think if you don't specify that, it will just throw it at the end of your body tag, which probably isn't ideal. More notes onparent
here: docs.phaser.io/Phaser.Game.html \$\endgroup\$