Menu

Moving Pattern Backwards

General
robert83a1
2011-07-24
2013-05-14
  • robert83a1

    robert83a1 - 2011-07-24

    Hello,
    I cant figure this out :

         if Pattern >= AdImageList.Items.PatternCount-7 then
          begin
           //Pattern := 68;
           Pattern := Pattern - 5 * (AdPerCounter.TimeGap / 1000);

          end;

    I rich a certain point in my animation, a face turns , and now I want it to move backwards how do I do it?

    First I go from 1…. 80
    Then I want to go from 80….1

    Rob

     
  • robert83a1

    robert83a1 - 2011-07-24

    Hello

    Solved it again…was asking too soon, anyway the solution :

      Szamlalo:integer;
      Varakozo:integer;
      Lefel:integer;

        AdPerCounter.Calculate;
        AdPerCounter.MaximumFrameRate:=10; // seems better then the example solution, and rock solid +/- 1,2 fps on //E7500,8GB ram, Windows 7 64 bit

         if Lefel = 0 then
          begin
            Szamlalo:=Szamlalo+1;
            if Szamlalo = 68 then
              begin
               Lefel:=2;
              end
          end;

        if Lefel = 2 then
          begin
            Szamlalo:=Szamlalo+1;
            if Szamlalo >= 75 then
              begin
                Szamlalo:=74;
                Varakozo:=Varakozo+1;
                if Varakozo = 25 then
                  begin
                    Varakozo:=0;
                    Lefel:=3;
                  end;
              end;
          end;

        if Lefel = 3 then
          begin
            Szamlalo:=Szamlalo-1;
            if Szamlalo = 68 then
              begin
                Lefel:=1;
              end;
          end;

        if Lefel = 1 then
          begin
            Szamlalo:=Szamlalo-1;
            if Szamlalo = 0 then Lefel:=0;
          end;

    Anyway what I did is, I have a rotating Moon , it rotates to you , then it yawns, waits 20 frames… goes back, turns away… works like a charm, wonder if this is the best solution… I'm still getting the hang of this, and I usualy when doing things for the first time over complicate them.

    Kudos to the Creator of this awesome product, I would kiss you… but you would get it wrong :)

    Robert

     

Log in to post a comment.