Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package
- {
- import net.flashpunk.Entity;
- import net.flashpunk.FP;
- import net.flashpunk.graphics.Image;
- public class Bullet extends Entity
- {
- [Embed(source='assets/bullet.png')]
- private const BULLET:Class;
- public function Bullet()
- {
- graphic = new Image(BULLET);
- setHitbox(10, 10);
- type = "bullet";
- x = (Math.random() * 800);
- }
- public var speed:Number = 5;
- override public function update():void
- {
- y += 5;
- }
- public function destroy():void
- {
- FP.world.remove(this);
- }
- }
- }
Add Comment
Please, Sign In to add comment