Merge branch 'master' into retina-display
commit
2e99668ebc
|
|
@ -7,8 +7,10 @@ import java.util.ArrayList;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* also a bit of an app helper class thing
|
* this class is a jack of all trades when it comes to information about apps.
|
||||||
* well... i renamed it so, now it just is an app helper class thing.
|
* it can tell you things about apps and as well, initialize a list of them
|
||||||
|
* so that you can later use them in your main menu app!
|
||||||
|
*
|
||||||
* @author Marcus
|
* @author Marcus
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener,
|
||||||
/**
|
/**
|
||||||
* debug level.
|
* debug level.
|
||||||
*/
|
*/
|
||||||
public static int debug = 0;
|
public static int debug = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* because retina support
|
* because retina support
|
||||||
|
|
@ -468,4 +468,4 @@ public class Engine extends Canvas implements KeyListener, MouseMotionListener,
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
package MAndEngine;
|
||||||
|
|
||||||
|
public class Utils {
|
||||||
|
public static int rand(int low, int high) {
|
||||||
|
return (int)(Math.random() * (high - low + 1) + low);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -7,11 +7,9 @@ import java.util.Formatter;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* to note, will not work on Mac yet.
|
* 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. and yes it only works on
|
||||||
* edit: WILL WORK ON MAC MOTHER FUCKERS
|
* windows because i used backslashes and not the respective seperative character.
|
||||||
*
|
|
||||||
* edit: idek if this will work on macs because app data...
|
|
||||||
*
|
*
|
||||||
* @author Marcus
|
* @author Marcus
|
||||||
*
|
*
|
||||||
|
|
@ -62,8 +60,8 @@ public class Variable {
|
||||||
String str = getValueFromFile();
|
String str = getValueFromFile();
|
||||||
|
|
||||||
// if we could not load a value from the file
|
// if we could not load a value from the file
|
||||||
// AKA didnt fucking exist.
|
// AKA didnt exist.
|
||||||
// ORRRRRRR if you were an ass, and forced
|
// ORRRRRRR if you forced
|
||||||
// the value.
|
// the value.
|
||||||
if (str == null) {
|
if (str == null) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
|
|
@ -113,9 +111,6 @@ public class Variable {
|
||||||
f.format("" + value);
|
f.format("" + value);
|
||||||
f.close();
|
f.close();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// if(weArriveHere){
|
|
||||||
// we.are("fucked");
|
|
||||||
// }
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -134,19 +129,15 @@ public class Variable {
|
||||||
private void createFile() {
|
private void createFile() {
|
||||||
//make the directory because god knows, java can't do that for us
|
//make the directory because god knows, java can't do that for us
|
||||||
//when we say we want a new file in an unknown folder noooooo....
|
//when we say we want a new file in an unknown folder noooooo....
|
||||||
//jackass java
|
File file = new File(fileDir);
|
||||||
File f = new File(fileDir);
|
file.mkdirs();
|
||||||
f.mkdirs();
|
|
||||||
|
|
||||||
//no onto the file itself. create the object
|
//no onto the file itself. create the object
|
||||||
f = new File(filePath);
|
file = new File(filePath);
|
||||||
try {
|
try {
|
||||||
//hopefully make the file...
|
//hopefully make the file...
|
||||||
f.createNewFile();
|
file.createNewFile();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// if(weArriveHere){
|
|
||||||
// we.are("fucked");
|
|
||||||
// }
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue