Merge branch 'liteCraft' of https://github.com/halotroop/Ginger3D into liteCraft
commit
05d0c52958
src/main/java/com/github
halotroop/litecraft
hydos/ginger/engine/api
|
@ -32,8 +32,8 @@ public class Litecraft extends Game
|
||||||
private LitecraftSave save;
|
private LitecraftSave save;
|
||||||
private Ginger ginger3D;
|
private Ginger ginger3D;
|
||||||
private static Litecraft INSTANCE;
|
private static Litecraft INSTANCE;
|
||||||
private Player player;
|
public Player player;
|
||||||
private Camera camera;
|
public Camera camera;
|
||||||
//temp stuff to test out fbo fixes
|
//temp stuff to test out fbo fixes
|
||||||
int oldWindowWidth = Window.width;
|
int oldWindowWidth = Window.width;
|
||||||
int oldWindowHeight = Window.height;
|
int oldWindowHeight = Window.height;
|
||||||
|
@ -158,22 +158,13 @@ public class Litecraft extends Game
|
||||||
public static Litecraft getInstance()
|
public static Litecraft getInstance()
|
||||||
{ return INSTANCE; }
|
{ return INSTANCE; }
|
||||||
|
|
||||||
public void setGingerPlayer(Player player)
|
|
||||||
{
|
|
||||||
this.data.entities.remove(this.player); // remove the old player
|
|
||||||
this.data.player = player; // set all the player variables
|
|
||||||
this.player = player;
|
|
||||||
this.camera.player = player;
|
|
||||||
this.data.entities.add(this.player); // add the new player
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onPlayButtonClick()
|
public void onPlayButtonClick()
|
||||||
{
|
{
|
||||||
if (world == null)
|
if (world == null)
|
||||||
{
|
{
|
||||||
this.save = new LitecraftSave("test", false);
|
this.save = new LitecraftSave("test", false);
|
||||||
this.world = this.save.getWorldOrCreate(Dimensions.OVERWORLD);
|
this.world = this.save.getWorldOrCreate(Dimensions.OVERWORLD);
|
||||||
this.setGingerPlayer(this.world.player);
|
ginger3D.setGingerPlayer(this.world.player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -8,6 +8,7 @@ import com.github.halotroop.litecraft.logic.Timer.TickListener;
|
||||||
import com.github.halotroop.litecraft.world.World;
|
import com.github.halotroop.litecraft.world.World;
|
||||||
import com.github.hydos.ginger.engine.api.game.*;
|
import com.github.hydos.ginger.engine.api.game.*;
|
||||||
import com.github.hydos.ginger.engine.elements.buttons.TextureButton;
|
import com.github.hydos.ginger.engine.elements.buttons.TextureButton;
|
||||||
|
import com.github.hydos.ginger.engine.elements.objects.Player;
|
||||||
import com.github.hydos.ginger.engine.font.*;
|
import com.github.hydos.ginger.engine.font.*;
|
||||||
import com.github.hydos.ginger.engine.io.Window;
|
import com.github.hydos.ginger.engine.io.Window;
|
||||||
import com.github.hydos.ginger.engine.particle.ParticleMaster;
|
import com.github.hydos.ginger.engine.particle.ParticleMaster;
|
||||||
|
@ -48,7 +49,16 @@ public class Ginger
|
||||||
|
|
||||||
public void openScreen(Screen screen)
|
public void openScreen(Screen screen)
|
||||||
{ gingerRegister.currentScreen = screen; }
|
{ gingerRegister.currentScreen = screen; }
|
||||||
|
|
||||||
|
public void setGingerPlayer(Player player)
|
||||||
|
{
|
||||||
|
gingerRegister.game.data.entities.remove(Litecraft.getInstance().player); // remove the old player
|
||||||
|
gingerRegister.game.data.player = player; // set all the player variables
|
||||||
|
Litecraft.getInstance().player = player;
|
||||||
|
Litecraft.getInstance().camera.player = player;
|
||||||
|
gingerRegister.game.data.entities.add(player); // add the new player
|
||||||
|
}
|
||||||
|
|
||||||
public void postRender()
|
public void postRender()
|
||||||
{ Window.swapBuffers(); }
|
{ Window.swapBuffers(); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue