This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void collisionObjectSetter(int i, ArrayList<Object> rain) { | |
// spaceship checks are below | |
if (collisionCheck(rain.get(i + 1),rain.get(i),GameRun.myX, GameRun.myY + 18)) | |
{ | |
GameRun.player1 = false; | |
} else if (collisionCheck(rain.get(i + 1), rain.get(i), GameRun.myX + 17, GameRun.myY)) | |
{ | |
GameRun.player1 = false; | |
} else if (collisionCheck(rain.get(i + 1), rain.get(i), GameRun.myX + 32, GameRun.myY + 18)) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void draw(Graphics g) throws InterruptedException { | |
if (rain.size() < 60) { | |
rain.add(yy); | |
yy -= 20; | |
rain.add(rnd.nextInt(490)); | |
rain.add(Toolkit.getDefaultToolkit().getImage("rock.png")); | |
} | |
for (int i = 0; i < rain.size(); i += 3) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Color; | |
import java.awt.Graphics; | |
import java.awt.Image; | |
import java.awt.image.BufferedImage; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Random; | |
import javax.imageio.ImageIO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Color; | |
import java.awt.Graphics; | |
import java.awt.Image; | |
import java.awt.image.BufferedImage; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Random; | |
import javax.imageio.ImageIO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Color; | |
import java.awt.Graphics; | |
import java.awt.Image; | |
import java.awt.image.BufferedImage; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Random; | |
import javax.imageio.ImageIO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Color; | |
import java.awt.Graphics; | |
import java.awt.Image; | |
import java.awt.image.BufferedImage; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.Random; | |
import javax.imageio.ImageIO; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Graphics; | |
public abstract class GameObjects { | |
private int xPos, yPos, width, height; | |
abstract void draw(Graphics g); | |
abstract void update(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Color; | |
import java.awt.Graphics; | |
import java.util.ArrayList; | |
import java.util.Random; | |
public class Rain extends GameObjects { | |
private int yPos; // xPos, width, height; <- useless | |
Random rnd = new Random(); | |
ArrayList<Object> rain = new ArrayList<Object>(); // rain(y, x, y, x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Color; | |
import java.awt.Graphics; | |
import javax.swing.JFrame; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class _02_SequencesOfEqualStrings | |
{ | |
public static void main(String[] args) | |
{ | |
Scanner scan = new Scanner(System.in); | |
String[] input = scan.nextLine().split(" "); | |
String lastWord = input[0]; |