Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  Utils essentials  (Read 14042 times)
0 Members and 1 Guest are viewing this topic.
Offline TheMatrix154

Junior Duke


Medals: 2



« Reply #30 - Posted 2010-04-19 10:00:09 »

Creates a MD5-Hash for the given String
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
   public static final String md5HashFromString(String text) {
      try {
         MessageDigest md5 = MessageDigest.getInstance("MD5");
         md5.reset();
         md5.update(text.getBytes("UTF-8"));
         byte[] result = md5.digest();
         
         StringBuilder sb = new StringBuilder();
         
         for (int i = 0; i < result.length; i += 1) {
            String value = Integer.toHexString(0xFF & result[i]);
            if (value.length() < 2) {
               value = "0" + value;
            }
            sb.append(value);
         }
         
         return sb.toString();
         
      } catch (Exception e) {
         e.printStackTrace();
      }
     
      return null;
   }

Offline tris2k

Junior Newbie





« Reply #31 - Posted 2010-06-24 18:07:52 »

Use Non-Power Of 2 Textures.
On Android, this converts a Non Pow of 2 texture to and OpenGL(ES) ready Bitmap.
No more batch image resizing Smiley

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
   private Bitmap glBitmap(Bitmap bitmap) {
      Bitmap pbmp;
      int texWidth = get2Fold(bitmap.getWidth());
      int texHeight = get2Fold(bitmap.getHeight());
      pbmp = Bitmap.createBitmap(texWidth, texHeight, bitmap.getConfig());
      for (int y = 0; y < bitmap.getHeight(); y++) {
         for (int x = 0; x < bitmap.getWidth(); x++) {
            pbmp.setPixel(x, y, bitmap.getPixel(x, y));
         }
      }
      return pbmp;
   }

1  
2  
3  
4  
5  
6  
7  
   public static int get2Fold(int fold) {
       int ret = 2;
       while (ret < fold) {
           ret *= 2;
       }
       return ret;
   }


Your texture will then use the texture coordinates:

1  
2  
widthRatio = (float) width / (texWidth < 1 ? width : texWidth);   
heightRatio = (float) height / (texHeight < 1 ? height : texHeight);


Where width is the original image with and texWidth is the with of the new Pow Of 2 texture Bitmap return by glBitmap()...
Offline DavidX

Senior Newbie





« Reply #32 - Posted 2010-07-13 06:51:17 »

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
   public static Point lineIntersect(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) {
      double denom = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);
      if (denom == 0.0) { // Lines are parallel.
         return null;
      }
      double ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3))/denom;
      double ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3))/denom;
        if (ua >= 0.0f && ua <= 1.0f && ub >= 0.0f && ub <= 1.0f) {
            // Get the intersection point.
            return new Point((int) (x1 + ua*(x2 - x1)), (int) (y1 + ua*(y2 - y1)));
        }

      return null;
   }


line intersection algo
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ewjordan

Junior Duke





« Reply #33 - Posted 2010-07-24 21:10:44 »

Great idea for a thread!  I'll add my most used utility...

I often find myself needing to randomize amongst elements in a set with weighted probabilities; if probabilities are all equal, then Random::nextInt(n) is the way to go, but if you need to draw from a different distribution it's actually bit of work to get something that works right.

This code has only been lightly tested in its current form (I changed it a bit from where I last used it, mainly to accept varargs), and I have no guarantees that it's optimal, but I did run some basic tests and it appears to be working fairly well (seems correct, and runs at several millions of picks per second as long as the probabilities array is less than 50 or so, even using the garbage-producing version), and this is the several-th iteration of this code, so it shouldn't be too buggy; I use some variant of this all over the place both in game code and Monte Carlo simulation, so it might be useful to someone:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
   /**
    * Spin a spinner with the given relative probabilities, get the index that results.  This
    * method does not alter the passed array.
    * <pre>
    * normalizedSpinner(10, 20, 30) => 1/6 chance of 0, 1/3 chance of 1, 1/2 chance of 2
    * normalizedSpinner(1,1,2) => 1/4 chance of 0, 1/4 chance of 1, 1/2 chance of 2
    * </pre>
    * Note: during intermediate steps, this method will cause two float[] creations, the
    * same length as the probabilities array.  If creation is a concern, use {@link #spinner(float[], float[])}
    * to pass your own pre-allocated intermediate array and handle the probability normalization yourself.
    * Also remember that unless probabilities is passed as an array, Java's varargs will create another
    * intermediate array.
    *
    * @param probabilities a list of relative probabilities
    * @return the index of the event that is randomly chosen based on the provided probabilities
    */

   public static int normalizedSpinner(float ... probabilities) {
      float sum = 0.0f;
      for (int i=0; i<probabilities.length; ++i) {
         sum += probabilities[i];
      }
      if (sum == 0.0f) {
         throw new IllegalArgumentException("At least one probability must be non-zero.");
      } else if (sum < 0.0f) {
         throw new IllegalArgumentException("Probabilities may not be negative.");
      }
      float[] normProbs = new float[probabilities.length];
      for (int i=0; i<probabilities.length; ++i) {
         normProbs[i] = probabilities[i] / sum;
      }
      return spinner(normProbs);
   }
   
    /**
     * Spin a spinner with the given probabilities, get the index that results.
     * Sum of probabilities should add up to 1f.
     *
     * If the sum of probabilities is less than 1, the last index gets all the
     * remaining probability.
     * e.g. spinner(0.5f, 0.3f) => 50% chance of 0, 50% chance of 1
     *
     * If the sum of probabilities is greater than 1, the probabilities are clipped
     * at 1.
     *
     * e.g. spinner(0.5f, 0.3f, 0.5f) => 50% chance of 0, 30% chance of 1, 20% chance of 2 (extra 30% discarded)
     *
     * This method creates an intermediate float array the same length as probabilities; if garbage
     * creation is a concern, use {@link #spinner(float[], float[])} instead, and provide a pre-allocated
     * array of the correct length as the first parameter.
     *
     * @param probabilities a list of probabilities that should add up to 1
     * @return the index of the event that is randomly chosen based on the provided probabilities
     */

    public static int spinner(float ... probabilities) {
        float[] mins = new float[probabilities.length];
        return spinner(mins, probabilities);
    }
   
    /**
     * Used instead of {@link #spinner(float...)} to avoid garbage creation by manually supplying
     * intermediate array.
     *
     * @param auxiliaryArray a pre-allocated array to use for intermediate step that should
     * have at least the same length as the probabilities array (used to avoid intermediate allocations)
     * @param probabilities a list of probabilities that should add up to 1
     * @return the index of the event that is chosen
     * @see Spinner#spinner(float...)
     */

    public static int spinner(float[] auxiliaryArray, float[] probabilities) {
       if (auxiliaryArray.length < probabilities.length){
          throw new IllegalArgumentException("Auxiliary array must have at least the same length as probabilities array.");
       }
       float sum = 0.0f;
        float[] mins = auxiliaryArray;
        for (int i = 0; i < probabilities.length; ++i) {
            if (probabilities[i] < 0.0f) {
                throw new IllegalArgumentException("Probabilities must be positive; received " + probabilities[i] +
                        " as parameter " + i + ".");
            }
            mins[i] = sum;
            sum += probabilities[i];
        }
        double randomNumber = Math.random();
        for (int i = probabilities.length - 1; i > 0; --i) {
            if (randomNumber >= mins[i]) {
                return i;
            }
        }
        return 0;
    }


Sorry, more Javadoc than code, I know...

The idea is that you're spinning a spinner (like on a game board or something) with the passed probabilities, and the result is the array index of the probability that gets picked.  Probably not the clearest name, idunno.

Re: the different functions, normalizedSpinner first normalizes the passed probabilities to sum to 1, and the two-array version lets you pass your own auxiliary array to be used internally so that no garbage is created - when I use these methods, I'm sometimes running hundreds of thousands of trials over distributions with thousands of probabilities, so garbage becomes a huge issue; obviously in those cases I also swap out the Math.random() call with a faster RNG, and sometimes after debugging I strip the parameter checking code, too, though those branches are usually very predictable so it shouldn't make a big difference.
Offline appel

JGO Wizard


Medals: 51
Projects: 4


I always win!


