Page 1 of 1
Animation won't stop, can't tell what went wrong
Posted: Thu Aug 16, 2012 3:24 pm
by Mario-Fan
Yes, I'm working on yet ANOTHER project and have hit yet ANOTHER problem. The player animation for moving up and down won't play, and the animation for moving left and right won't stop. The purple areas on Link's sprite sheet are unused. It's based off a platformer engine by Sean Laurvick (at least, that's what it says in the files), so there are bound to be some bugs in it. (Also the scaling in the options screen isn't working. I coded in the scaling and tried the advice I got when I was scaling that Mega Man engine and it didn't work so I removed the code.) I'm sure there's something as obvious as the screen on this laptop (I'm sorry, I couldn't think of anyting else) that I'm missing, but I'm not sure what it would be.
- zeldax.love
- Source code
- (63.84 KiB) Downloaded 117 times
I know I didn't ask the ripper of the font (Desgardes from the Spriters Resource) for permission, but I'm going to ask the project leader (Crownjo from Exploding Rabbit Forums) to rip the font so I don't have to ask or even credit Desgardes.
Also, for some reason, when it's compressed, it uses the default LOVE screen size, but unpacked it works the way it should.
On a side note, the first thing done in the whole program apart from the stuff in the config file is setting the background color to white. This is done to save energy on LCD screens.
Re: Animation won't stop, can't tell what went wrong
Posted: Thu Aug 16, 2012 3:47 pm
by Roland_Yonaba
Mario-Fan wrote:
Also, for some reason, when it's compressed, it uses the default LOVE screen size, but unpacked it works the way it should.
Make sure to create a
configuration file.
Re: Animation won't stop, can't tell what went wrong
Posted: Thu Aug 16, 2012 3:52 pm
by Mario-Fan
Roland_Yonaba wrote:Mario-Fan wrote:
Also, for some reason, when it's compressed, it uses the default LOVE screen size, but unpacked it works the way it should.
Make sure to create a
configuration file.
Except that there already is one, skimmer.
Re: Animation won't stop, can't tell what went wrong
Posted: Thu Aug 16, 2012 4:08 pm
by Roland_Yonaba
Also, make sure use the
stop() method on your
playerSprites object. Fact is, when starting
love.update, you use
playerSprites:start(), which causes an internal variable,
isRunning, to be always true. Hence, the animation will be played anytime.
Code: Select all
function love.update(dt)
if gameState == "ingame" then
-- check controls
if love.keyboard.isDown("right") then
playerSprites:start()
...
end
if love.keyboard.isDown("left") then
playerSprites:start()
...
end
... etc
end
end
...
[code]function love.keyreleased(key)
...
if (key == "right") or (key == "left") then
p:stopX()
playerSprites:stop()
end
if (key == "up") or (key == "down") then
p:stopY()
playerSprites:stop()
end
...
Haven't tried, but that might solve the problem.
Mario-Fan wrote:Roland_Yonaba wrote:Mario-Fan wrote:
Also, for some reason, when it's compressed, it uses the default LOVE screen size, but unpacked it works the way it should.
Make sure to create a
configuration file.
Except that there already is one, skimmer.
Oh, really ? Can't see it, though.
Re: Animation won't stop, can't tell what went wrong
Posted: Thu Aug 16, 2012 4:29 pm
by Mario-Fan
Roland_Yonaba wrote:Also, make sure use the
stop() method on your
playerSprites object. Fact is, when starting
love.update, you use
playerSprites:start(), which causes an internal variable,
isRunning, to be always true. Hence, the animation will be played anytime.
Code: Select all
function love.update(dt)
if gameState == "ingame" then
-- check controls
if love.keyboard.isDown("right") then
playerSprites:start()
...
end
if love.keyboard.isDown("left") then
playerSprites:start()
...
end
... etc
end
end
...
[code]function love.keyreleased(key)
...
if (key == "right") or (key == "left") then
p:stopX()
playerSprites:stop()
end
if (key == "up") or (key == "down") then
p:stopY()
playerSprites:stop()
end
...
Haven't tried, but that might solve the problem.
Oh, really ? Can't see it, though.
For the code mistake, OMG that's some of a leftover attempt at stopping the standing sprite from flashing purple. It's still not fixed though. For the missing conf file, god dammit I hate this laptop's lack of Winrar. (alsoi'musing3gandit'snotstayingconnectedforverylongwhichissuperannoying)