package com.Penguin; import com.util.Constant; import com.util.GameUtil; import java.awt.*; public class Face extends GameObject{ int speed=3 ; double degree; Image img; //构造器 public Face(String imgpath){ degree=Math.random()*Math.PI*2; x= Constant.GAME_WIDTH/2; y= Constant.GAME_HEIGHt/2; img= GameUtil.getImage(imgpath); width=24; height=24; } public void draw (Graphics g){ //Color c=g.getColor(); //g.setColor(Color.yellow); //g.fillOval((int)x, (int)y, 10,10); g.drawImage(img, (int)x, (int)y,null); x+=speed*Math.cos(degree); y+=speed*Math.sin(degree); if(y>Constant.GAME_HEIGHt-height||y<height+40){ degree=-degree; } if(x<0||x>Constant.GAME_WIDTH-width){ degree=Math.PI-degree; } //g.setColor(c); } }

wybdxjq LV1
2023年12月27日
dacfsdfaa LV1
2022年5月25日
ma小跳 LV5
2021年7月2日
asdffghhj LV1
2021年3月19日
happyzhu LV1
2020年12月17日
TerryGaoBo LV9
2020年8月26日
kkkxyh LV13
2020年8月23日
a105259 LV3
2020年5月9日
xueiqngquan LV1
2019年12月14日
aa123456awww LV8
2019年12月9日