Skip to content

Commit

Permalink
Fixed issues #1 and #2.
Browse files Browse the repository at this point in the history
#1 - Bird was moving at different speeds on different window sizes,
making it unplayable on larger window sizes.
#2 - Window title was "Hello World!". Yeah...
  • Loading branch information
TheZeus121 committed Feb 18, 2018
1 parent bcc8ee1 commit 9bd969a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/res/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var holes = [];

var speed;

var gravity = 1 / 500000;
var gravity = 1 / 2000000;

// BufferedImage for double buffered rendering
var buf = null;
Expand Down Expand Up @@ -132,7 +132,7 @@ function update(delta) {
checkHighscore();
}

y += speed.y;
y += speed.y * delta;
if (y < 0) {
y = 0;
}
Expand Down Expand Up @@ -251,7 +251,7 @@ function draw(g, width, height) {
// make the frame
var frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setTitle("Hello World!");
frame.setTitle("Flip-Floppy Bird");

// class is implemented here bcs i did it with the panel class, too
var keyListener = new MyKeyListener({
Expand All @@ -261,7 +261,7 @@ var keyListener = new MyKeyListener({
System.exit(0);
} else if (e.getKeyCode() == KeyEvent.VK_SPACE) {
if (!gameover) {
speed.y = -1 / 1000;
speed.y = -1 / 3000;
}
} else if (e.getKeyCode() == KeyEvent.VK_R) {
checkHighscore();
Expand Down

0 comments on commit 9bd969a

Please sign in to comment.