Space invaders help
in
Programming Questions
•
8 months ago
- int x=mouseX;
- int y=560;
- int z=540;
- void setup(){
- size(600,600);
- background(100,0,200);
- // img = loadImage("spaceship.png");
- }
- void draw(){
- spaceship();
- laser();
- }
- void spaceship(){
- fill(255,0,0);
- background(100,0,200);
- //img = loadImage("spaceship.png");
- triangle(mouseX-18,580,mouseX+18, 580, mouseX,560);
- laser();
- }
- void laser(){
- strokeWeight(5);
- stroke(255,0,0);
- if(mousePressed == true){
- line(mouseX, z, mouseX , y);
- }
- y--;
- z--;
- }
1