After taking what I learned from Wavy lines in java thread and from trial and error i attempted to make a star go up and down but I am doing it with sin so it looks a little smoother; but anyway I am using this code:
// loop is going too fast so motion is not visible(is that really why?)... not sure what to do
private static float starY = 0;
public static void star(SpriteBatch batch) {
batch.draw(Assets.star, 200, starY + 200);
for (float x = 0; x < 361; x ++) {
starY = MathUtils.sin(x) * 50;
System.out.println(starY);
}
}
Now what I think the problem is, is that the foor loop is going to fast (does that even make sense) because I see no movement in the star that I am drawing. I printed out the values of the starY and they seem pretty scattered so I would believe this loop is going maybe too fast to work correctly. Also I multiplied sin(x) by 50 but I am not sure that is the correct way to do this… If you think the problem is just my lack of trig knowledge then I will go learn some more but if not is there any other option?