Ajout de fond
This commit is contained in:
parent
9e5d6a03c3
commit
40ac8f84fb
6 changed files with 67 additions and 7 deletions
11
.classpath
Normal file
11
.classpath
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<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="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
17
.project
Normal file
17
.project
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Global-Gam-Jam-2017</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
BIN
res/textures/fond.png
Normal file
BIN
res/textures/fond.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 700 KiB |
|
@ -1,17 +1,17 @@
|
|||
package globalgamejam.game;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import globalgamejam.Main;
|
||||
import globalgamejam.gui.ActionGUI;
|
||||
import globalgamejam.gui.GUI;
|
||||
import globalgamejam.gui.GUILabel;
|
||||
import globalgamejam.gui.IActionGUI;
|
||||
import globalgamejam.input.Input;
|
||||
import globalgamejam.render.*;
|
||||
import globalgamejam.render.Camera;
|
||||
import globalgamejam.tiles.Fond;
|
||||
import globalgamejam.tiles.TestTile;
|
||||
import globalgamejam.tiles.Tile;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Class created by MrDev023 (Florian RICHER) on 14/01/2017
|
||||
*/
|
||||
|
@ -25,11 +25,17 @@ public class MainGame extends Game{
|
|||
@Override
|
||||
public void init() {
|
||||
tiles = new ArrayList<Tile>();
|
||||
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);
|
||||
fond.getTransform().rotate(180, 0, 0);
|
||||
guis = new ArrayList<GUI>();
|
||||
TestTile t = new TestTile();
|
||||
t.getTransform().translate(100,100,0);
|
||||
t.getTransform().scale(10,10,0);
|
||||
tiles.add(fond);
|
||||
tiles.add(t);
|
||||
|
||||
label = new GUILabel("Test");
|
||||
label.setX(10);
|
||||
label.setY(10);
|
||||
|
@ -57,7 +63,8 @@ public class MainGame extends Game{
|
|||
|
||||
@Override
|
||||
public void render2D() {
|
||||
for(Tile t : tiles)t.render();
|
||||
for(int i = tiles.size() - 1;i >= 0 ;i--)
|
||||
tiles.get(i).render();
|
||||
}
|
||||
|
||||
|
||||
|
@ -72,4 +79,8 @@ public class MainGame extends Game{
|
|||
guis.clear();
|
||||
}
|
||||
|
||||
public void generateEntity(){
|
||||
int nb =3;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
11
src/globalgamejam/tiles/Fond.java
Normal file
11
src/globalgamejam/tiles/Fond.java
Normal file
|
@ -0,0 +1,11 @@
|
|||
package globalgamejam.tiles;
|
||||
|
||||
import globalgamejam.render.Texture;
|
||||
|
||||
public class Fond extends Tile {
|
||||
public Fond(String path){
|
||||
super();
|
||||
|
||||
super.setTexture(Texture.loadTexture(path));
|
||||
}
|
||||
}
|
10
src/globalgamejam/tiles/Objet.java
Normal file
10
src/globalgamejam/tiles/Objet.java
Normal file
|
@ -0,0 +1,10 @@
|
|||
package globalgamejam.tiles;
|
||||
|
||||
import globalgamejam.math.Color4f;
|
||||
|
||||
public class Objet extends Tile {
|
||||
public Objet(){
|
||||
super();
|
||||
super.setColor(Color4f.GREEN);
|
||||
}
|
||||
}
|
Reference in a new issue