Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added fadjdsj's loading screen. Fixes #16 (loading screen).

  • Loading branch information...
commit f75ee5ae87f62c4cc1dc42cbbc9b7283c38fa353 1 parent 8bd7b81
Rob authored
View
8 farmer.js
@@ -24,13 +24,13 @@ function Farmer(){
this.animations = {
idle: new Animation({imageURL: "images/farmer.png"}),
- west: new Animation({imageURL: "images/walking-west.png",
+ west: new Animation({imageURL: "images/farmer-walking-west.png",
numberOfFrame: 2, type: $.gameQuery.ANIMATION_HORIZONTAL, rate: JarmView.frameRate * 10, delta: 16}),
- east: new Animation({imageURL: "images/walking-east.png",
+ east: new Animation({imageURL: "images/farmer-walking-east.png",
numberOfFrame: 2, type: $.gameQuery.ANIMATION_HORIZONTAL, rate: JarmView.frameRate * 10, delta: 16}),
- north: new Animation({imageURL: "images/walking-north.png",
+ north: new Animation({imageURL: "images/farmer-walking-north.png",
numberOfFrame: 2, type: $.gameQuery.ANIMATION_HORIZONTAL, rate: JarmView.frameRate * 10, delta: 16}),
- south: new Animation({imageURL: "images/walking-south.png",
+ south: new Animation({imageURL: "images/farmer-walking-south.png",
numberOfFrame: 2, type: $.gameQuery.ANIMATION_HORIZONTAL, rate: JarmView.frameRate * 10, delta: 16})
};
View
0  images/walking-east.png → images/farmer-walking-east.png
File renamed without changes
View
0  images/walking-north.png → images/farmer-walking-north.png
File renamed without changes
View
0  images/walking-south.png → images/farmer-walking-south.png
File renamed without changes
View
0  images/walking-west.png → images/farmer-walking-west.png
File renamed without changes
View
BIN  images/startscreen.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
7 index.html
@@ -4,7 +4,12 @@
<link rel = "stylesheet" type = "text/css" href = "style.css" />
</head>
<body>
- <div id = "playground"></div>
+ <div id = "playground">
+ <div id = "welcome-screen">
+ <div id = "loading-bar"></div><br />
+ <a id = "start-button">Click here to start!</a>
+ </div>
+ </div>
<div id = "msg"></div>
<div id = "sidebar">
Inventory:
View
14 initialize.js
@@ -32,11 +32,10 @@ $(function(){
view = new JarmView();
registerCallbacks();
- game.state = "playing";
- game.playground
- .startGame();
+ game.state = "not-started";
keyTracker = $.gameQuery.keyTracker;
+ $().setLoadBar("loading-bar", 400);
});
function loadPlants(){
@@ -94,6 +93,15 @@ function registerCallbacks(){
game.playground
.registerCallback(gameLoop, JarmView.frameRate)
.registerCallback(function() {view.update();}, view.updateRate);
+
+ $("#start-button").click(function(){
+ game.state = "playing";
+ game.playground
+ .startGame(function(){
+ $("#welcome-screen").remove();
+ });
+ });
+
$(document).keypress(onKeyPress);
$(document).click(onClick);
}
View
15 style.css
@@ -70,3 +70,18 @@ a:hover {
top: 610px;
z-index: 1;
}
+
+#welcome-screen{
+ background: url("images/startscreen.png");
+ width: 760px;
+ height: 600px;
+ margin-left: 20px;
+ position: absolute;
+ z-index: 100;
+ padding-top: 250px;
+ text-align: center;
+ color: white;
+}
+#start-button{
+ cursor: pointer;
+}
Please sign in to comment.
Something went wrong with that request. Please try again.