Browse Source

higher order rocks + beard5 map

master
Stefan Bühler 7 years ago
parent
commit
068cc396dd
15 changed files with 104 additions and 20 deletions
  1. 2
    1
      js/Makefile
  2. 7
    4
      js/gui.js
  3. 1
    1
      js/gui.min.js
  4. BIN
      js/horock.png
  5. 1
    1
      js/maps.js
  6. 1
    1
      js/maps.min.js
  7. 19
    11
      js/mine.js
  8. 1
    1
      js/mine.min.js
  9. BIN
      js/sprites.png
  10. 29
    0
      maps/beard5.map
  11. 14
    0
      maps/horock1.map
  12. 13
    0
      maps/horock2.map
  13. 16
    0
      maps/horock3.map
  14. BIN
      specs/horocks.pdf
  15. BIN
      specs/images/horock.bmp

+ 2
- 1
js/Makefile View File

@@ -1,5 +1,6 @@

MAPS=
MAPS+=$(wildcard ../maps/horock*.map)
MAPS+=$(wildcard ../maps/beard*.map)
MAPS+=$(wildcard ../maps/trampoline*.map)
MAPS+=$(wildcard ../maps/flood*.map)
@@ -17,7 +18,7 @@ maps.js: FORCE
SPRITES=earth.png empty.png lambda.png lift.png openlift.png miner.png rock.png bricks.png
SPRITES+=$(wildcard trampoline?.png)
SPRITES+=$(wildcard target?.png)
SPRITES+=beard.png razor.png deadminer.png minerlift.png
SPRITES+=beard.png razor.png deadminer.png minerlift.png horock.png

sprites.png: $(SPRITES)
convert -background "#000000" -append $(SPRITES) tmp_sprites.png

+ 7
- 4
js/gui.js View File

@@ -18,7 +18,8 @@ var mineGui_spriteOffset = {
'A': 8,'B': 9,'C':10,'D':11,'E':12,'F':13,'G':14,'H':15,'I':16,
'1':17,'2':18,'3':19,'4':20,'5':21,'6':22,'7':23,'8':24,'9':25,
'W':26,
'!':27
'!':27,
'@':30
};
var mineGui_spriteOffset_Lost = {
'R': 28,
@@ -32,7 +33,8 @@ var mineGui_spriteOffset_Lost = {
'A': 8,'B': 9,'C':10,'D':11,'E':12,'F':13,'G':14,'H':15,'I':16,
'1':17,'2':18,'3':19,'4':20,'5':21,'6':22,'7':23,'8':24,'9':25,
'W':26,
'!':27
'!':27,
'@':30
};
var mineGui_spriteOffset_Won = {
'R': 29,
@@ -46,7 +48,8 @@ var mineGui_spriteOffset_Won = {
'A': 8,'B': 9,'C':10,'D':11,'E':12,'F':13,'G':14,'H':15,'I':16,
'1':17,'2':18,'3':19,'4':20,'5':21,'6':22,'7':23,'8':24,'9':25,
'W':26,
'!':27
'!':27,
'@':30
};

var mineGui_images = {};
@@ -346,7 +349,7 @@ function mineGui_show(queued) {
document.getElementById("mineGui_state").textContent = state;
document.getElementById("mineGui_score").textContent = mineGui_mine.score;
document.getElementById("mineGui_scoreMoves").textContent = mineGui_mine.moves;
document.getElementById("mineGui_scoreLambdas").textContent = mineGui_mine.found_lambdas;
document.getElementById("mineGui_scoreLambdas").textContent = mineGui_mine.found_lambdas + "/" + (mineGui_mine.lambdas+mineGui_mine.found_lambdas);
document.getElementById("mineGui_razors").textContent = mineGui_mine.razors;
document.getElementById("mineGui_belowWater").textContent = mineGui_mine.moves_below_water;
}

+ 1
- 1
js/gui.min.js
File diff suppressed because it is too large
View File


BIN
js/horock.png View File


+ 1
- 1
js/maps.js
File diff suppressed because it is too large
View File


+ 1
- 1
js/maps.min.js
File diff suppressed because it is too large
View File


+ 19
- 11
js/mine.js View File

@@ -73,6 +73,7 @@ var Mine = function() {
case 'W':
case '!':
break;
case '@':
case '\\':
this.lambdas++;
break;
@@ -180,6 +181,7 @@ var Mine = function() {
case 'L': return false;
case 'O': return true;
case '*':
case '@':
if (' ' == this.map[this.robot.y][this.robot.x+2*n]) return true;
default:
if (this.trampoline.sources.hasOwnProperty(c)) return true;
@@ -199,6 +201,7 @@ var Mine = function() {
case 'L': return false;
case 'O': return true;
case '*': return false;
case '@': return false;
default:
if (this.trampoline.sources.hasOwnProperty(c)) return true;
break;
@@ -227,7 +230,8 @@ var Mine = function() {
c = map[this.robot.y][this.robot.x+n];
switch (c) {
case '*':
map[this.robot.y][this.robot.x+2*n] = '*';
case '@':
map[this.robot.y][this.robot.x+2*n] = c;
break;
case '\\':
this.lambdas--;
@@ -317,27 +321,31 @@ var Mine = function() {
for (y = 2; y < 2+this.height; ++y) {
for (x = 1; x <= this.width; ++x) {
if ('*' == map[y][x]) {
c = map[y][x];
if ('*' === c || '@' === c) {
below = map[y-1][x];
if (' ' == below) {
if (' ' === below) {
// fall down
newMap[y-1][x] = '*';
newMap[y-1][x] = c;
if ('@' === c && ' ' != map[y-2][x]) newMap[y-1][x] = '\\';
newMap[y][x] = ' ';
if ('R' == map[y-2][x]) this._crushed();
} else if ((below == '*' || below == '\\') && ' ' == map[y-1][x+1] && ' ' == map[y][x+1]) {
if ('R' === map[y-2][x]) this._crushed();
} else if ((below === '*' || below === '\\' || below === '@') && ' ' === map[y-1][x+1] && ' ' === map[y][x+1]) {
// fall right
newMap[y-1][x+1] = '*';
newMap[y-1][x+1] = c;
if ('@' === c && ' ' != map[y-2][x+1]) newMap[y-1][x+1] = '\\';
newMap[y][x] = ' ';
if ('R' == map[y-2][x+1]) this._crushed();
} else if ((below == '*') && ' ' == map[y-1][x-1] && ' ' == map[y][x-1]) {
} else if ((below === '*' || below === '@') && ' ' === map[y-1][x-1] && ' ' === map[y][x-1]) {
// fall left
newMap[y-1][x-1] = '*';
newMap[y-1][x-1] = c;
if ('@' === c && ' ' != map[y-2][x-1]) newMap[y-1][x-1] = '\\';
newMap[y][x] = ' ';
if ('R' == map[y-2][x-1]) this._crushed();
}
} else if (growBeard && 'W' == map[y][x]) {
} else if (growBeard && 'W' === c) {
for (i = -1; i <= 1; ++i) for (j = -1; j <= 1; ++j) {
if (' ' == map[y+i][x+j]) newMap[y+i][x+j] = 'W';
if (' ' === map[y+i][x+j]) newMap[y+i][x+j] = 'W';
}
}
}

+ 1
- 1
js/mine.min.js
File diff suppressed because it is too large
View File


BIN
js/sprites.png View File


+ 29
- 0
maps/beard5.map View File

@@ -0,0 +1,29 @@
##########
####..******####
###.. 3ABCDEF...##
## ##
### ##
###.....\\\...\\\.....###
#.. \\\ * \\\ ##
## * ##
### *** ##
#*****************##
###..............##
###...........##
####WR..W####
##L####
.....
###### ######
##1\! G##2 !\H##
###### ######

Trampoline A targets 1
Trampoline B targets 1
Trampoline C targets 1
Trampoline D targets 1
Trampoline E targets 1
Trampoline F targets 1
Trampoline G targets 2
Trampoline H targets 3
Growth 5
Razors 10

+ 14
- 0
maps/horock1.map View File

@@ -0,0 +1,14 @@
#####L######
#....R....A#
#..........#
#\. #@\ ..#
#\...#* ###
#\.........#
#\..*.@....#
####@@. ..#
#....#.. ###
#....#..**.#
#.1..# .\\#
############

Trampoline A targets 1

+ 13
- 0
maps/horock2.map View File

@@ -0,0 +1,13 @@
#################
#A .@@@@@@#
# .. #*...*1#
# .##########*##
# ..@ \\\\#* #
# ..# #####*.#
# .##### * #
#LR ....... . #
#################

Trampoline A targets 1
Flooding 10
Water 0

+ 16
- 0
maps/horock3.map View File

@@ -0,0 +1,16 @@
#################
# \\\\# * * #
# ## !!#..@. ####
#* @...####.....#
#\\ \@...........#
#\ # .\@ # #.########
#\ # ..\@ # .. #
#\ # .. \@ # .. #
#\ # *.. \@ ####### #
#\ # ### \@ # #W #
### # \@ # ##L#
#...#@@**@@**\@ #
#R ..........!\##
#################

Growth 25

BIN
specs/horocks.pdf View File


BIN
specs/images/horock.bmp View File


Loading…
Cancel
Save