migration – Passed variable is not an array or object

Trying to migrate images by copying them from an external source:

id: custom_news_migration_with_external_images_1
label: custom news migration with external images importer
source:
  plugin: embedded_data
  ids:
    id:
      type: integer
  constants: file_destination: /home/ip/c921/web/sites/default/files/images #absolute path ... default 'public://images'
process:
  nid: id
  title: title
  field_news_image:
    plugin: image_import
    source: file
    destination: 'constants/file_destination'
    title: file_title
    alt: title
destination:
  plugin: entity:node
  default_bundle: news 

The error I continually get in the console is:

(error) … Passed variable is not an array or object in /home/ip/c921/web/core/modules/migrate/src/Plugin/migrate/source/EmbeddedDataSource.php Zeile 96

Code snippet:

     92   /**
     93    * {@inheritdoc}
     94    */
     95   public function initializeIterator() {
     96     return new ArrayIterator($this->dataRows);
     97   }

Forgot to mention that the drupal.org example has data_rows entries:


  data_rows:
    -
      id: 1
      title: 'Page 1 title'
      file: 'https://www.drupal.org/files/druplicon-small.png'
      file_title: 'Druplicon logo'  
    -
      id: 2
      title: 'Page 2 title'
      file: 'https://www.drupal.org/files/drupal_logo-blue.png'
      file_title: 'Drupal logo'

I didn’t use them. Because I want to migrate thousends of images.

The basic example is from drupal.org

Help would be great.

ag.algebraic geometry – About condition for structure sheaf of a scheme being compact object in a category of sheaf of module over X

I found the condition for one direction :
Categorical interpretation of quasi-compact quasi-separated schemes

This article said that if $X$ is quasi compact and quasi separated, $mathscr{O}_X$ is a compact object in $Qcoh(X)$. A comment said that if the structure sheaf is compact( the global section functor preserves a colimit in $Qcoh(X)$), then $X$ is quasi compact.

Is there any result about quasi-separatedness?

database design – How to convert array objects with object ids as one of key value pair to string?

I have the following JSON,
How to convert an array of objects with object ids to string in MongoDB using aggregation query?

