Created
December 10, 2012 18:23
-
-
Save erlend-sh/4252302 to your computer and use it in GitHub Desktop.
jMonkeyEngine: Beginner Test 4 Pulsing Solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean scale = true ; | |
float timePassed = 0.0f; | |
/* This is the update loop */ | |
@Override | |
public void simpleUpdate(float tpf) | |
{ | |
timePassed+= tpf; | |
if (timePassed >= 0.3 ){timePassed=0; scale=(!scale); } //change decrease/increase every 0.3 sec. | |
float inc = 1+(0.50f * tpf);//50% increase/decrease per 0.3 sec. | |
if (scale) player.scale(inc); | |
else player.scale(1/inc); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment