src/item.js
/*
 * Class for items we can pick up.
 */
Class for items we can pick up.
Class for items we can pick up .
function Item(game, args, type) {
	var position = args.position;
	var body = new p2.Body({
		position: args.position,
		mass: this.mass,
		fixedRotation: true,
	});
	var shape = new p2.Circle({
		radius: ItemSize,
		sensor: true,
	});
	shape.collisionGroup = physics.Mask.Item;
	shape.collisionMask = physics.Mask.Player;
	body.addShape(shape);
	this.body = body;
	this.bobShift = Math.random() * (Math.PI * 2);
	this.type = type;
}
function Item ( game , args , type ) { var position = args . position ; var body = new p2 . Body ( { position : args . position , mass : this . mass , fixedRotation : true , } ) ; var shape = new p2 . Circle ( { radius : ItemSize , sensor : true , } ) ; shape . collisionGroup = physics . Mask . Item ; shape . collisionMask = physics . Mask . Player ; body . addShape ( shape ) ; this . body = body ; this . bobShift = Math . random ( ) * ( Math . PI * 2 ) ; this . type = type ; }
Class for items we can pick up.
Class for items we can pick up .