Skip to content

Commit e200aee

Browse files
authored
Merge pull request #273 from chrahunt/add-new-powerups
Add new powerups
2 parents f2ddd49 + e335435 commit e200aee

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

src/js/modules/renderer.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -780,9 +780,13 @@ function drawFloorTiles(positions, showPreviews) {
780780
x = tile_spec.emptyCoordinates.x;
781781
y = tile_spec.emptyCoordinates.y;
782782
} else {
783-
trackPreviewState(positions, floor_tile);
784-
let coordinates = floor_tile.previewState.isEmpty ? tile_spec.emptyCoordinates
785-
: tile_spec.coordinates;
783+
let coordinates = tile_spec.coordinates
784+
if (tile_spec.blinking) {
785+
trackPreviewState(positions, floor_tile);
786+
if (floor_tile.previewState.isEmpty) {
787+
coordinates = tile_spec.emptyCoordinates;
788+
}
789+
}
786790
x = coordinates.x;
787791
y = coordinates.y;
788792
context.globalAlpha = 0.5;

src/js/modules/tiles.js

+12-4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ exports.mapElements = {
5252
6.21: {tile: "emptypowerup", coordinates: {x: 13, y: 4}, tileSize: 40, drawTileFirst: false},
5353
6.31: {tile: "emptypowerup", coordinates: {x: 13, y: 4}, tileSize: 40, drawTileFirst: false},
5454
6.41: {tile: "emptypowerup", coordinates: {x: 13, y: 4}, tileSize: 40, drawTileFirst: false},
55+
6.12: {tile: "emptypowerup", coordinates: {x: 13, y: 4}, tileSize: 40, drawTileFirst: false},
56+
6.22: {tile: "emptypowerup", coordinates: {x: 13, y: 4}, tileSize: 40, drawTileFirst: false},
57+
6.32: {tile: "emptypowerup", coordinates: {x: 13, y: 4}, tileSize: 40, drawTileFirst: false},
58+
6.42: {tile: "emptypowerup", coordinates: {x: 13, y: 4}, tileSize: 40, drawTileFirst: false},
5559
7: {tile: "spike", coordinates: {x: 12, y: 0}, tileSize: 40, drawTileFirst: true},
5660
8: {tile: "button", coordinates: {x: 13, y: 6}, tileSize: 40, drawTileFirst: true},
5761
9: {tile: "gate", coordinates: {x: 12, y: 3}, tileSize: 40, drawTileFirst: false},
@@ -99,10 +103,14 @@ exports.floor_tiles = {
99103
6.2: {tile: "rollingbomb", coordinates: {x: 12, y: 5}, tileSize: 40, img: "tiles"},
100104
6.3: {tile: "tagpro", coordinates: {x: 12, y: 6}, tileSize: 40, img: "tiles"},
101105
6.4: {tile: "speed", coordinates: {x: 12, y: 7}, tileSize: 40, img: "tiles"},
102-
6.11: {tile: "previewjukejuice", coordinates: {x: 12, y: 4}, tileSize: 40, img: "tiles", preview: true, emptyCoordinates: {x: 12, y: 8}},
103-
6.21: {tile: "previewrollingbomb", coordinates: {x: 12, y: 5}, tileSize: 40, img: "tiles", preview: true, emptyCoordinates: {x: 12, y: 8}},
104-
6.31: {tile: "previewtagpro", coordinates: {x: 12, y: 6}, tileSize: 40, img: "tiles", preview: true, emptyCoordinates: {x: 12, y: 8}},
105-
6.41: {tile: "previewspeed", coordinates: {x: 12, y: 7}, tileSize: 40, img: "tiles", preview: true, emptyCoordinates: {x: 12, y: 8}},
106+
6.11: {tile: "previewjukejuice", coordinates: {x: 12, y: 4}, tileSize: 40, img: "tiles", preview: true, blinking: true, emptyCoordinates: {x: 12, y: 8}},
107+
6.21: {tile: "previewrollingbomb", coordinates: {x: 12, y: 5}, tileSize: 40, img: "tiles", preview: true, blinking: true, emptyCoordinates: {x: 12, y: 8}},
108+
6.31: {tile: "previewtagpro", coordinates: {x: 12, y: 6}, tileSize: 40, img: "tiles", preview: true, blinking: true, emptyCoordinates: {x: 12, y: 8}},
109+
6.41: {tile: "previewspeed", coordinates: {x: 12, y: 7}, tileSize: 40, img: "tiles", preview: true, blinking: true, emptyCoordinates: {x: 12, y: 8}},
110+
6.12: {tile: "previewjukejuice2", coordinates: {x: 12, y: 4}, tileSize: 40, img: "tiles", preview: true, emptyCoordinates: {x: 12, y: 8}},
111+
6.22: {tile: "previewrollingbomb2", coordinates: {x: 12, y: 5}, tileSize: 40, img: "tiles", preview: true, emptyCoordinates: {x: 12, y: 8}},
112+
6.32: {tile: "previewtagpro2", coordinates: {x: 12, y: 6}, tileSize: 40, img: "tiles", preview: true, emptyCoordinates: {x: 12, y: 8}},
113+
6.42: {tile: "previewspeed2", coordinates: {x: 12, y: 7}, tileSize: 40, img: "tiles", preview: true, emptyCoordinates: {x: 12, y: 8}},
106114
9: {tile: "gate", coordinates: {x: 12, y: 3}, tileSize: 40, img: "tiles"},
107115
9.1: {tile: "greengate", coordinates: {x: 13, y: 3}, tileSize: 40, img: "tiles"},
108116
9.2: {tile: "redgate", coordinates: {x: 14, y: 3}, tileSize: 40, img: "tiles"},

0 commit comments

Comments
 (0)