From 1c782ce6b9dac67b4166cfe0b769bbab9c22538f Mon Sep 17 00:00:00 2001 From: magnsskj <magnsskj@stud.ntnu.no> Date: Thu, 30 Mar 2023 14:30:12 +0200 Subject: [PATCH] (#18): add pixels to viewport + scaling to meters --- .../src/com/game/tankwars/TankWarsGame.java | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/frontend/core/src/com/game/tankwars/TankWarsGame.java b/frontend/core/src/com/game/tankwars/TankWarsGame.java index 7ef4267..de10241 100644 --- a/frontend/core/src/com/game/tankwars/TankWarsGame.java +++ b/frontend/core/src/com/game/tankwars/TankWarsGame.java @@ -3,39 +3,20 @@ */ package com.game.tankwars; -import com.badlogic.gdx.ApplicationAdapter; import com.badlogic.gdx.Game; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.Input; -import com.badlogic.gdx.graphics.GL20; -import com.badlogic.gdx.graphics.OrthographicCamera; -import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.SpriteBatch; -import com.badlogic.gdx.math.Interpolation; -import com.badlogic.gdx.graphics.OrthographicCamera; -import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.BitmapFont; -import com.badlogic.gdx.graphics.g2d.SpriteBatch; -import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.physics.box2d.Body; -import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer; -import com.badlogic.gdx.physics.box2d.World; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.ScreenUtils; -import com.game.tankwars.model.Box2dWorld; -import com.game.tankwars.model.Bullet; -import com.game.tankwars.model.Tank; import com.game.tankwars.view.LoginScreen; -import com.game.tankwars.view.MainMenuScreen; public class TankWarsGame extends Game { + public static final float SCALE = 10; public static int VIEWPORT_WIDTH = 80; public static int VIEWPORT_HEIGHT = 50; + public static final int GAMEPORT_WIDTH = 720; + public static final int GAMEPORT_HEIGHT = 480; + private SpriteBatch batch; private BitmapFont font; -- GitLab