forked from noxious/client
npm update, fixed character animation bug (maybe)
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<Container v-if="props.character" :x="currentX" :y="currentY">
|
||||
<!-- Start chat bubble -->
|
||||
<!-- <RoundRectangle :origin-x="0.5" :origin-y="7.5" :fillColor="0xffffff" :width="194" :height="21" :radius="5" />-->
|
||||
<!-- <Text @create="createText" :text="`This is a chat message 🤯👋`" :origin-x="0.5" :origin-y="10.9" :style="{ fontSize: 13, fontFamily: 'Arial', color: '#000' }" />-->
|
||||
<RoundRectangle :origin-x="0.5" :origin-y="7.5" :fillColor="0xffffff" :width="194" :height="21" :radius="5" />
|
||||
<Text @create="createText" :text="`This is a chat message 🤯👋`" :origin-x="0.5" :origin-y="10.9" :style="{ fontSize: 13, fontFamily: 'Arial', color: '#000' }" />
|
||||
<!-- End chat bubble -->
|
||||
<Text @create="createText" :text="props.character.name" :origin-x="0.5" :origin-y="9" />
|
||||
<RoundRectangle :origin-x="0.5" :origin-y="18.5" :fillColor="0xffffff" :width="74" :height="6" :radius="5" />
|
||||
@ -56,16 +56,16 @@ const updatePosition = (x: number, y: number) => {
|
||||
/**
|
||||
* Teleport: No animation, only if the distance is greater than the tile size / 1.5
|
||||
*/
|
||||
// if (distance >= config.tile_size.x / 1.5) {
|
||||
// // Teleport: No animation
|
||||
// currentX.value = targetX
|
||||
// currentY.value = targetY
|
||||
// }
|
||||
if (distance >= config.tile_size.x / 1.2) {
|
||||
// Teleport: No animation
|
||||
currentX.value = targetX
|
||||
currentY.value = targetY
|
||||
}
|
||||
|
||||
/**
|
||||
* Normal movement: Animate
|
||||
*/
|
||||
if (distance <= config.tile_size.x / 1.5) {
|
||||
if (distance <= config.tile_size.x / 1.2) {
|
||||
// Normal movement: Animate
|
||||
const duration = distance * 6 // Adjust this multiplier to control overall speed
|
||||
|
||||
|
Reference in New Issue
Block a user