🤑 Indie game store🙌 Free games😂 Fun games😨 Horror games
👷 Game development🎨 Assets📚 Comics
🎉 Sales🎁 Bundles

Set Parent Behavior?

A topic by Shadowblitz16 created 1 year ago Views: 189 Replies: 1
Viewing posts 1 to 2

is it possible to inherit code from a behavior?

I tried setting "class PlayerBehavior extends EntityBehavior"

but the code doesn't run

It would be cool to see some sort of help tab in superpowers that shows anwsers to categories of questions

Yes it's possible but personally I encounter few problems, sometimes it works, sometimes not.

Uncaught TypeError: Cannot read property 'prototype' of undefined

PS : Don't forget to call super methods if you use them.

class A extends Sup.behavior {
  awake() {
    Sup.log("Awake from A");
class B extends A { awake() { super.awake(); Sup.log("Awake from B"); } start() { Sup.log("Start from B"); }