TGViewer
Moth Moth @namlessmoth · 44 subscribers
Post #101 67
Сделал возможность оседлать ворону и управлять её полётом
Седлается она автоматически когда прыгаешь на неё сверху, а чтобы слезть нужно провести любую атаку
Для этого я изменил контроллер моли:

import crownComp from "./crownComp.js"

export default function controllerComp(joystick) {
let crown = null

return {
id: "controllerComp",
require: ["pos"],
attackSpeed: 1000,
defaultSpeed: 200,
speed: 200,
onCrown: false,

add() {

this.onGround(() => {
if (this.curPlatform() != null &&
this.curPlatform().is("crown") &&
!this.curPlatform().isDead) {
crown = this.curPlatform()
this.pos.x = crown.pos.x
crown.unuse("crownComp")
this.onCrown = true
}
})

this.onFall(() => {
this.onCrown = false
if (crown != null && !crown.isDead
&& !crown.is("crownComp")) {
debug.log(crown.isDead)
crown.use(crownComp(this))
}

})

joystick.on("action", () => {
this.onCrown = false
if (crown != null && !crown.isDead
&& !crown.is("crownComp")) {
debug.log(crown.isDead)
crown.use(crownComp(this))
}

})
},
update() {
if (this.onCrown) {
crown.move(joystick.direction.scale(this.speed*1.5))
crown.flipX = this.flipX
this.pos.x = crown.pos.x
}
else {
this.move(joystick.direction.scale(this.speed))
}


if (joystick.direction.x)
this.flipX = joystick.direction.x < 0

},
}
}
  • ❤ 2
More from @namlessmoth
  1. Mar 7, 2026Как сломать босса одним прокачанным навыком Причём первую заратану я победил точно так же,…
  2. Mar 3, 2026Наиграл уже 150+ часов и даже не прошел половину игры Мне капец как не везёт почти в каждо…
  3. Feb 17, 2026Один месяц подписки на впн Вдруг кому надо https://t.me/gruVPNbot?start=g_UZhunlWNfFC_2127…
  4. Feb 16, 2026оставлю тут, чтобы не потерять вам смотреть нельзя, это только для меня
  5. Feb 13, 2026Вчера сделал всего три задания и все три оказались не правильными 1) Задание: Проведите ре…
  6. Feb 12, 2026Оказалось что всё-таки можно сдавать несколько заданий за один раз. Я вчера сдал 7 заданий…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →