Class Abilities

java.lang.Object
com.codename1.gaming.platformer.Abilities

public final class Abilities extends Object
Creates the stock abilities by name, as level files, power-ups and the editor refer to them.
  • Method Details

    • heroOrder

      public static String[] heroOrder()

      Every stock ability name, in a sensible processing order for a hero.

      Returns

      a new array

    • create

      public static Ability create(String name, int tileSize)

      Creates an ability.

      Parameters
      • name: move, jump, crouch, ladder, walljump, dash, jetpack, glide, swim, fly, look, weapon, sword or grip
      • tileSize: the level's tile size, fixed point, for size-relative tuning
      Returns

      the ability, or null for an unknown name

    • typeOf

      public static Class<? extends Ability> typeOf(String name)

      The class of the ability a name creates, for Actor#getAbility.

      Parameters
      • name: an ability name
      Returns

      the class, or null