master
GammelJAN 6 years ago
parent de036f82c8
commit aadc0d8516

Binary file not shown.

Before

Width:  |  Height:  |  Size: 769 B

After

Width:  |  Height:  |  Size: 790 B

@ -200,6 +200,8 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
for(int k = 5; k < d.getCurrentEntities().length; k++){ for(int k = 5; k < d.getCurrentEntities().length; k++){
if(d.getCurrentEntities()[k] == null){ if(d.getCurrentEntities()[k] == null){
Entity arrow = d.getCurrentEntities()[i].shoot((int) d.getPlayer().getxPos(), (int) d.getPlayer().getyPos()); Entity arrow = d.getCurrentEntities()[i].shoot((int) d.getPlayer().getxPos(), (int) d.getPlayer().getyPos());
arrow.setxPos(d.getCurrentEntities()[i].getxPos() + 32);
arrow.setyPos(d.getCurrentEntities()[i].getyPos() + 32);
d.getCurrentEntities()[k] = arrow; d.getCurrentEntities()[k] = arrow;
gs.generateNewEntitySprite(arrow, k); gs.generateNewEntitySprite(arrow, k);
gs.entitySprites[i].resetAttackState(); gs.entitySprites[i].resetAttackState();
@ -491,12 +493,10 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
} }
} }
if(keycode == Input.Keys.ESCAPE){ if(keycode == Input.Keys.ESCAPE){
if(gs != null && gs.getIsLoading() == false){ if(gs != null && gs.getIsLoading() == false && isPaused == false){
stop(); stop();
} }
} else if(gs != null && gs.getIsLoading() == false && isPaused == true){
if(keycode == Input.Keys.TAB){
if(gs != null && gs.getIsLoading() == false){
resume(); resume();
} }
} }
@ -684,6 +684,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
gs.resume(); gs.resume();
ps = null; ps = null;
gs.startLoadingScreen();
} }
} }

@ -110,8 +110,8 @@ public class Archer extends Entity{
} }
} }
Arrow a = new Arrow(this.xPos, this.yPos, this.lvl, 0); Arrow a = new Arrow(this.xPos, this.yPos, this.lvl, 0);
movementX = (int) (5 * Math.cos(alpha)); movementX = (int) (7 * Math.cos(alpha));
movementY = (int) (5 * Math.sin(alpha)); movementY = (int) (7 * Math.sin(alpha));
a.setMovementX(movementX); a.setMovementX(movementX);
a.setMovementY(movementY); a.setMovementY(movementY);

@ -20,6 +20,7 @@ import java.util.ArrayList;
public class GameScreen { public class GameScreen {
//PLAYER //PLAYER
Texture p; Texture p;
EntitySprite player; EntitySprite player;
@ -77,6 +78,7 @@ public class GameScreen {
controls.setY(0); controls.setY(0);
*/ */
entities = d.getCurrentEntities(); entities = d.getCurrentEntities();
//PLAYER //PLAYER
@ -215,8 +217,9 @@ public class GameScreen {
} }
//MAP //MAP
tmr.setView(camera); tmr.setView(camera);
tmr.render();
tmr.render();
camera.zoom = 700f; // Standart 700f camera.zoom = 700f; // Standart 700f
@ -224,7 +227,7 @@ public class GameScreen {
batch.setProjectionMatrix(camera.combined); batch.setProjectionMatrix(camera.combined);
updateEntitySprites(e); updateEntitySprites(e);
//BATCH //BATCH
batch.begin(); batch.begin();
@ -291,10 +294,10 @@ public class GameScreen {
} }
if(e.getId() == 2){ if(e.getId() == 2){
tx[0] = new Texture("sprites/arrow.png"); tx[0] = new Texture("sprites/arrow.png");
entitySprites[i] = new EntitySprite(tx, 18, 9); entitySprites[i] = new EntitySprite(tx, 36, 15);
} }
entitySprites[i].update((int) e.getxPos(), (int) e.getyPos()); entitySprites[i].update((int) e.getxPos() + 32, (int) e.getyPos() + 32);
if(e.getId() == 2){ if(e.getId() == 2){
entitySprites[i].getSprites()[0].setRotation((float) Math.toDegrees(e.getAngle())); entitySprites[i].getSprites()[0].setRotation((float) Math.toDegrees(e.getAngle()));
@ -427,12 +430,11 @@ public class GameScreen {
public void stop(){ public void stop(){
animations.stop(); animations.stop();
animatePlayer.stop(); animatePlayer.stop();
camera = null;
} }
public void resume(){ public void resume(){
animations.start(); animations.start();
animatePlayer.start(); animatePlayer.start();
} }
} }

Loading…
Cancel
Save