« Reply #34 - Posted 2010-07-26 10:51:35 »

A simple circle-circle collision check. Not sure about it's performance, but it surely looks simple enough. Just calculates the euclidean distance between the origin of the two circles, subtracting the two radius from the distance will give either a negative or positive distance.  Negative means they collide, positive means they don't.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
       // Check if circle (x1,y1,radius1) collides with another circle of (x2,y2,radius2).
   public static boolean doCirclesCollide(float x1, float y1, float radius1, float x2, float y2, float radius2) {
      float d = euclideanDistance(x1, y1, x2, y2);

      d -= radius1 + radius2;

      return d < 0;
   }

        // Added dependency
   public static float euclideanDistance(float x1, float y1, float x2, float y2) {
      float a = x1-x2;
      float b = y1-y2;
      return (float) Math.sqrt(a*a + b*b);
   }

edit: use Riven's function below.

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 816
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #35 - Posted 2010-07-26 11:03:55 »

To see whether two circles (or spheres) intersect, there is no need to calculate the square root:

1  
2  
3  
4  
5  
6  
7  
public static boolean doCirclesCollide(float x1, float y1, float radius1, float x2, float y2, float radius2)
{
    float dx = x2 - x1;
    float dy = y2 - y1;
    float d = radius1 + radius2;
    return (dx * dx + dy * dy) < (d * d);
}

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline appel

JGO Wizard


Medals: 51
Projects: 4


I always win!


« Reply #36 - Posted 2010-07-26 11:08:14 »

This function should really never be used, actually I never use it. But if you really have to find out where the lerp interpolation is at, that is at what time, then you can simply do a little check that goes like this:

For a interpolation between a and b, currently being at x, then lerpTime gives you t of that.

