Here is my final version of Assignment 1. here i kept a lot of things the same but added more actions to the UFO. This time it shoots rays at the satellite as if drawing energy from it. Space is pretty big so the planets are in place but when moving around the mouse while playing as the UFO, you can pass by the purple planet, making it turn small as you move away. in the future i would still make more edits to it, making it feel more alive.
here is my code if anyone wants to see it.
int circleX;
void setup() {
size(1000, 800);
circleX = 100;
}
//moving UFO
void draw () {
background(66, 55, 69);
//UFO Rays
if (mousePressed) {
arc(mouseX, mouseY, 184, 165, 420, 483);
}
if (mouseX > 0) {
fill(162, 0, 255);
stroke(96, 222, 147);
ellipseMode(CENTER);
ellipse(mouseX, mouseY, 100, 50);
stroke(219, 240, 99);
fill(247, 255, 0);
ellipse(mouseX, mouseY, 50, 30);
int inverseX = width-mouseY;
int inverseY = height-mouseX;
stroke(20);
fill(173, 62, 234);
ellipse(inverseY, inverseX, (inverseY/2)+10, (inverseY/2)+10);
}
fill(255);
ellipse(circleX,180,24,24);
// UFO WARNING signal
if (mouseX > 750) {
fill(255, 0, 0);
stroke(96, 222, 147);
ellipseMode(CENTER);
ellipse(mouseX, mouseY, 100, 50);
stroke(219, 240, 99);
fill(247, 255, 0);
ellipse(mouseX, mouseY, 50, 30);
}
// shooting star
circleX = circleX + 1;
//planet
fill(28, 96, 232);
strokeWeight(13);
stroke(19, 146, 214);
ellipse(879,770,600,600);
line(341, 470, 700, 520);
line(1000, 867, 340, 473);
//sun
fill(255, 245, 64);
strokeWeight(7);
stroke(852, 255, 161);
ellipse(34, 35, 155, 155);
//satellite
if (mousePressed) {
triangle(mouseX, mouseY, 50, 270, 140, 240);
triangle(mouseX, mouseY, 200, 180, 270, 140);
}
fill(255, 255, 255);
stroke(230, 223, 223);
rect(146, 184, 50, 50);
fill(0, 204, 255);
strokeWeight(5);
stroke(62, 222, 222);
triangle(95, 320, 50, 270, 140, 240);
triangle(225, 105, 200, 180, 270, 140);
//ufo
fill(162, 0, 255);
ellipse(700, 400, 98, 31);
fill(247, 255, 0);
stroke(219, 240, 99);
ellipse(700, 385, 56, 24);
//black hole
fill(10);
ellipse(990, 170, 100, 100);
// yellow stars
fill(253, 255, 206);
ellipse(200, 700, 5, 5);
ellipse(100, 500, 5, 5);
ellipse(300, 300, 5, 5);
ellipse(600, 100, 5, 5);
ellipse(800, 300, 5, 5);
ellipse(470, 350, 5, 5);
ellipse(300, 100, 5, 5);
ellipse(500, 750, 5, 5);
ellipse(350, 600, 5, 5);
ellipse(900, 320, 2, 2);
//blue stars
stroke(151, 250, 241);
ellipse(670, 300, 5, 5);
ellipse(50, 700, 5, 5);
ellipse(270, 530, 5, 5);
ellipse(450, 270, 2, 2);
ellipse(270, 400, 2, 2);
ellipse(460, 160, 2, 2);
ellipse(410, 95, 5,5);
ellipse(25, 425, 5, 5);
//white stars
stroke(245, 245, 245);
ellipse(320, 700, 2, 2);
ellipse(220, 600, 2, 2);
ellipse(710, 50, 2, 2);
ellipse(520, 50, 5, 5);
ellipse(235, 765, 5, 5);
ellipse(127, 635, 5, 5);
ellipse(460, 675, 5, 5);
ellipse(150, 456, 2, 2);
ellipse(20, 150, 4, 4);
//planet 2
fill(0, 255, 0);
stroke(69, 234, 219);
strokeWeight(5);
ellipse(300, 300, 50, 50);
//planet 3
stroke(216, 216, 63);
}