Simplified expressions

This commit is contained in:
Taizo 'Tsa6' Simpson 2017-08-22 12:37:19 -04:00
parent af7dcd70c8
commit 292afea46b
1 changed files with 3 additions and 3 deletions

View File

@ -1035,9 +1035,9 @@ window.onload = function () {
for (let i in Game.enemies) {
let margin = .25 //A ratio of the width of a tile. .25 margins with 32 px tiles leave a 8 px margin on all sides, with the body being 16px x 16px
let enemy = Game.enemies[i]
let rx = (enemy.x + mt) + mt * margin
let ry = (enemy.y * mt) + mt * margin
let w = mt - (mt * margin * 2)
let rx = (enemy.x + margin) * mt
let ry = (enemy.y + margin) * mt
let w = mt * (1 - margin * 2)
ctx.fillStyle = enemy.icon
ctx.fillRect(rx, ry, w, w)