How to create an ability #741
Replies: 2 comments
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). public void punsh() {
new KangarooPunsh(this);
System.out.println("called");
} You are just calling the constructor of a new ability which is in your example unnecessary because you already created an instance in the constructor. public void punsh() {
this.punsh.cast();
} Also, see https://litiengine.com/api/de/gurkenlabs/litiengine/abilities/Ability/#cast() for "a few lines of documentation". |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022). |
Beta Was this translation helpful? Give feedback.
-
This post has been migrated automatically from the old LITIENGINE forum (2018 - 2022).
Posted: 2021-01-20 12:57:52
User: Trowl3r [] (age: 655 days 🙌; posts: 2)
Hello everyone,
I am creating a 2D Sidesrollerer for a school project. Short Summary: it's basically a mix of super mario bros and banjo and kazooie with a kangaroo and a ostrich. I want to do a punch effect for the kangaroo, to box enemys. I dont really know how to do it with abilitys.
My Code:
Kangaroo.java:
private static Kangaroo instance;
KangarooPunch.java:
I need help fast. thanks for the help.
Beta Was this translation helpful? Give feedback.
All reactions