{"action":"closed","issue":{"url":"https://api.github.com/repos/tesselode/sodapop/issues/1","repository_url":"https://api.github.com/repos/tesselode/sodapop","labels_url":"https://api.github.com/repos/tesselode/sodapop/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/tesselode/sodapop/issues/1/comments","events_url":"https://api.github.com/repos/tesselode/sodapop/issues/1/events","html_url":"https://github.com/tesselode/sodapop/issues/1","id":157536384,"number":1,"title":"Animation stops.","user":{"login":"Lost-Puppy","id":8607357,"avatar_url":"https://avatars.githubusercontent.com/u/8607357?v=3","gravatar_id":"","url":"https://api.github.com/users/Lost-Puppy","html_url":"https://github.com/Lost-Puppy","followers_url":"https://api.github.com/users/Lost-Puppy/followers","following_url":"https://api.github.com/users/Lost-Puppy/following{/other_user}","gists_url":"https://api.github.com/users/Lost-Puppy/gists{/gist_id}","starred_url":"https://api.github.com/users/Lost-Puppy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lost-Puppy/subscriptions","organizations_url":"https://api.github.com/users/Lost-Puppy/orgs","repos_url":"https://api.github.com/users/Lost-Puppy/repos","events_url":"https://api.github.com/users/Lost-Puppy/events{/privacy}","received_events_url":"https://api.github.com/users/Lost-Puppy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-05-30T17:23:59Z","updated_at":"2016-06-07T14:02:17Z","closed_at":"2016-06-07T14:02:17Z","body":"This code may be messy but the main problem is the point where my character starts moving.(When i press the buttons) and then animation stops on 1 frame. What did i do wrong ?\r\n\r\n```lua\r\nrequire \"libraries/camera\"\r\n\r\n\r\n\r\nfunction love.load()\r\n   sodapop = require 'libraries/sodapop'\r\n\r\n\r\n   bg_image = love.graphics.newImage(\"images/bg.png\")\r\n   bg_image:setWrap(\"repeat\", \"repeat\")\r\n\r\n   bg_quad = love.graphics.newQuad(0, 0, 3000, 3000, bg_image:getWidth(), bg_image:getHeight())\r\n\r\n\r\n   \r\n   player = {}\r\n   player.img = love.graphics.newImage(\"images/dude.png\")\r\n   player.speed = 100\r\n   player.x = 1500\r\n   player.y = 1500\r\n\r\n\r\n\r\n    playerSprite = sodapop.newAnimatedSprite(player.x, player.y)\r\n    \r\n    playerSprite:addAnimation('walk1', {\r\n    image        = love.graphics.newImage 'images/playeranim.png',\r\n    frameWidth   = 64,\r\n    frameHeight  = 64,\r\n    frames       = {\r\n      {1, 4, 9, 4, .2},\r\n    },\r\n  })\r\n\r\n    playerSprite:addAnimation('walk2', {\r\n    image        = love.graphics.newImage 'images/playeranim.png',\r\n    frameWidth   = 64,\r\n    frameHeight  = 64,\r\n    frames       = {\r\n      {1, 2, 9, 2, .2},\r\n    },\r\n  })\r\n\r\n    playerSprite:addAnimation('walk3', {\r\n    image        = love.graphics.newImage 'images/playeranim.png',\r\n    frameWidth   = 64,\r\n    frameHeight  = 64,\r\n    frames       = {\r\n      {1, 3, 9, 3, .2},\r\n    },\r\n  })\r\n\r\n    playerSprite:addAnimation('walk4', {\r\n    image        = love.graphics.newImage 'images/playeranim.png',\r\n    frameWidth   = 64,\r\n    frameHeight  = 64,\r\n    frames       = {\r\n      {1, 1, 9, 1, .2},\r\n    },\r\n  })\r\n\r\nend\r\n\r\n\r\n\r\nfunction love.update(dt)\r\n\r\n\tplayerSprite:update(dt)\r\n\t\r\n\r\n\r\n\t-- exit game\r\n\tif love.keyboard.isDown('escape') then\r\n\t\tlove.event.push('quit')\r\n\tend\r\n\r\n\t--Restart\r\n\tif(love.keyboard.isDown('r')) then\r\n \t\tlove.load()\r\n \tend\r\n\r\n \t--PlayerControl\r\n \tif love.keyboard.isDown(\"a\") then\r\n\t\tplayer.x = player.x - player.speed*dt\r\n\t\tplayerSprite.x = player.x\r\n\t\tif playerSprite ~= \"walk2\" then\r\n\t\t\tplayerSprite:switch 'walk2'\r\n\t\tend\t\r\n\t\tif player.x <= 650 then\r\n\t\t\tplayer.x = 650\r\n\t\tend\r\n\tend\r\n\r\n\tif love.keyboard.isDown(\"d\") then\r\n\t\tplayer.x = player.x + player.speed*dt\r\n\t\tplayerSprite.x = player.x\r\n\t\tplayerSprite:switch 'walk1'\r\n\t\tif player.x >= 2350 then\r\n\t\t\tplayer.x = 2350\r\n\t\tend\r\n\tend\r\n\r\n\tif love.keyboard.isDown(\"w\") then\r\n\t\tplayer.y = player.y - player.speed*dt\r\n\t\tplayerSprite.y = player.y\r\n\t\tplayerSprite:switch 'walk4'\r\n\t\tif player.y <= 650 then\r\n\t\t\tplayer.y = 650\r\n\t\tend\r\n\tend\r\n\r\n\tif love.keyboard.isDown(\"s\") then\r\n\t\tplayer.y = player.y + player.speed*dt\r\n\t\tplayerSprite.y = player.y\r\n\t\tplayerSprite:switch 'walk3'\r\n\t\tif player.y >= 2350 then\r\n\t\t\tplayer.y = 2350\r\n\t\tend\t\r\n\tend\r\n\r\n\t--Camera\r\n\tif player.x > love.graphics.getWidth() / 2 then\r\n\t\tcamera.x = player.x - love.graphics.getWidth() / 2\r\n\tend\t\r\n\t\t\r\n\tif player.y > love.graphics.getWidth() / 2 then\r\n\t\tcamera.y = player.y - love.graphics.getWidth() / 2\r\n\tend\t\r\n\r\n\t\t\r\n\r\nend\r\n\r\n\r\n\r\nfunction love.draw()\r\n\tcamera:set()\r\n\r\n\tlove.graphics.draw(bg_image, bg_quad, 0, 0)\r\n\tplayerSprite:draw()\r\n\r\n\tcamera:unset()\r\nend\r\n```"}}
{"actor":{"display_login":"tesselode"}}