Permalink
Browse files

jaws.gameloop is now jaws.game_loop

  • Loading branch information...
1 parent 096f810 commit b1401a3c47294aa112958d91d7495c0ebefce2a0 @ippa committed Aug 21, 2011
@@ -29,7 +29,7 @@
this.draw = function() {
for(var i=0; i < loop; i++) { jaws.context.drawImage(image, 0, 0) }
- fps.innerHTML = jaws.gameloop.fps + ". " + "context.drawImage(image)"
+ fps.innerHTML = jaws.game_loop.fps + ". " + "context.drawImage(image)"
}
}
@@ -46,7 +46,7 @@
this.draw = function() {
for(var i=0; i < loop; i++) { jaws.context.drawImage(canvas, 0, 0) }
- fps.innerHTML = jaws.gameloop.fps + ". " + "context.drawImage(context)"
+ fps.innerHTML = jaws.game_loop.fps + ". " + "context.drawImage(context)"
}
}
@@ -46,7 +46,7 @@
sprite.draw();
}
sprite.rotate(1)
- fps.innerHTML = jaws.gameloop.fps
+ fps.innerHTML = jaws.game_loop.fps
}
}
@@ -66,15 +66,15 @@
jaws.context.restore()
}
- fps.innerHTML = jaws.gameloop.fps
+ fps.innerHTML = jaws.game_loop.fps
rotation += 1
}
}
jaws.onload = function() {
jaws.assets.add("plane.png")
jaws.on_keydown("space", function() { jaws.switchGameState(BenchCanvas) })
- jaws.on_keydown("esc", function() { jaws.gameloop.stop() })
+ jaws.on_keydown("esc", function() { jaws.game_loop.stop() })
jaws.start(BenchSprite, 200) // Try impossible framerate
}
</script>
@@ -43,7 +43,7 @@
jaws.clear()
sprite.draw()
}
- fps.innerHTML = jaws.gameloop.fps
+ fps.innerHTML = jaws.game_loop.fps
}
}
@@ -60,14 +60,14 @@
jaws.clear()
sprite.draw()
}
- fps.innerHTML = jaws.gameloop.fps
+ fps.innerHTML = jaws.game_loop.fps
}
}
jaws.onload = function() {
jaws.assets.add("plane.png")
jaws.on_keydown("space", function() { jaws.switchGameState(BenchCanvas) })
- jaws.on_keydown("esc", function() { jaws.gameloop.stop() })
+ jaws.on_keydown("esc", function() { jaws.game_loop.stop() })
jaws.start(BenchSprite, 200) // Try impossible framerate
}
</script>
View
@@ -64,8 +64,8 @@
player.draw()
bullets.draw() // will call draw() on all items in the list
- info_tag.innerHTML = "FPS: " + jaws.gameloop.fps + " Player position: " + player.x + "/" + player.y + ". W/H: " + canvas.width + "/" + canvas.height
- fps.innerHTML = jaws.gameloop.fps
+ info_tag.innerHTML = "FPS: " + jaws.game_loop.fps + " Player position: " + player.x + "/" + player.y + ". W/H: " + canvas.width + "/" + canvas.height
+ fps.innerHTML = jaws.game_loop.fps
}
/* 2 functions that will help us remove bullets outside the canvas + keep the plane within the canvas. */
View
@@ -42,8 +42,8 @@
draw: function() {
jaws.clear()
player.draw()
- info_tag.innerHTML = "FPS: " + jaws.gameloop.fps + " Player position: " + player.x + "/" + player.y
- fps.innerHTML = jaws.gameloop.fps
+ info_tag.innerHTML = "FPS: " + jaws.game_loop.fps + " Player position: " + player.x + "/" + player.y
+ fps.innerHTML = jaws.game_loop.fps
}
}
View
@@ -60,7 +60,7 @@
forceInsideCanvas(player)
bullets.deleteIf(isOutsideCanvas) // delete items for which isOutsideCanvas(item) is true
- fps.innerHTML = jaws.gameloop.fps
+ fps.innerHTML = jaws.game_loop.fps
}
this.draw = function() {
View
@@ -65,7 +65,7 @@
if(jaws.pressed("up")) { player.y -= speed; player.image = player.anim_up.next() }
if(jaws.pressed("down")) { player.y += speed; player.image = player.anim_down.next() }
//forceInsideCanvas(player)
- fps.innerHTML = jaws.gameloop.fps + ". player: " + player.x + "/" + player.y
+ fps.innerHTML = jaws.game_loop.fps + ". player: " + player.x + "/" + player.y
}
/* Directly after each update draw() will be called. Put all your on-screen operations here. */
View
@@ -62,7 +62,7 @@
}
});
- fps.innerHTML = jaws.gameloop.fps
+ fps.innerHTML = jaws.game_loop.fps
}
/* Directly after each update draw() will be called. Put all your on-screen operations here. */
View
@@ -55,7 +55,7 @@
sprite.rotate(1)
});
- fps.innerHTML = jaws.gameloop.fps
+ fps.innerHTML = jaws.game_loop.fps
}
/* Directly after each update draw() will be called. Put all your on-screen operations here. */
View
@@ -37,7 +37,7 @@
if(jaws.pressed("left")) { parallax.camera_x -= 10 }
if(jaws.pressed("right")) { parallax.camera_x += 10 }
else { parallax.camera_x += 2 }
- fps.innerHTML = jaws.gameloop.fps
+ fps.innerHTML = jaws.game_loop.fps
}
this.draw = function() {
View
@@ -73,11 +73,11 @@
player.vy /= 1.10
bullets.update()
- // jaws.log("bullets: " + bullets.length + " fps: " + jaws.gameloop.fps)
+ // jaws.log("bullets: " + bullets.length + " fps: " + jaws.game_loop.fps)
}
this.draw = function() {
- //fps.innerHTML = jaws.gameloop.fps
+ //fps.innerHTML = jaws.game_loop.fps
player.draw()
bullets.draw()
}
View
@@ -87,7 +87,7 @@
if(jaws.pressed("right")) { player.move(2,0); player.setImage(player.anim_right.next()) }
if(jaws.pressed("up")) { player.move(0, -2); player.setImage(player.anim_up.next()) }
if(jaws.pressed("down")) { player.move(0, 2); player.setImage(player.anim_down.next()) }
- fps.innerHTML = jaws.gameloop.fps + ". player: " + player.x + "/" + player.y
+ fps.innerHTML = jaws.game_loop.fps + ". player: " + player.x + "/" + player.y
}
/* Directly after each update draw() will be called. Put all your on-screen operations here. */
View
@@ -124,7 +124,7 @@
// It won't go outside of 0 or outside of our previously specified max_x, max_y values.
viewport.centerAround(player)
- live_info.innerHTML = jaws.gameloop.fps + " fps. Player: " + parseInt(player.x) + "/" + parseInt(player.y) + ". "
+ live_info.innerHTML = jaws.game_loop.fps + " fps. Player: " + parseInt(player.x) + "/" + parseInt(player.y) + ". "
live_info.innerHTML += "Viewport: " + parseInt(viewport.x) + "/" + parseInt(viewport.y) + "."
}
Oops, something went wrong.

0 comments on commit b1401a3

Please sign in to comment.