Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client.js #45

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
061926e
Initial commit. Basic work on server API (near done), renderer (messy…
PartyLich Nov 17, 2012
ceac5ec
Minor mods left out of initial commit.
PartyLich Nov 17, 2012
b03b225
Added coordinate class.
PartyLich Nov 17, 2012
e34f23a
Added texture directory
PartyLich Nov 17, 2012
3273224
Added player model.
PartyLich Nov 17, 2012
c6e39ab
Removed redudant lines (they added to the prettiness of eclipse's out…
PartyLich Nov 17, 2012
11e65cc
Added tileType model
PartyLich Nov 17, 2012
04710d9
Added moveSet model stub
PartyLich Nov 17, 2012
efa4def
Added unit model
PartyLich Nov 17, 2012
3ec212c
Fixed typo (extra comma)
PartyLich Nov 17, 2012
abf1f7b
Added GameState model
PartyLich Nov 17, 2012
51c05b2
Standardized player model
PartyLich Nov 17, 2012
02c769b
Added Move model
PartyLich Nov 17, 2012
d2660be
Taking advantage of execution order
PartyLich Nov 17, 2012
3bba1f9
Added concrete tile objects (water, grass, etc)
PartyLich Nov 17, 2012
a653e1b
Added GamePlayer object
PartyLich Nov 17, 2012
0c0e4cf
Minor housekeeping
PartyLich Nov 17, 2012
0293e47
Cleaning up c# leftovers
PartyLich Nov 18, 2012
d4e18ba
Cleaning up
PartyLich Nov 18, 2012
91416e7
Started Map model
PartyLich Nov 18, 2012
09a99ee
Expanded shell of program
PartyLich Nov 18, 2012
c57360d
Added simple texture loading
PartyLich Nov 18, 2012
5dd03ff
Added jquery to lib
PartyLich Nov 18, 2012
db9d709
Added webfont variations of the samurai font
PartyLich Nov 18, 2012
b05c5eb
Started ContentManager. It's presently something like an image cache
PartyLich Nov 18, 2012
342fdb0
fixed naming to match server
PartyLich Nov 18, 2012
ed9d71f
fixed naming to match server
PartyLich Nov 18, 2012
219dda4
Bug: forgot the quotes on dataType setting
PartyLich Nov 18, 2012
1437322
Changed z indexing, styled a few more elements
PartyLich Nov 19, 2012
8715a07
Added html page
PartyLich Nov 19, 2012
11b2eff
Dropped unnecessary forward slashes from api addresses
PartyLich Nov 19, 2012
20e6491
console error logging, api camelcasing
PartyLich Nov 19, 2012
e9fd0ec
More script tags because i havent done real dependency management.
PartyLich Nov 19, 2012
f5dec15
Fixed idiotic loop initialization errors, variable naming
PartyLich Nov 19, 2012
5a2ba5c
Table sizing
PartyLich Nov 19, 2012
3ae18b5
Fixed more loop errors (ouch). Corrected resource locations
PartyLich Nov 19, 2012
200c2ad
Main program work.
PartyLich Nov 19, 2012
f79ee22
Improved element positioning.
PartyLich Nov 19, 2012
d549d79
Dropped some c# comments
PartyLich Nov 19, 2012
775775b
Enabled login, housekeeping
PartyLich Nov 19, 2012
0d30612
AMD module style
PartyLich Nov 20, 2012
1a97fa6
Renamed program.js to samurai.js
PartyLich Nov 20, 2012
2c9d77d
Cleaning dead script tags
PartyLich Nov 20, 2012
397dc82
doc comments
PartyLich Nov 20, 2012
3498fd1
Clientside templating.
PartyLich Nov 23, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/Samurai.Client.JS/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require.config({
paths: { //Configure library/module paths.
/*'jquery' : 'https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min',*/
'jquery' : 'lib/jquery-1.8.2.min',
'jsrender' : 'lib/jsrender',
'contentManager': 'contentManager',
'coord': 'models/coord',
'gameState' : 'models/gameState',
'map' : 'models/map',
'player' : 'models/player',
'renderer' : 'renderer',
'serverApi' : 'serverApi',
'tiles' : 'models/tileType',
}
});

require(['jquery', 'samurai'], function ($, Samurai) {
$(function() {
var samurai = new Samurai();

samurai.run();
});
});
23 changes: 23 additions & 0 deletions src/Samurai.Client.JS/contentManager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
define(function () {
/**
*
*/
function ContentManager() {
this.textures = {};
}

ContentManager.prototype.loadTexture2D = function (texture) {
if(this.textures[texture])
return this.textures[texture];
else {
var tmpImg = new Image();

tmpImg.src = texture;
this.textures[texture] = tmpImg;

return tmpImg;
}
};

return ContentManager;
});
2 changes: 2 additions & 0 deletions src/Samurai.Client.JS/lib/jquery-1.8.2.min.js

Large diffs are not rendered by default.

Loading