Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: more beginner graphics questions  (Read 1334 times)

0 Members and 1 Guest are viewing this topic.

Bryston

  • Newbie
  • *
  • Posts: 8
    • View Profile
more beginner graphics questions
« on: March 19, 2013, 08:30:40 pm »
Im using Foalys Animation Class to tinker around. So far I have an 800x600 playfield with a 400x300 view window. On the playfield I have animated combat dummy. my character has the animations for walking/shooting bow/spear thrust and fidget. I can turn the animated dummy on/off with a key press to reset it for now. And I have a collision event set up that if my character runs into the dummy it animates (to test for future arrow strikes).

Question 1: should I be loading all of the animations into one animation object and then calling up the animations for walk/bow/spear/fidget etc... by which frame to start at or leave it as seperate animation objects for each?

Question 2: my fidget animation is basically a 4 second timer that turns the fidget bool on/off, resets the animation to frame0, runs the animation or stops the animation. what would be the best way to have the fidget animation turn on every x seconds, run for the # of frames in the animation, then turn off and wait til the next timer event?

re-did the video, hopefully it plays better
Video showing what I have working so far..
« Last Edit: March 19, 2013, 11:31:50 pm by Bryston »

Khnemu

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: more beginner graphics questions
« Reply #1 on: March 21, 2013, 07:26:32 pm »
How are you currently handling animation frames ?
What i'd do is have an "update" function in the different objects and pass it the time elapsed since last frame. You can then update the time on your animation with this elapsed time.
Basically in the animation system i developed, i have different times for each animation frame and i change the frames based on the time elapsed. So if you want to have an object autoswitching between animation and idle pose, you could use a loop boolean (which means the animation will restart if it has reached last frame and must change frame) and set the first frame as the "idle" frame with a time of 4 seconds.

I just looked at Foalys Animation Class and it's pretty similar (a bit simpler but still) to what i do. Hence you should be able to do this by adding a time var for each frame and use this to switch your frames instead of a time for all the frames.
(not sure if i'm clear ^^)

 

anything