📄 flowers.java
字号:
import javax.microedition.lcdui.game.Sprite;
public class Flowers extends Sprite {
public int countkai, countkaishichiren;
public boolean is_huakai, is_chiren, keyi_chiren;
public Flowers() {
super(ImageAll.img_chirenkai, 16, 16);
countkai = 0;
countkaishichiren = 0;
is_huakai = false;
is_chiren = false;
keyi_chiren = false;
}
public void kaiHuaZhenTing(Sprite r)
{
if(((r.getX() + 16 >= this.getX()
&& r.getX() <= this.getX() +16
&& (r.getY() == this.getY() - 16 || r.getY() == this.getY() + 16))
|| (r.getY() + 16 >= this.getY()
&& r.getY() <= this.getY() +16
&& (r.getX() == this.getX() - 16 || r.getX() == this.getX()+16)))
&& is_huakai == false)
is_huakai = true;
}
public void chiRenZhenTing(Sprite r)
{
if(((r.getX() + 16 >= this.getX()
&& r.getX() <= this.getX() +16
&& (r.getY() == this.getY() - 16 || r.getY() == this.getY() + 16))
|| (r.getY() + 16 >= this.getY()
&& r.getY() <= this.getY() +16
&& (r.getX() == this.getX() - 16 || r.getX() == this.getX()+16)))
&& is_chiren == false && keyi_chiren == true){
is_chiren = true;
this.setImage(ImageAll.img_chiren, 16, 16);
}
}
public void kaiHua()
{
if(is_huakai == true && countkai < 3)
{
countkai++;
this.nextFrame();
}
if(is_huakai == true && countkaishichiren < 22)
{
countkaishichiren++;
if(countkaishichiren >= 15)
keyi_chiren = true;
}
}
public void chiRen()
{
if(is_chiren == true && countkai < 5)
{
countkai++;
this.nextFrame();
}
}
public boolean getIsChiRen()
{
return is_chiren;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -