Donatello Sprite
How do I make an donatello sprite?
Experimenting with a simple sprite animation.. What is a donatello sprite? How do you make a donatello sprite? This script and codes were developed by Coran Spicer on 15 October 2022, Saturday.
Donatello Sprite - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Donatello Sprite</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="donatello" class="idle"></div>
<button id="play" onClick="play();">Play Animation</button>
<br />
<input id="framerate" value="24" type="text" name="framespersecond" ></input> <script src="js/index.js"></script>
</body>
</html>
Donatello Sprite - Script Codes CSS Codes
body { text-align: center;
}
#donatello { display: block; position: relative; margin: 0 auto; width: 184px; height: 118px; overflow: hidden; background: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/23594/stompin_the_foot.png") no-repeat; background-position: 0 0;
}
Donatello Sprite - Script Codes JS Codes
var img = { name : 'donatello', width : 184, height : 118, frames : 12
};
var framerate = document.getElementById('framerate').value ? document.getElementById('framerate').value : 24, el = document.getElementById('donatello'), currentFrame = 0;
console.log( document.getElementById('framerate').value );
var play = function() { // re-check framerate setting framerate = document.getElementById('framerate').value ? document.getElementById('framerate').value : 24; var animationPlay = setInterval( function(){ if ( currentFrame >= (img.frames - 1) ) { clearInterval(animationPlay); setTimeout( function() { currentFrame = 0; el.style.backgroundPosition = "0px 0px"; },1000/framerate); return false; } currentFrame++; el.style.backgroundPosition = -(currentFrame * img.width) +'px 0px'; }, 1000/framerate);
}
Developer | Coran Spicer |
Username | cgspicer |
Uploaded | October 15, 2022 |
Rating | 3 |
Size | 2,452 Kb |
Views | 28,336 |
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!
Name | Size |
Fruit Stripe Background | 2,758 Kb |
Shattering boxes | 3,390 Kb |
Drag and Drop Quiz | 3,837 Kb |
Hi-rez logo | 5,938 Kb |
Header logo that changes | 2,031 Kb |
Fully Furnished | 3,613 Kb |
FocalCenter.js for jQuery | 3,462 Kb |
Aaronmarino.com v2 styles | 2,863 Kb |
Album 88 Tuner | 9,852 Kb |
ExamplesEdit | 1,592 Kb |
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!
Name | Username | Size |
STAR WARS LIGHTSABER | Francoiscoron | 4,420 Kb |
NgEasyModal | Lorenzodianni | 4,159 Kb |
CSS Heart Loaders | Nourabusoud | 2,161 Kb |
Minimal Menu | Achudars | 3,430 Kb |
Calculator - codevember 08 - 2016 | Caiocares | 3,260 Kb |
React TODO | Enieste | 3,320 Kb |
How to add Css Fold Notes In Blogger By Askwithloud.com | Askwithloud | 2,280 Kb |
Testing Portfolio Page | Sideshowli | 3,395 Kb |
CSS Grid Overlay | Cliffpyles | 3,090 Kb |
Donald Trump - The New Yorker | Agbales | 2,502 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!