made it like...work .
parent
efe8f6eb52
commit
b75e2b3839
|
|
@ -9,9 +9,16 @@ import java.util.Random;
|
|||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
/**
|
||||
* simple little play toy to generate star like backgrounds. planned background
|
||||
* for spacewars.
|
||||
*
|
||||
* @author mgosselin
|
||||
*
|
||||
*/
|
||||
public class Main {
|
||||
private static Variable nameVar = new Variable("", "name", "0", false);
|
||||
private static int stars = 10;
|
||||
private static int stars = 100;
|
||||
private static BufferedImage buffer;
|
||||
private static Graphics2D graphics;
|
||||
|
||||
|
|
@ -19,7 +26,7 @@ public class Main {
|
|||
try {
|
||||
//while (true) {
|
||||
String name = "" + Integer.parseInt(nameVar.getValue());
|
||||
//nameVar.setValue("" + (Integer.parseInt(nameVar.getValue()) + 1));
|
||||
nameVar.setValue("" + (Integer.parseInt(nameVar.getValue()) + 1));
|
||||
|
||||
Random rand = new Random();
|
||||
buffer = new BufferedImage(1024, 600, 3);
|
||||
|
|
@ -33,7 +40,7 @@ public class Main {
|
|||
for (int y = 0; y < HEIGHT; y++) {
|
||||
for (int x = 0; x < WIDTH; x++) {
|
||||
|
||||
int k = rand.nextInt(10);
|
||||
int k = rand.nextInt(20);
|
||||
int r = 0 + k;
|
||||
int g = 0 + k;
|
||||
int b = 0 + k;
|
||||
|
|
@ -47,7 +54,7 @@ public class Main {
|
|||
|
||||
int size = MIN_STAR_SIZE + (int)(Math.random() * (MAX_STAR_SIZE - MIN_STAR_SIZE));
|
||||
|
||||
int r = (int)(Math.random() * 50);
|
||||
int r = (int)(Math.random() * 100);
|
||||
int g = (int)(Math.random() * 50);
|
||||
int b = (int)(Math.random() * 50);
|
||||
|
||||
|
|
|
|||
|
|
@ -6,10 +6,8 @@ import java.util.Formatter;
|
|||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
* to note, will not work on Mac yet.
|
||||
* edit: WILL WORK ON MAC MOTHER FUCKERS
|
||||
*
|
||||
*
|
||||
* helpful little class that creates a string variable that gets saved in application
|
||||
* data. when you write to it, it gets saved as that file.
|
||||
* @author Marcus
|
||||
*
|
||||
*/
|
||||
|
|
@ -64,9 +62,8 @@ public class Variable {
|
|||
String str = getValueFromFile();
|
||||
|
||||
// if we could not load a value from the file
|
||||
// AKA didnt fucking exist.
|
||||
// ORRRRRRR if you were an ass, and forced
|
||||
// the value.
|
||||
// AKA didnt exist.
|
||||
// ORRRRRRR if you forced the value.
|
||||
if (str == null) {
|
||||
this.value = value;
|
||||
saveValue();
|
||||
|
|
@ -96,9 +93,6 @@ public class Variable {
|
|||
f.format("" + value);
|
||||
f.close();
|
||||
} catch (Exception e) {
|
||||
// if(weArriveHere){
|
||||
// we.are("fucked");
|
||||
// }
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
|
@ -115,9 +109,6 @@ public class Variable {
|
|||
try {
|
||||
f.createNewFile();
|
||||
} catch (IOException e) {
|
||||
// if(weArriveHere){
|
||||
// we.are("fucked");
|
||||
// }
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue