Skip to content

Commit

Permalink
Adding some acceleration to scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaskelly committed Apr 16, 2020
1 parent 7a6bd85 commit d7781ce
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions DelvEdit/src/com/interrupt/dungeoneer/editor/EditorFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ public boolean isWestFloor() {
double rotya = 0;
float rotYClamp = 1.571f;

float scrollSpeed = 0.4f;
float za = 0f;

double walkSpeed = 0.15;
double rotSpeed = 0.009;
double maxRot = 0.8;
Expand Down Expand Up @@ -2080,13 +2083,24 @@ else if(turnDown) {
xm = 1f;
}

if(editorInput.isKeyPressed(Keys.W) || editorInput.scrollAmount > 0) {
if(editorInput.isKeyPressed(Keys.W) || editorInput.scrollAmount < 0) {
zm = -1f;
}
if(editorInput.isKeyPressed(Keys.S) || editorInput.scrollAmount < 0) {
if(editorInput.isKeyPressed(Keys.S) || editorInput.scrollAmount > 0) {
zm = 1f;
}

if (editorInput.scrollAmount < 0) {
za -= scrollSpeed;
}
else if (editorInput.scrollAmount > 0) {
za += scrollSpeed;
}

zm += za;

za *= 0.8f;

if(editorInput.isKeyPressed(Keys.Q) && !editorInput.isKeyPressed(Keys.SHIFT_LEFT)) {
camZ -= 0.1f;
}
Expand Down

0 comments on commit d7781ce

Please sign in to comment.