I was under the impression that "quads" were predominately used coinciding with sprite sheets? There has to be a way to accomplish that same task of animation without sprite sheets and quads right?DarkShroom wrote: ↑Mon Jun 18, 2018 11:31 pm i agree with you, well done, i have rarely agreed with some of these libraries myself, although i am not sure it might have been the case i should've used one of the camera ones as i am sort of rendering everything offscreen at the moment
i have no problem with animation in my framework, i simply string an array of images to cycle through, and have a separate optional frame duration array
i understand you're going for a tileset solution though... i don't want this yet as i consider myself to be prototyping... i feel if i do use tilesets, i will build these in lua itself from my separate frame assets (i don't like working with tile-sets, it makes me feel like i'm on a megadrive)
this answer may not help you, but sometimes it is best to get a prototype solution working first (although this may depend on your assets)
however, that said as it may be a required future optimisation i might make a point of tackling this tomorrow, assuming i finish my terrain deformation strategy and other pending task
in the meantime, have you read this yet, i don't remember it being at all complicated:
https://love2d.org/wiki/Tutorial:Effici ... _Scrolling
i see no "quads" in your code... good luck
Could really use some help in Lua, have hit a wall and can't move forward.
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Could really use some help in Lua, have hit a wall and can't move forward.
-
- Citizen
- Posts: 86
- Joined: Mon Jul 17, 2017 2:07 pm
Re: Could really use some help in Lua, have hit a wall and can't move forward.
yes they are
i thought you where using spritesheets?
well yeah without them, just cycle through the pictures with a timer, have the pictures in like a table of pictures
i thought you where using spritesheets?
well yeah without them, just cycle through the pictures with a timer, have the pictures in like a table of pictures
-
- Party member
- Posts: 234
- Joined: Mon Aug 29, 2016 8:51 am
-
- Citizen
- Posts: 86
- Joined: Mon Jul 17, 2017 2:07 pm
Re: Could really use some help in Lua, have hit a wall and can't move forward.
hehe... nah everyone trying to be helpful but i feel there's some confusion going on
so myself, i DON'T use spritesheets (yet), i just cycle through the pictures i have in a table (using a timer and a frame duration), i think i gather from your replies you just don't believe it's the right way or something
you don't have to use the quads, and it sounds like you're not bothered about that yet
so myself, i DON'T use spritesheets (yet), i just cycle through the pictures i have in a table (using a timer and a frame duration), i think i gather from your replies you just don't believe it's the right way or something
you don't have to use the quads, and it sounds like you're not bothered about that yet
-
- Citizen
- Posts: 86
- Joined: Mon Jul 17, 2017 2:07 pm
Re: Could really use some help in Lua, have hit a wall and can't move forward.
i feel you'll have an easier time if you can articulate your questions more clearly
the subject title says nothing about animation, and we where all unclear on the question
intended as constructive criticism, but i understand it's difficult sometimes
the subject title says nothing about animation, and we where all unclear on the question
intended as constructive criticism, but i understand it's difficult sometimes
-
- Party member
- Posts: 234
- Joined: Mon Aug 29, 2016 8:51 am
Re: Could really use some help in Lua, have hit a wall and can't move forward.
Maybe try this paz:
You're kinda doing it wrong. You shouldn't store the x,y for each frame. This table setup isn't an animation, but more like different entities. Why would animations have different x,y ? It should be x,y offsets not general position on the screen. You need to rethink that. With your original code, your expected result, if it worked, would be:
kirby running from left-to-right but when you let go of the button, kirby standing is in the middle of the screen, since we were just changing kirby running' animation.
Code: Select all
function love.update(dt)
local elapsedTime = 0
elapsedTime = elapsedTime + dt --one down if elapsedTime > 0.5 every .5 seconds the loop runs and is reset at the end.
if (love.keyboard.isDown("d")) then
currentFrame = 2
for index,frame in ipairs(para) do
frame.x = frame.x + 200 * dt
if frame.x > love.graphics.getWidth() + frame.image:getWidth() then frame.x = 0 end
end
else
currentFrame = 1
end
elapsedTime = 0
end
kirby running from left-to-right but when you let go of the button, kirby standing is in the middle of the screen, since we were just changing kirby running' animation.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 2 guests