added entitys, enemys, bats and custom attack hitboxes for players
added map loading and one-way collision (needs to move to tiled attribute tho) Signed-off-by: Pascal Syma <pascal@syma.dev>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (c) 2020. Pascal Syma <pascal@syma.dev>
|
||||
* All rights reserved.
|
||||
*/
|
||||
|
||||
import Hitbox from "./Hitbox";
|
||||
|
||||
export default class AttackA extends Hitbox {
|
||||
|
||||
constructor(player) {
|
||||
super(player, 5);
|
||||
|
||||
this.body.setSize(42, 32, true);
|
||||
this.body.setOffset(1, -10);
|
||||
}
|
||||
|
||||
start() {
|
||||
this.setData('active', true);
|
||||
this.player.play('attack_a', true)
|
||||
.once('animationcomplete', () => {
|
||||
this.setData('active', false)
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user