1
0
Fork 0

Bug fixes and add wall

This commit is contained in:
MrDev023 2017-01-21 04:57:05 +01:00
parent 5c31a47553
commit e4992123a8
9 changed files with 44 additions and 35 deletions

View file

@ -4,6 +4,10 @@
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="res"/> <classpathentry kind="src" path="res"/>
<classpathentry kind="src" path="libs"/> <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"/> <classpathentry kind="output" path="out/production/Global-Gam-Jam-2017"/>
</classpath> </classpath>

View 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
View file

@ -0,0 +1 @@
/Global-Gam-Jam-2017/

View file

@ -71,7 +71,7 @@ public class Main {
//initialisation //initialisation
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
glEnable(GL_MULTISAMPLE);//Activation du MSAA //glEnable(GL_MULTISAMPLE);//Activation du MSAA
Input.init(); Input.init();
game = new MainGame(); game = new MainGame();

View file

@ -15,7 +15,6 @@ import globalgamejam.gui.GUILabel;
import globalgamejam.render.Camera; import globalgamejam.render.Camera;
import globalgamejam.tiles.Fond; import globalgamejam.tiles.Fond;
import globalgamejam.tiles.Objet; import globalgamejam.tiles.Objet;
import globalgamejam.tiles.TestTile;
import globalgamejam.tiles.Tile; import globalgamejam.tiles.Tile;

View file

@ -20,8 +20,8 @@ public class DisplayManager {
projection.loadIdentity(); projection.loadIdentity();
// projection.Ortho2D(-Main.WIDTH/2.0f, Main.WIDTH/2.0f, -Main.HEIGHT/2.0f, Main.HEIGHT/2.0f, -1, 1); // 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); projection.Ortho2D(0, Main.WIDTH, 0, Main.HEIGHT, -1, 1);
glEnable(GL_DEPTH_TEST); //glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS); //glDepthFunc(GL_LESS);
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
} }
@ -30,8 +30,8 @@ public class DisplayManager {
projection.loadIdentity(); projection.loadIdentity();
//Permet de centrer la camera au centre de l'ecran //Permet de centrer la camera au centre de l'ecran
projection.Ortho2D(0, Main.WIDTH, Main.HEIGHT, 0, -1, 1); projection.Ortho2D(0, Main.WIDTH, Main.HEIGHT, 0, -1, 1);
glEnable(GL_DEPTH_TEST); //glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS); //glDepthFunc(GL_LESS);
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
} }

View 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();
}
}

View file

@ -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);
}
}

View file

@ -1,23 +1,18 @@
package globalgamejam.world; package globalgamejam.world;
import java.util.ArrayList;
import org.lwjgl.glfw.GLFW;
import globalgamejam.Main; import globalgamejam.Main;
import globalgamejam.game.MainGame; import globalgamejam.game.MainGame;
import globalgamejam.game.Player; import globalgamejam.game.Player;
import globalgamejam.gui.ActionGUI;
import globalgamejam.gui.GUI;
import globalgamejam.gui.GUILabel;
import globalgamejam.input.Input; import globalgamejam.input.Input;
import globalgamejam.tiles.Fond; import globalgamejam.tiles.Fond;
import globalgamejam.tiles.Mur;
import globalgamejam.tiles.Objet; import globalgamejam.tiles.Objet;
import globalgamejam.tiles.TestTile;
import globalgamejam.tiles.Tile; 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. * Created by trexr on 20/01/2017.
*/ */
@ -28,6 +23,7 @@ public class MainWorld {
private MainGame game; private MainGame game;
private Player player1,player2; private Player player1,player2;
private Mur mur1,mur2,mur3;
public MainWorld(MainGame game){ public MainWorld(MainGame game){
this.game = game; this.game = game;
@ -44,9 +40,16 @@ public class MainWorld {
fond.getTransform().translate(Main.WIDTH/2, Main.HEIGHT/2, 0); fond.getTransform().translate(Main.WIDTH/2, Main.HEIGHT/2, 0);
fond.getTransform().scale(Main.WIDTH,Main.HEIGHT, 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(fond);
tiles.add(player1.getTile()); tiles.add(player1.getTile());
tiles.add(player2.getTile()); tiles.add(player2.getTile());
tiles.add(this.mur1);
tiles.add(this.mur2);
tiles.add(this.mur3);
generateEntity(3); generateEntity(3);
} }
@ -114,11 +117,11 @@ public class MainWorld {
} }
public void render(){ public void render(){
for(int i = tiles.size() - 1;i >= 0 ;i--) for(Tile t : tiles)t.render();
tiles.get(i).render();
} }
public void destroy(){ public void destroy(){
for(Tile t : tiles)t.destroy();
tiles.clear(); tiles.clear();
} }