Hello guys,,
title says it all. I hope someone can help me.
Greetings.
			
		davori wrote:... most people say that flash will die sooner or later (round about 2020 or a bit later) because of html5
davori wrote:For example.. pulling down pants with the mouse or moving the body up and down or backwards and forwards etc..
davori wrote:My question..is html5 able to do games like that or should i try to learn "flash"? That's right now the most important question.
 <!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <meta http-equiv="X-UA-Compatible" content="ie=edge">
   <title>Change image in Canvas on click.</title>
   <style>
      #canvas {
         background-repeat: no-repeat;
         width: 100%;
         height: 100%;
      }
   </style>
   <script>
      var images = [
         "4827/nature-forest-trees-fog.jpeg",
         "302804/pexels-photo-302804.jpeg",
         "240040/pexels-photo-240040.jpeg",
         "38136/pexels-photo-38136.jpeg"
      ];
      function changeImage() {
         /* Show the first image in the queue on the canvas ID'ed element. */
         document.getElementById("canvas").style.background = "url('https://images.pexels.com/photos/" + images[0] + "')";
         /* Move the first image to the end of the queue. */
         images.push(images.shift());
      }
   </script>
</head>
<body>
   <!-- The empty canvas to show the images in, it monitors for click events on it. -->
   <canvas id="canvas" onclick="javascript:changeImage();"></canvas>
   <!-- The canvas element should exist by now so show the first image in it. -->
   <script>changeImage();</script>
</body>
</html>

Return to The workshop of creators
Users browsing this forum: No registered users and 6 guests