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; /* w w w. j av a2 s . c om*/ import com.station42.base.Engine; import com.station42.base.EngineUpdateListener; import com.station42.base.Entity; import com.station42.basic.EntitySprite; import com.station42.faction.EntityFaction; import com.station42.hacking.Hackable; import com.station42.hacking.HackingAction; import com.station42.world.World; public class HoppingSystem implements EngineUpdateListener { @Override public void update(Engine engine, float delta) { for (Entity hackerEntity : engine.getEntitiesWithComponent(HoppingAction.class)) { HoppingAction hackingAction = hackerEntity.getComponent(HoppingAction.class); if (hackingAction != null && hackingAction.isTryingToHop()) { hackingAction.update(delta); if (hackingAction.getCompletionPercent() >= 1) { World currentWorld = hackerEntity.getComponent(World.class); hackerEntity.setComponent(World.class, currentWorld.nextWorld()); hackingAction.complete(); } } } } }