Jump to content




Animation


  • You cannot reply to this topic
7 replies to this topic

#1 Sammich Lord

    IRC Addict

  • Members
  • 1,212 posts
  • LocationThe Sammich Kingdom

Posted 04 November 2012 - 08:50 PM

I was wondering what the best way to animate something in real time would be? For instance if I had a few frames like this:
0
 0
  0
And let's say I had other stuff on the screen that I did not want to re-write again. But I do not want to have a rendering engine to actually move the "0" from one spot to another. So what would the best way to do that be?

#2 Shnupbups

  • Members
  • 596 posts
  • LocationThat place over there. Y'know. The one where I am.

Posted 04 November 2012 - 10:23 PM

You could just clear that line with term.clearLine()

#3 Leo Verto

  • Members
  • 620 posts
  • LocationOver there

Posted 05 November 2012 - 01:15 AM

You could code a keyframe system, by moving a line from one "0" to the next one, but it probably wouldn't be that easy.

#4 Doyle3694

  • Members
  • 815 posts

Posted 05 November 2012 - 01:21 AM

store everything you want permanent in a table and then for a new frame just clear the screen and print this out and then the actual frame. ofcourse if your permanent stuff is a few lines alone then you cna just clearLine() the other lines

#5 Sammich Lord

    IRC Addict

  • Members
  • 1,212 posts
  • LocationThe Sammich Kingdom

Posted 05 November 2012 - 01:29 AM

The point of this is to NOT clear the whole screen. The reason is because if you have a game running at 20 FPS(Max tick rate in minecraft) and you redraw the screen every tick there is flickering. The flickering happens in both SMP and SSP.

#6 Leo Verto

  • Members
  • 620 posts
  • LocationOver there

Posted 05 November 2012 - 01:33 AM

Clearing single chars by printing " " might work.

#7 Doyle3694

  • Members
  • 815 posts

Posted 05 November 2012 - 01:36 AM

Leo Verto: Yeah thats a really good idea

And Human: I have not been experiencing this with my little game which redrew the screen 40 times a second

#8 Leo Verto

  • Members
  • 620 posts
  • LocationOver there

Posted 05 November 2012 - 01:40 AM

It always depends on your hardware, but keeping the lag to a minimum is just profit for all users.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users