DroidQuest/src/com/droidquest/materials/CameraDisable.java

41 lines
804 B
Java
Raw Normal View History

2014-02-02 18:39:08 -03:00
package com.droidquest.materials;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import javax.swing.ImageIcon;
import com.droidquest.items.Item;
public class CameraDisable extends Material
{
public CameraDisable()
{
super(true, false);
BufferedImage bi = new BufferedImage(28,32,BufferedImage.TYPE_4BYTE_ABGR);
Graphics g;
try
{
g = bi.getGraphics();
}
catch (NullPointerException e)
{
System.out.println("Could not get Graphics pointer to " + getClass() + "Image");
return;
}
g.setColor(Color.black);
g.fillRect(0,0,28,32);
icon = new ImageIcon(bi);
}
public void TouchedByItem(Item item)
{
if (item == level.player)
if (level.currentViewer != level.player)
level.currentViewer = level.player;
}
}