Back to project page Station42.
The source code is released under:
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUC...
If you think the Android project Station42 listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.station42.hopping; //from w ww. java 2s . c o m import java.util.ArrayList; import com.badlogic.gdx.math.Rectangle; import com.station42.base.Engine; import com.station42.base.Entity; import com.station42.basic.EntityLocation; public class HoppingAction { public static final float duration = 3; private boolean wantHacking = false; private float hackingTime = 0; public void setWantHopping(boolean value) { wantHacking = value; } public boolean isTryingToHop() { return wantHacking; } public float getCompletionPercent() { // if (wantHacking) { float timeNeeded = duration; float timeSpent = hackingTime; return Math.min(timeSpent / timeNeeded, 1); // } else { // return 0; // } } public void update(float delta) { hackingTime += delta; } public float getHackingTime() { return hackingTime; } public void complete() { hackingTime = 0; } public void reset() { hackingTime = 0; } public void boost(int i) { hackingTime += i; } }