{
"_id": ObjectId("60e41eb7335412757cc6cb9a"),
"items": (
    {
        "_id": ObjectId("60e4566a461e7a2cf9de14be"),
        "buyers": (
            ObjectId("60e4566a461e7a2cf9de14be"), 
            ObjectId("60e4566a461e7a2cf9de14be"), 
            ObjectId("60e4566a461e7a2cf9de14be")
        ),
        "sellers": (
            ObjectId("60e4566a461e7a2cf9de14be"),
            ObjectId("60e4566a461e7a2cf9de14be")
        ),
        "description": "tes product 5 Lorem ipsum dolor sit, consectetur",
        "owner": ObjectId("60d8c31af30fe429ffab1dc2"),
        "product": ObjectId("60d49fa36a232668ded042cf"),
        "createdAt": ISODate("2021-07-06T13:11:06.818Z"),
        "updatedAt": ISODate("2021-07-06T13:11:06.818Z"),
        "createdBy": {
            "_id": ObjectId("5eeaf3aead7cef7f1958f284"),
            "name": "John Doe",
            "createdAt": ISODate("2020-06-18T04:55:10.869Z"),
            "updatedAt": ISODate("2021-07-26T08:17:33.934Z"),
            "__v": 0,
            "isAdmin": true,
            "dkeys": ( 
                ObjectId("5f754b501b8d9c3e998727fd")
            ),
            "tries": ( 
                ObjectId("60e8524ab63c35635d84cce6")
            )
        },
        "__v": 0
    },
    {
        "_id": ObjectId("60e4566a461e7a2cf9de14be"),
        "buyers": (ObjectId("60e4566a461e7a2cf9de14be"), ObjectId("60e4566a461e7a2cf9de14be"), ObjectId("60e4566a461e7a2cf9de14be")
        ),
        "sellers": (ObjectId("60e4566a461e7a2cf9de14be"),ObjectId("60e4566a461e7a2cf9de14be")
        ),
        "description": "tes product 5 Lorem ipsum dolor sit, consectetur",
        "owner": ObjectId("60d8c31af30fe429ffab1dc2"),
        "product": ObjectId("60d49fa36a232668ded042cf"),
        "createdAt": ISODate("2021-07-06T13:11:06.818Z"),
        "updatedAt": ISODate("2021-07-06T13:11:06.818Z"),
        "createdBy": {
            "_id": ObjectId("5eeaf3aead7cef7f1958f284"),
            "name": "John Doe",
            "createdAt": ISODate("2020-06-18T04:55:10.869Z"),
            "updatedAt": ISODate("2021-07-26T08:17:33.934Z"),
            "__v": 0,
            "isAdmin": true,
            "dkeys": ( 
                ObjectId("5f754b501b8d9c3e998727fd")
            ),
            "tries": ( 
                ObjectId("60e8524ab63c35635d84cce6")
            )
        },
        "__v": 0
    },
),
"isActive": true,
"ranges": ( 
    ObjectId("5edf2a8dfdbe5ad362a0b0d9"), 
    ObjectId"5edf2a8dfdbe5ad362a0b0d9")
),
"buyers": (ObjectId("60e4566a461e7a2cf9de14be"), ObjectId("60e4566a461e7a2cf9de14be"), ObjectId("60e4566a461e7a2cf9de14be")
),
"sellers": (ObjectId("60e4566a461e7a2cf9de14be"),ObjectId("60e4566a461e7a2cf9de14be")
),
"description": "tes comment 3 Lorem ipsum dolor sit, consectetur",
"updatedBy": ObjectId("5eeaf3aead7cef7f1958f284"),
"author": {
    "_id": ObjectId("60d8c31af30fe429ffab1dc2"),
    "raids": ( 
        ObjectId("5edf2a8dfdbe5ad362a0b0d9")
    ),
    "isActive": true,
    "feedbacks": ( 
        ObjectId("60dd8dd8ff27c726140c825e"), 
        ObjectId("60dd931f68d36823c8df2bfc"), 
        ObjectId("60e3cda61b26fb21e83aaae8"), 
        ObjectId("60e4025b9118a25bc322b698"), 
        ObjectId("60e410354c0f6c1d3c9390a0"), 
        ObjectId("60e41e8a335412757cc6cb8f"), 
        ObjectId("60e41eb7335412757cc6cb9a"), 
        ObjectId("60e449c9568c155565db6356"), 
        ObjectId("60e44a836b18f555ad10b557"), 
        ObjectId("60e45348bce3bb3f90c94081"), 
        ObjectId("60e4547810f0233cf86010b1"), 
        ObjectId("60e45691461e7a2cf9de1785"), 
        ObjectId("60e4569a461e7a2cf9de178e")
    ),
    "description": "product bought",
    "type": "text",
    "updatedBy": ObjectId("5eeaf3aead7cef7f1958f284"),
    "createdBy": ObjectId("5eeaf3aead7cef7f1958f284"),
    "createdAt": ISODate("2021-06-27T18:27:38.609Z"),
    "updatedAt": ISODate("2021-07-22T13:27:47.677Z"),
    "__v": 0,
    "items_feedbacks": (
        {
            "_id": ObjectId("60e4348685b26f31e8fc53af"),
            "code": "003",
            "message": "test msg for bad image",
            "createdBy": ObjectId("5eeaf3aead7cef7f1958f284")
        },
        {
            "_id": ObjectId("60e4348b85b26f31e8fc53b1"),
            "code": "003",
            "message": "test msg for bad image",
            "createdBy": ObjectId("5eeaf3aead7cef7f1958f284")
        },
        {
            "_id": ObjectId("60e4348d85b26f31e8fc53b4"),
            "code": "003",
            "message": "test msg for bad image",
            "createdBy": ObjectId("5eeaf3aead7cef7f1958f284")
        },
        {
            "_id": ObjectId("60e434d1491c363a304baf29"),
            "code": "003",
            "message": "test msg for bad image",
            "createdBy": ObjectId("5eeaf3aead7cef7f1958f284")
        },
        {
            "_id": ObjectId("60e434f91eb3f62874892b97"),
            "code": "003",
            "message": "test msg for bad image",
            "createdBy": ObjectId("5eeaf3aead7cef7f1958f284")
        }
    )
},
"product": {
    "_id": ObjectId("60d49fa36a232668ded042cf"),
    "p_items": ( 
        ObjectId("60d4a1246a232668ded042d1"), 
        ObjectId("60d4a1aa6a232668ded042d3"), 
        ObjectId("60d4a1fb6a232668ded042d5"), 
        ObjectId("60d711a238b57d30ba384c2a"), 
        ObjectId("60d963ff38b57d30ba384d6a"), 
        ObjectId("60d9890567e5746355e30785"), 
        ObjectId("60d9890b67e5746355e30789"), 
        ObjectId("60d9d159c3c0f732200f48af"), 
        ObjectId("60d9d1bec3c0f732200f48b1"), 
        ObjectId("60dab30a5fe325044c6f2828"), 
        ObjectId("60dab8675fe325044c6f2be1"), 
        ObjectId("60dabd985fe325044c6f2c25"), 
        ObjectId("60dabdbd5fe325044c6f2c29"), 
        ObjectId("60daca035fe325044c6f2d61"), 
        ObjectId("60daca0d5fe325044c6f2d65"), 
        ObjectId("60dacb7c5fe325044c6f2d6a"), 
        ObjectId("60dacc3b5fe325044c6f2d78"), 
        ObjectId("60dacfbb5fe325044c6f2d7f"), 
        ObjectId("60dad1395fe325044c6f2d86"), 
        ObjectId("60dad1995fe325044c6f2d90"), 
        ObjectId("60dad2b05fe325044c6f2db2"), 
        ObjectId("60dad50a5fe325044c6f2dc3"), 
        ObjectId("60dad55b5fe325044c6f2dc7"), 
        ObjectId("60dad5605fe325044c6f2dcb"), 
        ObjectId("60dad9325fe325044c6f2e90"), 
        ObjectId("60dae48b5fe325044c6f2f0a"), 
        ObjectId("60dae4b25fe325044c6f2f0c"), 
        ObjectId("60dae6655fe325044c6f2f10"), 
        ObjectId("60dae7bc0aa85a0bcdd1c2ab"), 
        ObjectId("60daeb3795c4020de8e4e1db"), 
        ObjectId("60daed005fe325044c6f2f1a"), 
        ObjectId("60daf1f35fe325044c6f3003"), 
        ObjectId("60daf2135fe325044c6f3007"), 
        ObjectId("60dafbcfa5790f56c638123c"), 
        ObjectId("60dafc64a5790f56c638123e"), 
        ObjectId("60dafcbea5790f56c6381240"), 
        ObjectId("60daff1fa5790f56c63812b3"), 
        ObjectId("60daffcb5aa2575ea6954e9e"), 
        ObjectId("60db01c00926b06046aa66de"), 
        ObjectId("60db01f50926b06046aa6756"), 
        ObjectId("60db2257609cc501b5f153ca"), 
        ObjectId("60db23f5609cc501b5f153cc"), 
        ObjectId("60db27d4de26e128bc6e430f"), 
        ObjectId("60db2fd8609cc501b5f15420"), 
        ObjectId("60db3276609cc501b5f15422"), 
        ObjectId("60db32a5609cc501b5f15424"), 
        ObjectId("60db32e1609cc501b5f15426"), 
        ObjectId("60db34da7e091a14da2869da"), 
        ObjectId("60db35017e091a14da2869df"), 
        ObjectId("60db35427e091a14da2869e4"), 
        ObjectId("60db35c87e091a14da2869ec"), 
        ObjectId("60db35ea7e091a14da286a84"), 
        ObjectId("60db3ae38810c91ad88b270d"), 
        ObjectId("60db3b4c8810c91ad88b270f"), 
        ObjectId("60db3b638810c91ad88b2711"), 
        ObjectId("60db3b848810c91ad88b2713"), 
        ObjectId("60db3cee8810c91ad88b2715"), 
        ObjectId("60db45758810c91ad88b2719"), 
        ObjectId("60db47798810c91ad88b271e"), 
        ObjectId("60db499d8810c91ad88b2725"), 
        ObjectId("60db4b828810c91ad88b272d"), 
        ObjectId("60db4bc08810c91ad88b2731"), 
        ObjectId("60db4c548810c91ad88b273f"), 
        ObjectId("60db50b08810c91ad88b2768"), 
        ObjectId("60dbef2b2927e20a5bd3ec5a"), 
        ObjectId("60dbef3d2927e20a5bd3ec60"), 
        ObjectId("60dbef452927e20a5bd3ec62"), 
        ObjectId("60dbf6042927e20a5bd3ec8c"), 
        ObjectId("60dbf6512927e20a5bd3ec8e"), 
        ObjectId("60dbfa1184dea73932b287a3"), 
        ObjectId("60dbfec12927e20a5bd3ece1"), 
        ObjectId("60dbfecd2927e20a5bd3ece7"), 
        ObjectId("60dbfed12927e20a5bd3ece9"), 
        ObjectId("60dbff912927e20a5bd3ecfd"), 
        ObjectId("60dc102d1e4d7b4a5296b06f"), 
        ObjectId("60dc51fa5564910f5c4bce1b"), 
        ObjectId("60dc67da5564910f5c4bfd8b"), 
        ObjectId("60dc684f5564910f5c4bfda7"), 
        ObjectId("60dc6fe75564910f5c4bfe09"), 
        ObjectId("60deb9b2dd5a28183c0e09be"), 
        ObjectId("60debc1edeae6f08944c3f1a"), 
        ObjectId("60def6af5233ef1fd00ee27d"), 
        ObjectId("60defa8fcae30f20dc0de723"), 
        ObjectId("60defac2cae30f20dc0de725"), 
        ObjectId("60defec720c27e57968ad568"), 
        ObjectId("60e2b223f2fa9a3b501a9d7b"), 
        ObjectId("60e2bb9e2dda722f40fe3580"), 
        ObjectId("60e2bc1442f57f24c4b04b88"), 
        ObjectId("60e2bc6cfbb27e3e6cba77bc"), 
        ObjectId("60e2c10bfbb27e3e6cba77c6"), 
        ObjectId("60e44aa66b18f555ad10b55f"), 
        ObjectId("60e44ad9cc482755d5814d7d"), 
        ObjectId("60f687bcc414a59d5a78d084"), 
        ObjectId("60f6895ff18f489dd8050325"), 
        ObjectId("60f68b20fd344e9e4aadb47a"), 
        ObjectId("60fe6f9d89a99c32484061dd")
    ),
    "updatedBy": ObjectId("5eeaf3aead7cef7f1958f284"),
    "createdAt": ISODate("2021-06-24T15:07:15.977Z"),
    "updatedAt": ISODate("2021-07-26T08:17:33.500Z"),
    "createdBy": ObjectId("5eeaf3aead7cef7f1958f284"),
    "__v": 0
}}

computer vision – Number of pixels on an object and minimum size to identify an object

I want to find out how many pixels will cover a specific object in an image at a set distance.

My plan is to use the known objects height and distance to calculate the angle it subtends from the optical axis – on both axes.

Then assuming a pinhole model I will use the lenses focal point and the angle to find the height of the object’s image on the sensor.

I would then divide that by the pitch of the sensors pixels to find the number of pixels covering the object – rounding where necessary.

My questions are:

  1. is this a reasonable way to calculate the number of pixels?
  2. Does the pinhole model assumption break down for wide angle lenses?
  3. And, what is accepted as the minimum number of pixels to identify something?

How should a Game object be used correctly?

Is it better to show game objects in a scene by using them in a script, or is it better to create them in a scane and use them in a script? (for Unity)

Will there be performance differences between these two when using multiple Game Object ?

oracle11g – PLSQL : Return Concatenated string of all attributes of a Object

--Declare Object
create or replace TYPE INP_OBJ AS OBJECT 
(    attribute_1    VARCHAR2(20 CHAR)
    ,attribute_2    VARCHAR2(20 CHAR)
);

--Create Package
CREATE OR REPLACE PACKAGE TEST AS 
  PROCEDURE PROC1 (l_inp_obj  IN  INP_OBJ) ;
END TEST;

--Create Package Body
create or replace PACKAGE BODY TEST AS
    PROCEDURE PROC1 (l_inp_obj IN INP_OBJ) IS
    BEGIN    
        dbms_output.put_line(l_inp_obj.attribute_1 || ' ~ '|| l_inp_obj.attribute_2);

-- have to write every element individually here 
    END PROC1;
END TEST;


-- Calling Procedure 
DECLARE
  L_INP_OBJ CUSTOMER_ACCOUNT_DBO.INP_OBJ;
BEGIN
    L_INP_OBJ := (INP_OBJ('VALUE OF ATTR 1'
                         ,'VALUE OF ATTR 2'));
  TEST.PROC1(L_INP_OBJ => L_INP_OBJ);
END;

for display I had to write every attribute of input object individually. Is there a better way to return concatenated string of all values of Input Object ?

Android app java.lang.NullPointerException: Attempt to invoke virtual method ‘java.lang.String java.lang.Object.toString()’ on a null object reference

CheckOutFragment.java

public class CheckoutFragment extends Fragment {

ListView listSubCategory;
Spinner category, subCategory;
DatabaseHelper db;
protected Cursor cursor;
String() list;
String selectedFromCategory;
String() list2;

private CheckoutViewModel mViewModel;

public static CheckoutFragment newInstance() {
    return new CheckoutFragment();
}

@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
                         @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_checkout, container, false);

    category = view.findViewById(R.id.spinner1);
    subCategory = view.findViewById(R.id.spinner2);
    listSubCategory = view.findViewById(R.id.listsubcategory);
    db = new DatabaseHelper(getContext());


    SQLiteDatabase database = db.getReadableDatabase();
    cursor = database.rawQuery("SELECT * FROM category", null);
    list = new String(cursor.getCount());
    for (int i = 0; i < cursor.getCount(); i++) {
        cursor.moveToPosition(i);
        list(i) = cursor.getString(1).toString();
    }


    category.setAdapter(new ArrayAdapter<>(getContext(), android.R.layout.simple_spinner_dropdown_item, android.R.id.text1, list));

    category.setSelected(true);

    category.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
        @Override
        public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {


            SQLiteDatabase read = db.getReadableDatabase();
            SQLiteDatabase readID = db.getReadableDatabase();
            SQLiteDatabase read2 = db.getReadableDatabase();

            selectedFromCategory = category.getItemAtPosition(position).toString();


            Cursor get = read.rawQuery("SELECT * FROM category WHERE category_name =  '" +
                    selectedFromCategory + "'", null);

            get.moveToFirst();
            if (get.getCount() > 0) {
                get.moveToPosition(0);
                //get id from category
                String selected = get.getString(0);
                CategoryModel categoryModel = db.getCategory(Integer.parseInt(selected));
                String selectedCategory = categoryModel.getId();
                int selectedIdCategory = Integer.parseInt(selectedCategory);
                Cursor catId = readID.rawQuery("SELECT * FROM subcategory WHERE category_id = '" +
                        selectedIdCategory + "'", null);

                Cursor cr = read2.rawQuery("SELECT * FROM subcategory", null);
                list2 = new String(cr.getCount());

                catId.moveToFirst();
                for (int i = 0; i < catId.getCount(); i++) {
                    catId.moveToPosition(i);
                    list2(i) = catId.getString(3).toString();
                }

                listSubCategory.setAdapter(new ArrayAdapter(getContext(), android.R.layout.simple_list_item_1,list2));
            }

DatabaseHelper.java

    public CategoryModel getCategory(int id) {
    SQLiteDatabase db = this.getReadableDatabase();
    Cursor cursor = db.query(TABLE_5, new String(){COL5_1, COL5_2}, COL5_1 + " = ?", new String(){String.valueOf(id)}, null, null, null);
    if (cursor != null) {
        cursor.moveToFirst();
    }
    CategoryModel categoryModel = new CategoryModel(cursor.getString(0), cursor.getString(1));
    return categoryModel;
}

I already input all data and already check all rows and columns in the database so what I’m gonna do is filtering my listview based on what I select from my spinner but the error occurred. After that, I use this code with a custom adapter and the output is showing but I input 3 items only the output shows 3 items and 4 blank items. Sorry for my messy code, still new at programming.

magento2 – How can I access data of LaminasStdlibParameters Object in in Magento 2?

I want to access LaminasStdlibParameters Object data in that I
can access video_url data in magento2. How can I access that object data ?

$product = $this->getRequest()->getFiles();
print_r($product);

Using that I got this below object but I want to access video_url data.

LaminasStdlibParameters Object
(
    (storage:ArrayObject:private) => Array
        (
            (product) => Array
                (
                    (video_url) => Array
                        (
                            (name) => file_example_MP4_480_1_5MG.mp4
                            (type) => video/mp4
                            (tmp_name) => /tmp/phpb5ZS51
                            (error) => 0
                            (size) => 1570024
                        )

                )

        )

)

c# – Implement IDisposable correctly using object composition principle

Is it possible to implement IDisposable pattern correctly while using object composition principle to promote code-reuse, reduce code duplication and hide verbose “official” implementation?

Rational

Proposal

Delegate the dispose logic to a dedicated class:

public class DisposeManager
{
    public Action Managed { get; set; }
    public Action Unmanaged { get; set; }

    protected virtual void Dispose(bool disposing)
    {
        // only dispose once
        if (disposed)
            return;

        if (disposing)
        {
            Managed?.Invoke();
        }

        Unmanaged?.Invoke();

        disposed = true; 
    }

    public void DisposeObject(object o)
    {
        Dispose(disposing: true);
        GC.SuppressFinalize(o);
    }

    public void FinalizeObject()
    {
        Dispose(disposing: false);
    }

    private bool disposed;
}

Implement IDisposable in user class in the following way:

public class DisposeUser: IDisposable
{
    public DisposeManager DisposeManager { get; } = new DisposeManager();

    public DisposeUser()
    {
        // using lambda
        DisposeManager.Managed = () =>
        {
            // (...)
        };

        // or using member method
        DisposeManager.Unmanaged = DisposeUnmanaged;
    }

    ~DisposeUser()
    {
        DisposeManager.FinalizeObject();
    }

    public void Dispose()
    {
        DisposeManager.DisposeObject(this);
    }

    protected void DisposeUnmanaged()
    {
        // (...)
    }
}

Benefits

  • much simpler to implement for user classes
  • more explicit (managed, unmanaged)
  • use composition
  • remove the needs for multiple base classes all implementing the dispose pattern and creating code duplication

Questions

  • Is it ever a good idea or more of a programmer fancy “improvement” idea ?
  • I’ve made a decent number of research on the dispose pattern and implementation but never found someone suggesting such idea, any reason why?
  • Any potential problems around hard refs, especially with Action capturing members, etc. that would prevent the actual user class to be collected correctly?
  • Other thought?

Thanks!

java – Delayed rendering of object sprite

I’m trying to replicate an odd feature of an 2.5D online Fighting Game named Grand Chase – that I believe it’s is made to hide the latency between players. However, I do not know what exactly is this technique/feature, or if masking the lag is it’s real objective.

What matters is: It adds an visual input-lag for the player that does not exist, but it creates interesting out-of-sync situations that enable different player techniques that is unique on this game.

How it works:

This delayed rendering is applied to all actions except for when the character is being hit – the flinch/pain animation starts at the very same frame the game detects the collision.

This delayed feature is only applied to the player’s character. Other players on the match, both object/hurtboxes/hitboxes are in sync with the rendered character model and animations.

So, it only works for the player, not the opponents/allies.

When an input is made, the character object reacts instantly to whatever the desired action of said input, however the 3d mesh of the caracter are delayed for exactly 8 frames.

Example – a simple jab attack that has 3 frames of startup would play like this:

Press the key for the jab on frame 0 – the game already sends the attack player over the network for connected clients.

On frame 3, the character hitbox is now alive and collides with other object. Enemy character is already on the first frame of flinch/pain animation, However, the player charater is still on idle animation. Damage dealt is displayed, and HP is reduced from the target.
On frame 4, the particle effects of hit collision starts to be rendered where the hitboxes collided. Character is still on idle animation.
On Frame 8, character is no longer on idle animation, and is on the first frame of jab animation.
On frame 11, character is then stopped due to hitlag/hitstagger effect – this is when the player visually confirms that his hit has been confirmed.

Another example – Movement and taking damage

Frame 0 – Game confirms the dash input, so the object and hurtbox is already moving forward. The character model is still standing in place, on idle animation.
8 Frames later, then, the character switches from idle animation to the dashing animation and starts to move on screen.

When the character is moving fast and is hit by an attack/projectile going towards the character, the collision visual effect is displayed ahead of the character (it spawns where the hitboxes collided), the character animation instantly switches to the flinch/pain animation, where the character still goes forward for 8 frames, then stand still.

So, in reality, the player character object is updated in real time, only the character model is updated 8 frames later.

Anyone knows if there is any documentation on this?

I’m trying to replicate this for my own game on an self made Java 2D engine. On my engine, the object updates it’s state class responsible for movement/hitboxes/animation handling then, right after all states are updated, it calls the render function.

Ive tried buffering character X and Y coordinates for 8 frames, it kinda worked but i’ve failed when trying to buffer the animation frames, since it is updated on the state class, not on render function. Any tips are welcome!