工人與資源:蘇維埃共和國 Workers & Resources: Soviet Republic

工人與資源:蘇維埃共和國 Workers & Resources: Soviet Republic

評價次數不足
мерс
   
獎勵
加入最愛
已加入最愛
移除最愛
檔案大小
發佈於
8.811 KB
2019 年 12 月 7 日 下午 10:03
1 項更新註記 (檢視)

訂閱以下載
мерс

描述
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.KeyEvent;

public class Sprite {

private double x = 100, y = 200;
private int radius = 50;
private boolean visible = true;
private Color color;
private double red = 0;
private double speed = 0.1;
private double speed1 = 0.1;
private double speedX = speed, speedY = -speed;

public Sprite (int x, int y) {
this.x = x;
this.y = y;
color = new Color(0, 0, 0);
}

public void up () {
speedY = -speed;
}
public void down () {
speedY = speed;
}

public void right() {
speedX = speed;
}

public void left() {
speedX = -speed;
}

public void hide () {
visible = false;

}

public void show () {
visible = true;
}

public void update () {
x = x + speedX;
y = y + speedY;
//red = red + 0.01;

if (red > 255) {
speed1=-speed;
//hide();
}
else if (red <0 ) {
speed1=speed;
}

red = red + speed1;

if (x > 500) {
// �������� ����������� ��������
left ();
}
if (y > 500) {
up();
}
if (x < 0) {
right();
}
if (y < 0) {
down();
}



color = new Color ((int)red, 0, 0);

}

public void paint (Graphics g) {
if (visible) {
g.setColor( color );
g.fillOval((int)x, (int)y, radius * 2, radius * 2);
}
}

}
7 則留言
qv0ck 2020 年 5 月 3 日 上午 2:21 
He say a Mersedes and he got photo adidas
White Rabbit 2020 年 4 月 21 日 上午 7:59 
who is erik meleg
szuzol 2020 年 4 月 10 日 上午 4:13 
-rep erik meleg
лесенька 2019 年 12 月 12 日 上午 9:31 
Нет картинок, нет установок
John Personage 2019 年 12 月 9 日 上午 1:38 
What is this? A clothing factory? Some explanation would be helpful thanks.
jon157uk 2019 年 12 月 8 日 下午 7:28 
?
Mila_112 2019 年 12 月 8 日 上午 12:16 
This is mod or what ?