首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > Java > Applet动画枪

Applet动画枪

  • 资源大小:850.00 B
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: 动画 applet

资 源 简 介

import java.awt.**; import java.applet.**; public class Guns extends Applet { int mouseX,mouseY,clicks; boolean mouseIn; public boolean mouseDown(Event evt,int x,int y) { clicks=clicks+1; mouseX=x; mouseY=y; repaint (); return true; } public boolean mouseEnter(Event evt,int x,int y) { mouseIn=true; repaint(); return true; } public boolean mouseExit(Event evt,int x,int y) { mouseIn=false; repaint(); return true; } Image pic1,pic2; public void init() { pic1=getImage(getCodeBase(),"gun.jpg"); pic2=getImage(getCodeBase(),"peluru.jpg"); } public void paint (Graphics g) { g.drawImage(pic1,10,20,this); g.drawImage(pic2,30+clicks*50,40,this); //g.drawImage(pic2,20,70,this); //g.drawImage(pic3,140,130,this);<
VIP VIP
0.199800s