package com.ezardlabs.lostsector.objects.pickups;

import com.ezardlabs.dethsquare.Collider.Collision;
import com.ezardlabs.dethsquare.Component;
import com.ezardlabs.dethsquare.Rigidbody;
import com.ezardlabs.dethsquare.TextureAtlas;
import com.ezardlabs.dethsquare.animation.Animations;
import com.ezardlabs.dethsquare.animation.Animations.Validator;

abstract class Pickup extends Component {

	@Override
	public void start() {
		TextureAtlas ta = TextureAtlas.load(getAtlasPath());
		gameObject.renderer.setTextureAtlas(ta, 100, 100);
		gameObject.animator.setAnimations(Animations.load(getAnimationPath(), ta, new Validator("animate")));
		gameObject.animator.play("animate");
	}

	protected abstract String getAtlasPath();

	protected abstract String getAnimationPath();

	@Override
	public void onCollision(Collision collision) {
		if ("solid".equals(collision.gameObject.getTag())) {
			gameObject.removeComponent(Rigidbody.class);
			gameObject.collider.setIsTrigger(true);
		}
	}
}

@@ -139,16 +139,56 @@
 ponent;%0A
+import com.ezardlabs.dethsquare.Layers;%0A
 import c
@@ -222,16 +222,16 @@
 idbody;%0A
-
 import c
@@ -572,16 +572,51 @@
 , 100);%0A
+%09%09gameObject.renderer.setDepth(4);%0A
 %09%09gameOb
@@ -914,23 +914,8 @@
 %09if 
-(%22solid%22.equals
 (col
@@ -939,13 +939,42 @@
 .get
-Tag()
+Layer() == Layers.getLayer(%22Solid%22
 )) %7B

Update to work with layers instead of tags