started working on character animations (WIP)
BIN
public/assets/avatar/default/0.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
public/assets/avatar/default/1.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
public/assets/avatar/default/2.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
public/assets/avatar/default/3.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
public/assets/avatar/default/4.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
public/assets/avatar/default/anim.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 1.9 KiB |
BIN
public/assets/avatar/default/yeet.png
Normal file
After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 372 B |
@ -28,7 +28,7 @@ function onPointerMove(pointer: Phaser.Input.Pointer) {
|
|||||||
// Convert tile coordinates to world coordinates
|
// Convert tile coordinates to world coordinates
|
||||||
const worldPoint = props.layer.tileToWorldXY(pointer_tile.value.x, pointer_tile.value.y)
|
const worldPoint = props.layer.tileToWorldXY(pointer_tile.value.x, pointer_tile.value.y)
|
||||||
waypoint.value.x = worldPoint.x + config.tile_size.y
|
waypoint.value.x = worldPoint.x + config.tile_size.y
|
||||||
waypoint.value.y = worldPoint.y + config.tile_size.y
|
waypoint.value.y = worldPoint.y + config.tile_size.y + 15
|
||||||
} else {
|
} else {
|
||||||
waypoint.value.visible = false
|
waypoint.value.visible = false
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div class="sprite-container">
|
<div class="sprite-container">
|
||||||
<img draggable="false" src="/assets/avatar/default/base_right_down.png" />
|
<img draggable="false" src="/assets/avatar/default/0.png" />
|
||||||
</div>
|
</div>
|
||||||
<span>Lvl. {{ character.level }}</span>
|
<span>Lvl. {{ character.level }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -45,6 +45,8 @@ onMounted(() => {
|
|||||||
function setupSelf()
|
function setupSelf()
|
||||||
{
|
{
|
||||||
scene.input.on(Phaser.Input.Events.POINTER_UP, onPointerClick)
|
scene.input.on(Phaser.Input.Events.POINTER_UP, onPointerClick)
|
||||||
|
}
|
||||||
|
|
||||||
function onPointerClick(pointer: Phaser.Input.Pointer) {
|
function onPointerClick(pointer: Phaser.Input.Pointer) {
|
||||||
if (!isSelf) return;
|
if (!isSelf) return;
|
||||||
|
|
||||||
@ -76,5 +78,19 @@ function setupSelf()
|
|||||||
if (!tile) return undefined;
|
if (!tile) return undefined;
|
||||||
return tile
|
return tile
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
scene.anims.create({
|
||||||
|
key: 'walk',
|
||||||
|
frames: scene.anims.generateFrameNumbers('walk', {
|
||||||
|
start: 0,
|
||||||
|
end: 4
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resources:
|
||||||
|
* https://www.youtube.com/watch?v=9sWrGohw9qo
|
||||||
|
* https://jsfiddle.net/juwalbose/pu0gt7nc/
|
||||||
|
*
|
||||||
|
*/
|
||||||
</script>
|
</script>
|
||||||
|