Created
January 29, 2011 20:23
-
-
Save RichardMarks/802157 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sprites.png is 640x240 with the left 320x240 holding player sprite frames | |
// and the right 320x240 holding the enemy frames | |
[Embed(source="../assets/sprites.png")] private const SPRITES_PNG:Class; | |
var sprites:BitmapData = (new SPRITES_PNG).bitmapData; | |
var playerSprites:BitmapData = new BitmapData(320, 240); | |
var enemySprites:BitmapData = new BitmapData(320, 240); | |
playerSprites.copyPixels(sprites, new Rectangle(0,0, 320, 240), new Point); | |
enemySprites.copyPixels(sprites, new Rectangle(320,0, 320, 240), new Point); | |
var playerSpritemap:Spritemap = new Spritemap(playerSprites, 32, 32); | |
var enemySpritemap:Spritemap = new Spritemap(enemySprites, 32, 32); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment