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.death; //from www . j a va2 s . c om import com.station42.base.Engine; import com.station42.base.EngineMessageListener; import com.station42.base.Engine.Message; public class BulletDamageSystem implements EngineMessageListener { @Override public void receiveMessage(Engine engine, Message message) { if (message instanceof BulletDamageMessage) { BulletDamageMessage bulletDamage = (BulletDamageMessage) message; Health targetHealth = bulletDamage.target.getComponent(Health.class); if (targetHealth != null) { if (targetHealth.damage(engine, 1)) { engine.handleMessage(new DeathMessage(bulletDamage.shooter, bulletDamage.target)); } } } } }