Hi
How are you?
I'm Emilio Dami Silva and this is my first article about HTML/GAMES.
These articles are basic and are for beginners, those who don't have any knowledge about
developing games with HTML and Javascript.
In this series of articles we are going to develop something very simple, while studying
the theory behind games displayed in HTML and Javascript.
You need to have some knowledge of HTML and that's why it's good that you read this set
of HTML articles on my page, at least for you to have a basic knowledge.
Follow our basic HTML articles here:
12 lessons to get started in HTML - Article 1
Also, you need to have some knowledge of Javascript, in this case you need read this
Javascript articles on my page, at least for you to have a basic knowledge.
Follow our basic Javascript articles here:
24 lessons to get started in Javascript - Article 1
We are not going to deal with HTML / Javascript here in these articles, but only
HTML/CANVA/GAMES.
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8"/>
<meta name="author" content="Emilio Dami Silva"/>
<meta name="description" content="Article 2 - HTML/CANVA/JS"/>
<meta name="keywords" content="Courses, HTML, site, web, website, development"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Neocodex Design Blog - HTML/CANVA/JS</title>
<style>
canvas {
border: 1px solid gray;
background-color: black;
margin: auto;
}
</style>
</head>
<body>
<div align="center">
<h1>
My Official Page
</h1>
<p>
Our first page Game/Canva/JS/HTML.
</p>
<br />
<canvas id="myCanvas" width="400" height="400" style="border:1px solid #c3c3c3;">
Your browser does not support the canvas element.
</canvas>
<br />
<button onclick="clearRect()">
Clean the Screen
</button>
<button onclick="drawBrick()">
Draw the Rect
</button>
<button onclick="drawBall()">
Draw the Ball
</button>
</div>
<script>
var canvas = document.getElementById("myCanvas");
var ctx = canvas.getContext("2d");
ctx.fillStyle = "black";
ctx.fillRect(0, 0, 400, 400);
drawBall();
function drawBrick() {
ctx.beginPath();
ctx.rect(162.5, 190, 75, 20);
ctx.fillStyle = "#0095DD";
ctx.fill();
ctx.closePath();
}
function drawBall() {
ctx.beginPath();
ctx.arc(200, 200, 10, 0, Math.PI * 2);
ctx.fillStyle = "#0095DD";
ctx.fill();
ctx.closePath();
}
function clearRect() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
}
</script>
</body>
</html>
<canvas id="myCanvas" width="400" height="400" style="border:1px solid #c3c3c3;">
<canvas>
ctx.arc(200, 200, 10, 0, Math.PI * 2);
ctx.rect(162.5, 190, 75, 20);
Got a Project? Let’s Get to Work!
Feel free to contact us via e-mail or by phone. Also, you can fill out the form and send us
a
message.
We will contact you back immediately.
Thank you very much for visiting our website!