Tag: CSS Media Queries


29

Mar 2016

Add an object onto the game screen

Add Object Make a component constructor, which lets you add components onto the¬†screen. The object constructor is called component, and we make our first component, called myGamePiece:   Source Code:¬† <!DOCTYPE html> <html> <head> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″/> <style> canvas { border:1px solid #d3d3d3; background-color: #f1f1f1; } </style> </head> <body onload=”startGame()”> <script> var myGamePiece; function startGame() { myGameArea.start(); myGamePiece = new component(30, 30, “green”, 10,...

Read More