Android Open Source - Tilt-snake Shape Tools






From Project

Back to project page Tilt-snake.

License

The source code is released under:

Apache License

If you think the Android project Tilt-snake listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.awhittle.tiltsnake;
/*from   w w  w  .ja  va  2s  .  c o  m*/
public class ShapeTools {

  public static float[] translateMatrix(float A[], float transX, float transY){

    float[] B = A;
    
    for(int i=0; i<B.length; i+=3 ){
      B[i] = A[i] + transX;
    }
    
    for(int j=1; j<B.length; j+=3 ){
      B[j] = A[j] + transY;
    }
    
    return B;
  }

  public static float[] scaleMatrix(float A[], float scale){

    float[] B;
    B = new float[A.length];
    
    for(int i=0; i<A.length; i++ )
      B[i] = A[i] * scale;
    
    return B;
  }
  
  
}




Java Source Code List

com.awhittle.tiltsnake.Direction.java
com.awhittle.tiltsnake.Egg.java
com.awhittle.tiltsnake.GameActivity.java
com.awhittle.tiltsnake.Head.java
com.awhittle.tiltsnake.MainActivity.java
com.awhittle.tiltsnake.Movement.java
com.awhittle.tiltsnake.MyGLRenderer.java
com.awhittle.tiltsnake.MyGLSurfaceView.java
com.awhittle.tiltsnake.Saving.java
com.awhittle.tiltsnake.ShapeTools.java
com.awhittle.tiltsnake.Square.java
com.awhittle.tiltsnake.Tail.java