Ground sprite changed on map change

Started by Starlock, December 21, 2020, 05:29:32 PM

Previous topic - Next topic
I was remaking my custom grass to be more optimal by using a modified ground with an animation change to the grass sprite. It works perfectly except for when you go to a different map it will change back to the default animation for a second before changing back to the modified animation. Does anyone know of any workaround, I've tried using map:on_started(), map:on_finished(), game:on_map_changed() and none of these so far have worked.

  entity:add_collision_test("overlapping", function(entity, hero)
    if hero:get_sprite("ground") ~= nil then
    hero:get_sprite("ground"):set_animation("purple")
    end
  end)

January 10, 2021, 10:58:15 AM #1 Last Edit: February 26, 2021, 05:36:56 PM by PeterB
I have seen in another post that there is a delay at the start of the map with map:on_started(). So If you have set this up in function map:on_started() it would be better to call it in function map:on_opening_transition_finished().