Bug fixes and add wall
This commit is contained in:
parent
5c31a47553
commit
e4992123a8
9 changed files with 44 additions and 35 deletions
|
@ -4,6 +4,10 @@
|
|||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="res"/>
|
||||
<classpathentry kind="src" path="libs"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/lwjgl"/>
|
||||
<classpathentry kind="lib" path="libs/lwjgl.jar">
|
||||
<attributes>
|
||||
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="Global-Gam-Jam-2017/libs"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="out/production/Global-Gam-Jam-2017"/>
|
||||
</classpath>
|
||||
|
|
2
.settings/org.eclipse.ltk.core.refactoring.prefs
Normal file
2
.settings/org.eclipse.ltk.core.refactoring.prefs
Normal file
|
@ -0,0 +1,2 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
|
1
out/production/.gitignore
vendored
Normal file
1
out/production/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/Global-Gam-Jam-2017/
|
|
@ -71,7 +71,7 @@ public class Main {
|
|||
|
||||
//initialisation
|
||||
//------------------------------------------------------------------------------------
|
||||
glEnable(GL_MULTISAMPLE);//Activation du MSAA
|
||||
//glEnable(GL_MULTISAMPLE);//Activation du MSAA
|
||||
Input.init();
|
||||
game = new MainGame();
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ import globalgamejam.gui.GUILabel;
|
|||
import globalgamejam.render.Camera;
|
||||
import globalgamejam.tiles.Fond;
|
||||
import globalgamejam.tiles.Objet;
|
||||
import globalgamejam.tiles.TestTile;
|
||||
import globalgamejam.tiles.Tile;
|
||||
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@ public class DisplayManager {
|
|||
projection.loadIdentity();
|
||||
// projection.Ortho2D(-Main.WIDTH/2.0f, Main.WIDTH/2.0f, -Main.HEIGHT/2.0f, Main.HEIGHT/2.0f, -1, 1);
|
||||
projection.Ortho2D(0, Main.WIDTH, 0, Main.HEIGHT, -1, 1);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthFunc(GL_LESS);
|
||||
//glEnable(GL_DEPTH_TEST);
|
||||
//glDepthFunc(GL_LESS);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
|
@ -30,8 +30,8 @@ public class DisplayManager {
|
|||
projection.loadIdentity();
|
||||
//Permet de centrer la camera au centre de l'ecran
|
||||
projection.Ortho2D(0, Main.WIDTH, Main.HEIGHT, 0, -1, 1);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthFunc(GL_LESS);
|
||||
//glEnable(GL_DEPTH_TEST);
|
||||
//glDepthFunc(GL_LESS);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
|
|
16
src/globalgamejam/tiles/Mur.java
Normal file
16
src/globalgamejam/tiles/Mur.java
Normal file
|
@ -0,0 +1,16 @@
|
|||
package globalgamejam.tiles;
|
||||
|
||||
import globalgamejam.math.Color4f;
|
||||
import globalgamejam.math.Vector2f;
|
||||
|
||||
public class Mur extends Tile{
|
||||
|
||||
public Mur(int x,int y,int scaleX,int scaleY){
|
||||
super();
|
||||
super.setColor(Color4f.BLACK);
|
||||
super.setPosition(new Vector2f(x, y));
|
||||
super.setScale(new Vector2f(scaleX, scaleY));
|
||||
super.applyTransform();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
package globalgamejam.tiles;
|
||||
|
||||
|
||||
import globalgamejam.math.Color4f;
|
||||
|
||||
/**
|
||||
* Created by MrDev023 on 14/01/2017.
|
||||
*/
|
||||
public class TestTile extends Tile {
|
||||
|
||||
public TestTile(){
|
||||
super();
|
||||
super.setColor(Color4f.RED);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,23 +1,18 @@
|
|||
package globalgamejam.world;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import globalgamejam.Main;
|
||||
import globalgamejam.game.MainGame;
|
||||
import globalgamejam.game.Player;
|
||||
import globalgamejam.gui.ActionGUI;
|
||||
import globalgamejam.gui.GUI;
|
||||
import globalgamejam.gui.GUILabel;
|
||||
import globalgamejam.input.Input;
|
||||
import globalgamejam.tiles.Fond;
|
||||
import globalgamejam.tiles.Mur;
|
||||
import globalgamejam.tiles.Objet;
|
||||
import globalgamejam.tiles.TestTile;
|
||||
import globalgamejam.tiles.Tile;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
/**
|
||||
* Created by trexr on 20/01/2017.
|
||||
*/
|
||||
|
@ -28,6 +23,7 @@ public class MainWorld {
|
|||
private MainGame game;
|
||||
|
||||
private Player player1,player2;
|
||||
private Mur mur1,mur2,mur3;
|
||||
|
||||
public MainWorld(MainGame game){
|
||||
this.game = game;
|
||||
|
@ -43,10 +39,17 @@ public class MainWorld {
|
|||
Fond fond = new Fond("res/textures/fond.png");
|
||||
fond.getTransform().translate(Main.WIDTH/2, Main.HEIGHT/2, 0);
|
||||
fond.getTransform().scale(Main.WIDTH,Main.HEIGHT, 0);
|
||||
|
||||
this.mur1 = new Mur(Main.WIDTH/2-10, Main.HEIGHT - 50, 20, 150);
|
||||
this.mur2 = new Mur(Main.WIDTH/2-10, Main.HEIGHT - 250, 20, 50);
|
||||
this.mur3 = new Mur(Main.WIDTH/2-10, Main.HEIGHT - 400, 20, 150);
|
||||
|
||||
tiles.add(fond);
|
||||
tiles.add(player1.getTile());
|
||||
tiles.add(player2.getTile());
|
||||
tiles.add(this.mur1);
|
||||
tiles.add(this.mur2);
|
||||
tiles.add(this.mur3);
|
||||
|
||||
generateEntity(3);
|
||||
}
|
||||
|
@ -114,11 +117,11 @@ public class MainWorld {
|
|||
}
|
||||
|
||||
public void render(){
|
||||
for(int i = tiles.size() - 1;i >= 0 ;i--)
|
||||
tiles.get(i).render();
|
||||
for(Tile t : tiles)t.render();
|
||||
}
|
||||
|
||||
public void destroy(){
|
||||
for(Tile t : tiles)t.destroy();
|
||||
tiles.clear();
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue