diff --git a/main.go b/main.go index 73f4f64..1529f3b 100644 --- a/main.go +++ b/main.go @@ -52,13 +52,14 @@ func run() { bg := pixel.NewSprite(background, background.Bounds()) //batch := pixel.NewBatch(&pixel.TrianglesData{}, spritesheet) - /* - When creating the sprite, you need to know big each frame is inside the spritesheet. - If you use aseprite or some other pixel art program, you can find the number of pixels - within each frame. For our sprite sheet, each frame is 96 px wide and 96 px high. So - we increment it by 96 for both x and y so that it can get the position of the frame - at the bottom right corner. + + /* setting-character-sprite + + basically changed it around so the 12 frames of the character with yellow hair + are added to spritesFrames. + */ + var spritesFrames []pixel.Rect var frameWidth, frameHeight float64 = 96, 96 for y := spritesheet.Bounds().Min.Y; y < frameHeight*4; y += 96 {