The first part of this code loads all the assets we will need for our game. Loader.loadManifest(manifest, true, "./img/") Ĭlouds.push(new createjs.Bitmap(loader.getResult("cloud"))) Loader.addEventListener("complete", handleComplete) Open the directory where your game is and run python3 -m rver then navigate to localhost:8000. The python HTTP server works well for testing. Note that in many modern browsers, such as Chrome, you can’t view WebGL content by simply double clicking the HTML file and opening it in the browser. Without this, WebGL will not display the gradient but Canvas 2D would display it with lower performance. To use the Canvas 2D context, you could simply specify Stage instead. Note that StageGL means we will use WebGL. This function initializes the stage, where we will add all our items to draw. Note that this is in the init function, which was specified to be called by the browser when the body loads in our HTML file. The Javascript above specifies our gradient and places it on the canvas.
0 Comments
Leave a Reply. |