Skip to content

Commit

Permalink
animated new character
Browse files Browse the repository at this point in the history
  • Loading branch information
Chasmiccoder committed Feb 9, 2022
1 parent b1e9238 commit e2cc8a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions js/Sprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ class Sprite {

// configure animations and initial state
this.animations = config.animations || {
"idle-down": [[0,0]],
"idle-right": [[0,1]],
"idle-up": [[0,2]],
"idle-left": [[0,3]],
"idle-down": [[1,0]],
"idle-right": [[1,2]],
"idle-up": [[1,3]],
"idle-left": [[1,1]],

"walk-down": [[1,0], [0,0], [3,0], [0,0]],
"walk-right": [[1,1], [0,1], [3,1], [0,1]],
"walk-up": [[1,2], [0,2], [3,2], [0,2]],
"walk-left": [[1,3], [0,3], [3,3], [0,3]],
"walk-down": [[1,0], [0,0], [1,0], [2,0]],
"walk-right": [[1,2], [0,2], [1,2], [2,2]],
"walk-up": [[1,3], [0,3], [1,3], [2,3]],
"walk-left": [[1,1], [0,1], [1,1], [2,1]],
}

// this.currentAnimation = "idle-right" //config.currentAnimation || "idle-down";
Expand Down
2 changes: 1 addition & 1 deletion js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const utils = {
nextPosition(initialX, initialY, direction) {
let x = initialX;
let y = initialY;
const size = 32;
const size = 32; // size = 16
if(direction == "left") {
x -= size;
} else if(direction == "right") {
Expand Down

0 comments on commit e2cc8a2

Please sign in to comment.