Add nutria monster
This commit is contained in:
parent
93f2c816a9
commit
39cafcde67
BIN
Assets/Sprites/monsters.png
(Stored with Git LFS)
BIN
Assets/Sprites/monsters.png
(Stored with Git LFS)
Binary file not shown.
|
@ -100,3 +100,151 @@ animations:
|
||||||
y: 10
|
y: 10
|
||||||
origin_x: 0
|
origin_x: 0
|
||||||
origin_y: 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
|
||||||
|
|
|
@ -293,8 +293,10 @@ export class AnimalEntity extends Entity {
|
||||||
turn() {
|
turn() {
|
||||||
this.isMonster = !this.isMonster
|
this.isMonster = !this.isMonster
|
||||||
if (this.isMonster) {
|
if (this.isMonster) {
|
||||||
if (this.def.name !== 'deer' && this.def.name !== 'turkey') {
|
if (this.def.name !== 'deer' && this.def.name !== 'turkey' && this.def.name !== 'nutria') {
|
||||||
this.sprite.setCtor(`${Math.random()>0.5?'deer':'turkey'}.monster.${this.sprite.setKey}.${this.sprite.subsetKey}.${this.sprite.frameIndex}`)
|
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 {
|
} else {
|
||||||
this.sprite.setCtor(`${this.sprite.spriteKey}.monster.${this.sprite.setKey}.${this.sprite.subsetKey}.${this.sprite.frameIndex}`)
|
this.sprite.setCtor(`${this.sprite.spriteKey}.monster.${this.sprite.setKey}.${this.sprite.subsetKey}.${this.sprite.frameIndex}`)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user