Custom class with update method

I have level at the level of 100 monsters, everyone has their own logic
I need to create class with monster logic with update method
because I will have to describe the monster logic in one main method

something like this

/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package tests;

import com.jme3.scene.Spatial;

/**
 *
 * @author ivan
 */
public class Monster {
    Spatial model;
    
    void Monster(){
        //constructor logic
    }
    
    public void update(float tpf){
        //moster logic
        //move to player
        //attack die
        //etc
    }
}

is it possible?

1 Like

Thanks