(You can decide if you want the overflow checks or not, just remove all the if's and return t directly)

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
        // Returns t of x between a and b.
   public static float lerpTime(float a, float b, float x) {
      if (a == x)
         return 0;
      else if (a == b)
         return 1;

      float t = (x - a) / (b - a);

      if (t >= 1)
         return 1;
      else
         return t;
   }

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 816
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #37 - Posted 2010-07-26 11:18:32 »

Not trying to be harassing Smiley, but calling a method 'lerp' when it does the 'inverse of a lerp' would be highly confusing. Further, it's not really related to 'time' in any way. There's the code I use:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
   public static final float lerp(float t, float a, float b)
   {
      return a + t * (b - a);
   }

   public static final float invLerp(float cur, float min, float max)
   {
      return (cur - min) / (max - min);
   }

   public static final float interpolate(float cur, float min, float max, float startValue, float endValue)
   {
      return lerp(invLerp(cur, min, max), startValue, endValue);
   }

   public static final float cappedInterpolate(float cur, float min, float max, float startValue, float endValue)
   {
      if (cur < min)
         return startValue;
      if (cur > max)
         return endValue;
      return interpolate(cur, min, max, startValue, endValue);
   }

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline appel

JGO Wizard


Medals: 51
Projects: 4


I always win!


« Reply #38 - Posted 2010-07-26 11:39:03 »

Not trying to be harassing Smiley, but calling a method 'lerp' when it does the 'inverse of a lerp' would be highly confusing. Further, it's not really related to 'time' in any way. There's the code I use:

The only way to squeeze out good code is to post such a bad code that it offends the good programmers which forces them to post corrections Wink

Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 816
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #39 - Posted 2010-07-26 12:03:28 »

The only way to squeeze out good code is to post such a bad code that it offends the good programmers which forces them to post corrections Wink

On that note: here I have this function that I never used, but I couldn't force myself to delete it:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
   public static final double curve(double distance, double topDistance, double margin, double power)
   {
      // Shape: __________________/\_____________________
      //     _/\_ == pow(sin(n), power)  

      // value 0 at topDistance-margin
      // value 1 at topDistance
      // value 0 at topDistance+margin

      double min = topDistance - margin;
      double max = topDistance;
      double ratio = (distance - min) / (max - min);
      double angle = ratio * 0.5 * Math.PI;
      if (angle < 0.0 || angle > Math.PI)
         return 0.0;
      double sinCurve = Math.sin(angle);
      return Math.pow(sinCurve, power);
   }

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 816
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #40 - Posted 2010-07-26 12:08:51 »

While we're on the topic of interpolation, he's how I calculate height on a uniform grid, by splitting a quad into two triangles:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
   public static final float interpolate2d(float x, float z, float nw, float ne, float se, float sw)
   {
      // n -= n % dim -> n = 0..dim (local offset)
      x = x - (int) x;
      z = z - (int) z;

      // Which triangle of quad (left | right)
      if (x > z)
         sw = nw + se - ne;
      else
         ne = se + nw - sw;

      // calculate interpolation of selected triangle
      float n = lerp(x, nw, ne);
      float s = lerp(x, sw, se);
      return lerp(z, n, s);
   }

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline Hansdampf

Senior Duke


Projects: 3


too offending?


« Reply #41 - Posted 2010-07-26 12:25:21 »

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
public static String getStackTrace(){
   StringWriter sw = new StringWriter();
   new Throwable().printStackTrace(new PrintWriter(sw));
   return sw.toString();
}

public static void ultraHandySysoutJumpWithOneClickToTheCodeInEclipse(Object o){
   System.out.println(""+o+"\n--------------\n"+getStackTrace());
}

public static void main(String[] args){
   ultraHandySysoutJumpWithOneClickToTheCodeInEclipse("nice!");
}


This comes very handy in Eclipse - you can jump directly to the code, Eclipse formats the trace as links. This saved me a lot of time. Maybe shorten the method name to sysout or so.

lots of sillystupid games: http://www.emaggame.com
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 816
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #42 - Posted 2010-07-26 12:33:54 »

1  
public static String getStackTrace()


Thread.dumpStack() seems to work just fine Smiley

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline Hansdampf

Senior Duke


Projects: 3


too offending?


« Reply #43 - Posted 2010-07-26 12:44:45 »

Thread.dumpStack() seems to work just fine Smiley
but... then it looks like an aggressive red error and you don't have control in which order it prints (different threads). Try:
1  
2  
3  
4  
   for(int i=0;i<100;i++){
         Thread.dumpStack();
         System.out.println(""+i);
      }


lots of sillystupid games: http://www.emaggame.com
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 816
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #44 - Posted 2010-07-26 12:55:17 »

but... then it looks like an aggressive red error and you don't have control in which order it prints (different threads).

You mean you don't print everything to stderr? Grin

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline Hansdampf

Senior Duke


Projects: 3


too offending?


« Reply #45 - Posted 2010-07-26 13:00:55 »

You mean you don't print everything to stderr? Grin
I use http://marian.musgit.com/grepconsole/index.html to colorize all errors in rainbow colors  Wink

lots of sillystupid games: http://www.emaggame.com
Offline Roquen
« Reply #46 - Posted 2010-07-26 13:23:45 »

On that note: here I have this function that I never used, but I couldn't force myself to delete it:

You can get similar kinds of curves by building on the perlin ease function, without the pesky trig functions.
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #47 - Posted 2010-07-26 17:02:09 »

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
public static String getStackTrace(){
   StringWriter sw = new StringWriter();
   new Throwable().printStackTrace(new PrintWriter(sw));
   return sw.toString();
}

public static void ultraHandySysoutJumpWithOneClickToTheCodeInEclipse(Object o){
   System.out.println(""+o+"\n--------------\n"+getStackTrace());
}

public static void main(String[] args){
   ultraHandySysoutJumpWithOneClickToTheCodeInEclipse("nice!");
}


This comes very handy in Eclipse - you can jump directly to the code, Eclipse formats the trace as links. This saved me a lot of time. Maybe shorten the method name to sysout or so.
I don't quite understand what this does. So you can click the line in the stack trace to jump to it? That seems to usually work for me already.

See my work:
OTC Software
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 816
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #48 - Posted 2010-07-26 17:04:12 »

He means it is printed to stdout as opposed to stderr

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline appel

JGO Wizard


Medals: 51
Projects: 4


I always win!


« Reply #49 - Posted 2010-11-24 12:38:33 »

1  
2  
3  
4  
5  
6  
7  
   public static float getXAtEndOfRotatedLineByOrigin(float x, float lineLength, float angle) {
      return x + (float) Math.cos(Math.toRadians(angle)) * lineLength;
   }

   public static float getYAtEndOfRotatedLineByOrigin(float y, float lineLength, float angle) {
      return y + (float) Math.sin(Math.toRadians(angle)) * lineLength;
   }


Check out the 4K competition @ www.java4k.com
Check out GAMADU (my own site) @ http://gamadu.com/
Offline OttoMeier
« Reply #50 - Posted 2010-11-24 21:13:32 »

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
/**Lockup table for trigonometric functions (sinus and cosinus) used to improve performance
 * Singelton
 * @author Henning Brackmann
 */

public class TrigonometricLockupTable {
  private static TrigonometricLockupTable instance;
  private float[] sinustable_;
  private float[] cosinustable_;
  float precision=10;
 

  private TrigonometricLockupTable(){
    sinustable_ = new float[(int) (360*precision)];
    for (int i=0;i<sinustable_.length;i++){
      sinustable_[i]=(float)Math.sin(Math.toRadians(i/precision));
    }
   
    cosinustable_ = new float[(int) (360*precision)];
    for (int i=0;i<cosinustable_.length;i++){
      cosinustable_[i]=(float)Math.cos(Math.toRadians(i/precision));
    }
  }
 
  public static TrigonometricLockupTable getInstance(){
    if (instance==null){
      instance = new TrigonometricLockupTable();
    }
    return instance;
  }
 
  /**compute the sinus from lockup table
   * no range check
   * @param aAngle Values between 0 and 359
   * @return sinus(aAngle)
   */

  public float sinus(float aAngle){
    return sinustable_[(int)(aAngle*precision)];
  }
 
  /**compute the cosinus from lockup table
   * no range check
   * @param aAngle Values between 0 and 359
   * @return cosinus(aAngle)
   */

  public float cosinus(float aAngle){
    return cosinustable_[(int)(aAngle*precision)];
  }
}
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 816
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #51 - Posted 2010-11-24 22:20:47 »

Right... what about negative angles, or angles greater than a full rotation.

http://riven8192.blogspot.com/2009/08/fastmath-sincos-lookup-tables.html

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline OttoMeier
« Reply #52 - Posted 2010-11-25 03:17:33 »

Right... what about negative angles, or angles greater than a full rotation.
no range check because i do the check at other places but it could be easyly added:

1  
2  
3  
4  
5  
6  
7  
  /**correct a <0 or 359 degree overflow*/
  private float limitTo360(float angle){
    float resultangle=angle;
    if (resultangle>359) resultangle=resultangle%359;
    if (resultangle<0) resultangle=359-((-1*resultangle)%359);
    return resultangle;
  }

i dont undestand the SIN_MASK from your link. Its probably a smart trick but for now i am happy with my solution.
Offline ryanm

Senior Duke


Projects: 1
Exp: 15 years


Used to be bleb


« Reply #53 - Posted 2010-11-25 06:01:36 »

no range check because i do the check at other places but it could be easyly added:

1  
2  
3  
4  
5  
6  
7  
  /**correct a <0 or 359 degree overflow*/
  private float limitTo360(float angle){
    float resultangle=angle;
    if (resultangle>359) resultangle=resultangle%359;
    if (resultangle<0) resultangle=359-((-1*resultangle)%359);
    return resultangle;
  }

i dont undestand the SIN_MASK from your link. Its probably a smart trick but for now i am happy with my solution.

359.5 degrees is not equivalent to 0.5 degrees, you should be using 360 in your limit calculations.
Offline OttoMeier
« Reply #54 - Posted 2010-11-25 19:23:36 »

359.5 degrees is not equivalent to 0.5 degrees, you should be using 360 in your limit calculations.
a good point you are right.
Pages: 1 [2]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (39 views)
2014-10-17 03:59:02

Norakomi (30 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (28 views)
2014-10-15 16:18:58

TehJavaDev (57 views)
2014-10-14 00:39:48

TehJavaDev (58 views)
2014-10-14 00:35:47

TehJavaDev (48 views)
2014-10-14 00:32:37

BurntPizza (64 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (78 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!