-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="JAVA_MODULE" version="4"> | ||
<component name="NewModuleRootManager" inherit-compiler-output="true"> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/res" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> | ||
<excludeFolder url="file://$MODULE_DIR$/.idea" /> | ||
<excludeFolder url="file://$MODULE_DIR$/.settings" /> | ||
</content> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="library" name="LWJGL2 - org.lwjgl.lwjgl:lwjgl:2.9.3" level="application" /> | ||
<orderEntry type="library" name="Guava - com.google.guava:guava:21.0" level="application" /> | ||
<orderEntry type="library" name="Slick Util" level="application" /> | ||
<orderEntry type="library" name="native" level="project" /> | ||
<orderEntry type="library" name="jinput-2.0.5" level="project" /> | ||
<orderEntry type="library" name="PNGDecoder" level="project" /> | ||
</component> | ||
</module> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Manifest-Version: 1.0 | ||
Main-Class: colors.Starter | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package colors; | ||
|
||
import colors.util.Texture; | ||
|
||
import java.io.IOException; | ||
|
||
import static org.lwjgl.opengl.GL11.*; | ||
|
||
public class Init { | ||
|
||
public static int splashId = -1; | ||
public static Texture leakTex; | ||
public static int throwId = -1; | ||
public static int thrownId = -1; | ||
|
||
public static void init() throws Exception { | ||
splashId = makeTexture("Splash.png"); | ||
throwId = makeTexture("Throw.png"); | ||
thrownId = makeTexture("Thrown.png"); | ||
leakTex = Texture.setupTexture("Leak.png", false); | ||
} | ||
|
||
public static void release() { | ||
if (splashId != -1) | ||
glDeleteTextures(splashId); | ||
} | ||
|
||
public static int makeTexture(String tex) throws IOException { | ||
Texture splashTex = Texture.setupTexture(tex, false); | ||
int Id = glGenTextures(); | ||
glBindTexture(GL_TEXTURE_2D, Id); | ||
splashTex.setupParameter(); | ||
splashTex.upload(); | ||
return Id; | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package colors; | ||
|
||
import colors.util.Vector2d; | ||
|
||
import static org.lwjgl.input.Keyboard.*; | ||
|
||
public enum Movement { | ||
|
||
LEFT(KEY_LEFT, new Vector2d(-1, 0)), | ||
A(KEY_A, new Vector2d(-1, 0)), | ||
RIGHT(KEY_RIGHT, new Vector2d(1, 0)), | ||
D(KEY_D, new Vector2d(1, 0)); | ||
|
||
public final int key; | ||
public final Vector2d offset; | ||
|
||
Movement(int key, Vector2d offset) { | ||
this.key = key; | ||
this.offset = offset; | ||
} | ||
|
||
} |