Workers & Resources: Soviet Republic

Workers & Resources: Soviet Republic

Not enough ratings
мерс
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
8.811 KB
7 Dec, 2019 @ 10:03pm
1 Change Note ( view )

Subscribe to download
мерс

Description
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 Comments
qv0ck 3 May, 2020 @ 2:21am 
He say a Mersedes and he got photo adidas
White Rabbit 21 Apr, 2020 @ 7:59am 
who is erik meleg
szuzol 10 Apr, 2020 @ 4:13am 
-rep erik meleg
лесенька 12 Dec, 2019 @ 9:31am 
Нет картинок, нет установок
John Personage 9 Dec, 2019 @ 1:38am 
What is this? A clothing factory? Some explanation would be helpful thanks.
jon157uk 8 Dec, 2019 @ 7:28pm 
?
Mila_112 8 Dec, 2019 @ 12:16am 
This is mod or what ?