Skip to content
This repository has been archived by the owner on Oct 31, 2022. It is now read-only.

Commit

Permalink
Issue #1 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
JupiterRider committed Nov 22, 2020
1 parent 323c887 commit 3484099
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ configure(subprojects) {
}

subprojects {
version = '0.0.1-SNAPSHOT'
version = '0.0.2-SNAPSHOT'
ext.appName = 'GetIntoSpace'
repositories {
mavenLocal()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ public class SaturnFive {
private static final AtlasRegion OFF_ATLAS_REGION = AssetHandler.TEXTURE_ATLAS.findRegion("saturn5off");
private static final Vector2 SIZE = new Vector2(ON_ATLAS_REGION.getRegionWidth() * 5,
ON_ATLAS_REGION.getRegionHeight() * 5);
private static final float SPEED = 200f;
private static final float SPEED = 250f;
private static final Vector2 NORMAL = new Vector2(1f, 1f).nor();

private Vector2 pos;
private boolean up = false;
// private boolean up = false;
private boolean left = false;
private boolean right = false;
private Rectangle rectangle;
Expand All @@ -39,10 +39,10 @@ public void draw(Batch batch, float delta) {
pos.mulAdd(new Vector2(SPEED, SPEED).scl(NORMAL), delta);
pos = clampPos(pos);
batch.draw(ON_ATLAS_REGION, pos.x, pos.y, SIZE.x, SIZE.y);
} else if (up) {
pos.mulAdd(new Vector2(0f, SPEED), delta);
pos = clampPos(pos);
batch.draw(ON_ATLAS_REGION, pos.x, pos.y, SIZE.x, SIZE.y);
// } else if (up) {
// pos.mulAdd(new Vector2(0f, SPEED), delta);
// pos = clampPos(pos);
// batch.draw(ON_ATLAS_REGION, pos.x, pos.y, SIZE.x, SIZE.y);
} else {
pos.mulAdd(new Vector2(0f, -100f), delta);
pos = clampPos(pos);
Expand All @@ -53,11 +53,11 @@ public void draw(Batch batch, float delta) {
}

private void checkInput() {
if (Gdx.input.isKeyPressed(Keys.SPACE) || Gdx.input.isKeyPressed(Keys.W) || Gdx.input.isKeyPressed(Keys.UP)) {
up = true;
} else {
up = false;
}
// if (Gdx.input.isKeyPressed(Keys.SPACE) || Gdx.input.isKeyPressed(Keys.W) || Gdx.input.isKeyPressed(Keys.UP)) {
// up = true;
// } else {
// up = false;
// }

if (Gdx.input.isKeyPressed(Keys.A) || Gdx.input.isKeyPressed(Keys.LEFT)) {
left = true;
Expand Down

0 comments on commit 3484099

Please sign in to comment.