Add nutria monster

This commit is contained in:
Ketchetwahmeegwun T. Southall 2022-01-30 16:50:46 -08:00
parent 93f2c816a9
commit 39cafcde67
3 changed files with 154 additions and 4 deletions

BIN
Assets/Sprites/monsters.png (Stored with Git LFS)

Binary file not shown.

View File

@ -100,3 +100,151 @@ animations:
y: 10
origin_x: 0
origin_y: 0
monster:
sets:
attack:
subsets:
north:
frames:
- x: 75
y: 600
width: 75
height: 75
- x: 150
y: 600
width: 75
height: 75
east:
frames:
- x: 75
y: 825
width: 75
height: 75
- x: 150
y: 825
width: 75
height: 75
west:
frames:
- x: 75
y: 675
width: 75
height: 75
- x: 150
y: 675
width: 75
height: 75
south:
frames:
- x: 75
y: 750
width: 75
height: 75
- x: 150
y: 750
width: 75
height: 75
run:
subsets:
north:
frames:
- x: 225
y: 600
width: 75
height: 75
- x: 300
y: 600
width: 75
height: 75
- x: 375
y: 600
width: 75
height: 75
- x: 450
y: 600
width: 75
height: 75
east:
frames:
- x: 225
y: 825
width: 75
height: 75
- x: 300
y: 825
width: 75
height: 75
- x: 375
y: 825
width: 75
height: 75
- x: 450
y: 825
width: 75
height: 75
west:
frames:
- x: 225
y: 675
width: 75
height: 75
- x: 300
y: 675
width: 75
height: 75
- x: 375
y: 675
width: 75
height: 75
- x: 450
y: 675
width: 75
height: 75
south:
frames:
- x: 225
y: 750
width: 75
height: 75
- x: 300
y: 750
width: 75
height: 75
- x: 375
y: 750
width: 75
height: 75
- x: 450
y: 750
width: 75
height: 75
stand:
subsets:
north:
frames:
- x: 0
y: 600
width: 75
height: 75
east:
frames:
- x: 0
y: 825
width: 75
height: 75
south:
frames:
- x: 0
y: 750
width: 75
height: 75
west:
frames:
- x: 0
y: 675
width: 75
height: 75
time: 180
source: monsters.png
origin_x: 37
origin_y: 48

View File

@ -293,8 +293,10 @@ export class AnimalEntity extends Entity {
turn() {
this.isMonster = !this.isMonster
if (this.isMonster) {
if (this.def.name !== 'deer' && this.def.name !== 'turkey') {
this.sprite.setCtor(`${Math.random()>0.5?'deer':'turkey'}.monster.${this.sprite.setKey}.${this.sprite.subsetKey}.${this.sprite.frameIndex}`)
if (this.def.name !== 'deer' && this.def.name !== 'turkey' && this.def.name !== 'nutria') {
let keys = ['deer', 'turkey', 'nutria']
let v = 1 + Math.floor(Math.random()*3)
this.sprite.setCtor(`${keys[v]}.monster.${this.sprite.setKey}.${this.sprite.subsetKey}.${this.sprite.frameIndex}`)
} else {
this.sprite.setCtor(`${this.sprite.spriteKey}.monster.${this.sprite.setKey}.${this.sprite.subsetKey}.${this.sprite.frameIndex}`)
}