androidandroid-layoutloopscocos2d-android

Implementing loop of images in android


I want to implement the loop of my android game if some body could help me

I have loaded random images on image view.

Now i want to accelerate my image from bottom left of screen to center of screen making an angle of 45 degrees.after reaching the peek it should come down at the bottom right corner making 45 degrees angle..

my code is

int[] imageView = {
            R.id.imageV
            };

    int[] images ={
          R.drawable.image1,
          R.drawable.image2,
          R.drawable.image3,
          R.drawable.image4
         };

      Random rand=new Random();

      for(int v : imageView) {
            ImageView iv = (ImageView)findViewById(v);

            iv.setImageResource(images[rand.nextInt(images.length)]);

        }

Solution

  • First check the docs, and try to make it by yourself. If you can't, come back with your code and we can help you to fix the error.

    Basically you should make the view to run various animations (move and rotate) and add them in an animation set.

    https://developer.android.com/guide/topics/graphics/animation.html

    https://developer.android.com/guide/topics/resources/animation-resource.html

    https://developer.android.com/reference/android/view/animation/package-summary.html