Back to project page killingspree.
The source code is released under:
MIT License
If you think the Android project killingspree 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.sillygames.killingSpree.clientEntities; /*from ww w. j a va 2 s .c o m*/ import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.math.MathUtils; import com.sillygames.killingSpree.managers.WorldRenderer; import com.sillygames.killingSpree.pool.AssetLoader; import com.sillygames.killingSpree.serverEntities.ServerArrow; public class ClientArrow extends ClientEntity { private Sprite sprite; boolean markForDispose; public ClientArrow(short id, float x, float y, WorldRenderer renderer) { super(id, x, y, renderer); markForDispose = false; sprite = new Sprite(AssetLoader.instance.getTexture("sprites/arrow.png")); sprite.setSize(ServerArrow.RADIUS * 10 , ServerArrow.RADIUS * 2.5f); sprite.setOrigin(sprite.getWidth() / 2, sprite.getHeight() / 2); sprite.setPosition(x - sprite.getWidth() / 2, y - sprite.getHeight() / 2); } @Override public void render(float delta, SpriteBatch batch) { sprite.setRotation(angle * MathUtils.radiansToDegrees); float x = position.x - sprite.getWidth() / 2; float y = position.y - sprite.getHeight() / 2; drawAll(sprite, batch, x, y); } @Override public void dispose() { } }