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; /* w w w .j av a2s . c om*/ 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 ClientBullet extends ClientEntity { private Sprite sprite; boolean markForDispose; public ClientBullet(short id, float x, float y, WorldRenderer renderer) { super(id, x, y, renderer); markForDispose = false; sprite = new Sprite(AssetLoader.instance.getTexture("sprites/bullet.png")); sprite.setSize(ServerArrow.RADIUS * 4 , ServerArrow.RADIUS * 1.5f); sprite.setOrigin(sprite.getWidth() / 2, sprite.getHeight() / 2); sprite.setPosition(x - sprite.getWidth() / 2, y - sprite.getHeight() / 2); renderer.audioPlayer.shoot(); } @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() { } }