background preloader

Learn

Facebook Twitter

Mrdavidlaing/javascript-koans. Practice programming with our programming & game challenges. Learn by Doing - Code School. Eloquent JavaScript. JavaScript. HTML5 Gaming: How to animate sprites in Canvas with EaselJS.

By David Rousset When you write casual games using the HTML5 Canvas element, you need a way to handle your sprites.

HTML5 Gaming: How to animate sprites in Canvas with EaselJS

There are several libraries available to help you write games, including ImpactJS and CraftyJS. I’ve decided to use EaselJS which was used to write PiratesLoveDaisies, a great HTML5 Tower Defense game. We’re going to see in this tutorial how to use your existing sprite elements and animate them. Introduction On the official EaselJS site, you’ll find interesting samples and some basic documentation.

If you follow my blog, you know I love playing with this sample. . - Windows Phone 7 Platformer Starter Kit for XNA Studio 4.0 - Silverlight 4 XNA Platformer Level Editor for Windows Phone 7 The platformer sample has been updated by the XNA team and is available for Xbox 360, PC & Windows Phone 7: App Hub – platformer. I’m going to use 2 PNG files as source of sprite sequences.

A running monster, which contains 10 different sprites. CSS Sprite Sheet Animations with steps() There’s a little-known timing function in CSS animations that lets us break an animation into segments––or steps––instead of running it as one continuous animation from start to finish.

CSS Sprite Sheet Animations with steps()

This function is useful for creating sprite sheet animations because we’re able to precisely display each sprite image as a frame without any easing effects inbetween. Animating with the steps() function With steps() we’re able to control the amount of keyframes rendered in an animation’s duration; it progresses the animation in equidistant steps based on the value we set. Knowing this, let’s use steps() to create a simple character sprite sheet animation. I used Illustrator artboards to create each animation frame as a separate 190×240 image, then took advantage of Compass’ spriting feature to quickly generate a horizontal sprite sheet containing all the exported images.

The final animation sprite sheet Creating the animation Running the animation. 70 Expert Ideas For Better CSS Coding. Advertisement CSS isn’t always easy to deal with.

70 Expert Ideas For Better CSS Coding

Depending on your skills and your experience, CSS coding can sometimes become a nightmare, particularly if you aren’t sure which selectors are actually being applied to document elements. An easy way to minimize the complexity of the code is as useful as not-so-well-known CSS attributes and properties you can use to create a semantically correct markup. We’ve taken a close look at some of the most useful CSS tricks, tips, ideas, methods, techniques and coding solutions and listed them below. We also included some basic techniques you can probably use in every project you are developing, but which are hard to find once you need them. And what has come out of it is an overview of over 70 expert CSS ideas which can improve your efficiency of CSS coding. We’d like to express sincere gratitude to all designers who shared their ideas, techniques, methods, knowledge and experience with their readers. 1.1.

Css.maxdesign.com.au - CSS resources and tutorials for web designers and web developers. Mega Collection Of Cheatsheets for Designers And Developers. Cheatsheets and various quick reference guides are available for almost any type of software and language these days.

Mega Collection Of Cheatsheets for Designers And Developers

Unfortunately they’re not always easy to find when you actually need them. This is why I decided to take some time to gather up as many as possible and share them with you here! Hopefully this can be a timesaver for you, along with teaching you a new trick or two. The resources have been divided into various categories to make them easier to find. Below are more than 100 cheat sheets and reference cards for the following topics: CSS3 Cheat Sheet ↓ CSS2 Visual Cheat Sheet ↓ CSS Cheat Sheet (V2) ↓ Css Property Index ↓

The Tipue blog - The complete guide to centering a div. Centering a div in a page, basic This method works with just about every browser, ever.

The Tipue blog - The complete guide to centering a div

Example The value auto in the margin property sets the left and right margins to the available space within the page. The thing to remember is your centered div must have a width property. centering a div within a div, old-school This method works with just about every browser. The margin auto trick strikes again. Centering a div within a div with inline-block With this method the inner div doesn't require a set width. The text-align property only works on inline elements. Why You Should Learn HTML5 Right Now! HTML5 is a web markup language that allows developers to build rich web-based apps that can run on any device via a regular web browser.

Why You Should Learn HTML5 Right Now!

Imagine the power of HTML4 that currently powers most of the web combined with interactive rich-media multimedia capabilities of Adobe Flash and you have HTML5. At the moment, native apps specifically written for Apple’s iOS and Google’s Android mobile operating systems dominate the mobile development field but HTML5 offers many advantages over native apps. Firstly, HTML5 is an open, web-based standard that will run on any device’s web browser. This means that developers aren’t at the mercy of Apple and Google and their closed native app ecosystem and you can freely promote your HTML5 application on the open web.

Secondly, the open web standards of HTML5 allows businesses and developers to control the distribution, monetization and functionality of their mobile applications. Currently, native apps allow for a lot more functionality than HTML5 apps.