## Using easing equations

ljdp
Party member
Posts: 209
Joined: Sat Jan 03, 2009 1:04 pm
Contact:

### Re: Using easing equations

Well most class "systems" in lua are like the SECS you talk about.
The basics of using classes in lua is just setting the metatable to it's parent, everything else is just a style of coding.
Before lua I used to use gamemaker and it was very object orientated in that you would create pages and objects, each page would have 'instances' of the objects in them.

In the example above theres a file called page.lua which mimics this functionality. I.e

Code: Select all

pages = {}
pages.__index = pages

function pages:create()
local page = {}
setmetatable( page, self )
return page
end

function pages:draw()
--draw self
end

game = {}
game.page1 = pages:create()
game.thispage = game.page1
end

function draw()
game.thispage:draw()
end

bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

### Re: Using easing equations

I was actually asking which one you used..

ljdp
Party member
Posts: 209
Joined: Sat Jan 03, 2009 1:04 pm
Contact:

### Re: Using easing equations

oh, >_> well I use my own one

paclito
Prole
Posts: 35
Joined: Wed Apr 22, 2009 8:33 pm

### Re: Using easing equations

I've been working and understanding the anim.lua but in the 0009 example, each time i reset the anim the program gets more and more slowly and, when creating the anim, she isn't instantly.

The callback is superb to charge next anim from the array.... my tanks will move alone on the screeeeeeeeeeeeeeeeeeeeen jaaaaaaaaaajajajajajajaj
Attachments
moves3.love

paclito
Prole
Posts: 35
Joined: Wed Apr 22, 2009 8:33 pm

### Re: Using easing equations

The response is in your code I think, the version of anim.lua isn't the most recent argggggggggg!!!

here is the code with the right version.

Next step is to make 2d moves (one enemy that walks from one cornet to another on the screen)

and next change the angle of the enemy when he arrives to a 'point' where point is each position of the array 'positions' and a transition is the walk from one point to another point.
Attachments
moves4.love

TsT
Party member
Posts: 161
Joined: Thu Sep 25, 2008 7:04 pm
Location: France
Contact:

### Re: Using easing equations

I got a problem with your moves demo(moves4.love), the animation run to quickly !
I think found the reason, it seems because you update the animation step each call of update().
But the update's call frequency are not fixed.

You should use the delta-time, something like :

Code: Select all

                timer = timer + dt

By this way we can setup animation with a fixed number of time.

Best Regards,
My projects current projects : dragoon-framework (includes lua-newmodule, lua-provide, lovemodular, , classcommons2, and more ...)

paclito
Prole
Posts: 35
Joined: Wed Apr 22, 2009 8:33 pm

### Re: Using easing equations

ok, I will add more examples to my demos program, actually I`m studyng how to add a callback when the count reaches the end aaaaaaaaaaaaaaaaand trying to get velocity and acceleration instead of space...... for usage with box2d basdlfjowasdlfoe all of this makes me crazy. I've get my old physics books.... angles, components, formulas........

And the best is that one month ago, i was a happy systems enginneer ..... that has seeing his son gaming with the wiimote and the wiitanks........... arghhh!!! this is the best!!!

### Who is online

Users browsing this forum: No registered users and 35 guests