Commit 43a029ce authored by Yannick Armand's avatar Yannick Armand

Simplification de l'affichage des miniatures des armes (2)

parent af302b3a
import Game from '../Game'
import Point from '../Point'
import { drawImageByIndex } from '../Util'
import WeaponName from './WeaponName'
const MINIATURE_SIZE = 16
export default abstract class Weapon {
private game: Game
......@@ -47,12 +50,10 @@ export default abstract class Weapon {
if (this.miniatureIndex === null)
return
const MINIATURE_SIZE = 16
const img = this.getGame().getImageManager().getImage('weapons-miniatures')
const index = this.miniatureIndex
ctx.drawImage(img, index * MINIATURE_SIZE, 0, 16, 16, 0, 0, 16, 16)
drawImageByIndex(ctx, img, 0, 0, index, MINIATURE_SIZE, MINIATURE_SIZE)
}
public abstract getType(): WeaponName
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment