The pigs

Size
1,845 Kb
Views
28,336

How do I make an the pigs?

What is a the pigs? How do you make a the pigs? This script and codes were developed by Christian Östman on 11 September 2022, Sunday.

The pigs Previews

The pigs - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>The pigs</title>
</head>
<body> <!DOCTYPE HTML>
<html> <head> <style> body { margin: 0px; padding: 0px; } </style> </head> <body> <canvas id="myCanvas" width="1000" height="500" style="background-color:black;"></canvas> </body>
</html> <script src="js/index.js"></script>
</body>
</html>

The pigs - Script Codes JS Codes

var canvas = document.getElementById('myCanvas');
var context = canvas.getContext('2d');
var imageObj = new Image();
imageObj.src = 'http://static2.wikia.nocookie.net/__cb20120812082361/adventuretimewithfinnandjake/images/0/06/Pig_trans.png';
var pigs = [];
for(var i = 0; i < 200; i++)
{ pigs.push({scale:Math.random()*100,y:Math.random()*450,x:Math.random()*1000});
}
pigs.sort(function(a, b) { return a.scale - b.scale;
});
function update()
{ context.clearRect(0,0,1000,500); for(var i=0;i<pigs.length;i++) { context.restore(); pigs[i].x += .1 * pigs[i].scale; context.drawImage(imageObj, (pigs[i].x%1300) - 300, pigs[i].y + Math.sin(pigs[i].x/100) * 15,pigs[i].scale,pigs[i].scale); }
}
setInterval(update,1000/60);
The pigs - Script Codes
The pigs - Script Codes
Home Page Home
Developer Christian Östman
Username chribbe
Uploaded September 11, 2022
Rating 3.5
Size 1,845 Kb
Views 28,336
Do you need developer help for The pigs?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Christian Östman (chribbe) Script Codes
Create amazing web content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!