all repos — uStrat @ 7f93fade96c8461da8dd5350edb04f11fcb2d94d

simple turn-based strategy game inspired by uCity, Super Robot Wars, C&C, Fire Emblem

fix AI.targetReset(); UI improvements
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE-----

iQJDBAABCAAtFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAl6vn/oPHG5pbGl4QG5p
bGZtLmNjAAoJEDt/vCIUTmOYjoYP/0Pj9ch7KyB5T7hEaDl1/lMUuq7wCSBJwKfa
Rovoe3kCZ6Bf1q8jHad+pgbFESUQ7nEmSWobqpMwQu7DPIqV43GK9qo9/swqbOBl
QyfuExETVOVmBVlC3PSVMQ5I5PrA5pJApoCy8Pztq6eFhZ9uhTyjY2BPkf+G9U84
fNOWYhcjr6+pCHKvtcwSHGccmKzE/UPtBlqvTzICvh0rPUihUB0ICLsi1ASHbAS9
romAL7PrYTKbHyOuJ6FpAZniP/i1Tz0h2mHVaLuA1Wo7AjcJRggUaPeT1Rg2ysQx
rX/u4ExxCe2jDNxtiN6JLxCzvp/aaG0tudXlmy+XcpcBi3e/soeJmnGXiB3Fq9Wf
jntLzP0TcTFiv0Jt5d1WeyVk3+5a2Yl5raWUSeJRnEAvRdOThB07KWrFmqF8JtJ3
+MDhWqRdMGG6o1XGt0T8feScIScggDbIUA4q23fMSzyxk5KShD+qyQdC4/cy7DSx
nzCxvHV3FT/IW5EEUSMfE/hr74tMDphsyGO6lFqBMSqVrMhetAnyRYx++rUiIddd
aD/9Jei0zSVEywzCRy5parD075DqGpB3w11GN3OcvXX4cM6kcLib7uLqs506bn8Q
hdI7U+jmKpPRwfoA27kRTrC1MxQv2W6WZUgDfWupFFutKqSe9Ll3OM1drmcBWDZ6
lCBym29P
=F2Ux
-----END PGP SIGNATURE-----
commit

7f93fade96c8461da8dd5350edb04f11fcb2d94d

parent

f66caa06802c8e5120293354e715850c17b125a1

M AI.jsAI.js

@@ -817,7 +817,7 @@ }

AI.targetReset = function(target) { - for (int i = 0; i < teams.cpu.units.length; i++) + for (var i = 0; i < teams.cpu.units.length; i++) { if (teams.cpu.units[i].target.x == target.x && teams.cpu.units[i].target.y == target.y)
M Engine.jsEngine.js

@@ -138,6 +138,7 @@ attack.listen();

map.draw(); attack.drawPattern(); mapCursor.draw(); + hud.draw(); } function attackAnim()
M Map.jsMap.js

@@ -12,8 +12,12 @@ camera.y = 0;

window.hud = {}; hud.gfx = {}; +hud.gfx.statusWindow = new Image(); +hud.gfx.statusWindow.src = "assets/ui/statusWindow.png"; hud.gfx.terrainWindow = new Image(); hud.gfx.terrainWindow.src = "assets/ui/terrainWindow.png"; +hud.gfx.unitWindow = new Image(); +hud.gfx.unitWindow.src = "assets/ui/unitWindow.png"; hud.gfx.structWindow = new Image(); hud.gfx.structWindow.src = "assets/ui/structWindow.png"; hud.gfx.cycleModes = new Array(4);

@@ -61,17 +65,18 @@ screen.fillText(currentCell.type, 10, 20);

screen.fillText("def+" + currentCell.defMod, 10, 30); screen.fillText("agi-" + currentCell.agiMod, 10, 40); - screen.fillText(gameState.phase + " phase", 240, 10); - screen.fillText("ruin: " + gameState.ruin, 240, 20); - screen.fillText("E: " + teams.p1.energy + "/" + teams.cpu.energy, 240, 30); - screen.fillText("S: " + teams.p1.structs.length + "/" + teams.cpu.structs.length, 240, 40); - screen.fillText("U: " + teams.p1.units.length + "/" + teams.cpu.units.length, 240, 50); + screen.drawImage(hud.gfx.statusWindow, 230, 5); + screen.fillText(gameState.phase + " phase", 235, 10); + screen.fillText("ruin: " + gameState.ruin, 235, 20); + screen.fillText("E: " + teams.p1.energy + "/" + teams.cpu.energy, 235, 30); + screen.fillText("S: " + teams.p1.structs.length + "/" + teams.cpu.structs.length, 235, 40); + screen.fillText("U: " + teams.p1.units.length + "/" + teams.cpu.units.length, 235, 50); screen.drawImage(hud.gfx.cycleModes[mapCursor.cycleMode], 85, 5); if (!isEmptyObject(currentCell.structure)) { -// screen.drawImage(hud.gfx.structWindow, 5, 135); + screen.drawImage(hud.gfx.structWindow, 5, 135); screen.fillText(currentCell.structure.name, 10, 140); screen.fillText("HP: " + currentCell.structure.hp + "/" + currentCell.structure.maxHP, 10, 150); screen.fillText("E: " + currentCell.structure.energy + "@" + currentCell.structure.rate, 10, 160);

@@ -79,6 +84,7 @@ }

if (!isEmptyObject(currentCell.unit)) { + screen.drawImage(hud.gfx.unitWindow, 5, 55); screen.fillText(currentCell.unit.name, 10, 60); screen.fillText("HP: " + currentCell.unit.hp + "/" + currentCell.unit.maxHP, 10, 70); screen.fillText("pow: " + currentCell.unit.pow, 10, 80);