Back to project page Ready-Set-Rogue.
The source code is released under:
GNU General Public License
If you think the Android project Ready-Set-Rogue 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.warsheep.scamp.processors; // ww w . j av a2 s . com import com.warsheep.scamp.components.CameraComponent; import com.warsheep.scamp.components.ECSMapper; import com.warsheep.scamp.components.TransformComponent; import com.badlogic.ashley.core.Entity; import com.badlogic.ashley.core.Family; import com.badlogic.ashley.systems.IteratingSystem; public class CameraProcessor extends IteratingSystem { public CameraProcessor() { super(Family.all(CameraComponent.class).get()); } @Override public void processEntity(Entity entity, float deltaTime) { CameraComponent cam = ECSMapper.camera.get(entity); if (cam.target == null) { return; } TransformComponent target = ECSMapper.transform.get(cam.target); if (target == null) { return; } cam.camera.position.y = target.position.y + 12; cam.camera.position.x = target.position.x + 12; } }