Author Topic: Ground sprite changed on map change  (Read 165 times)

Starlock

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Ground sprite changed on map change
« on: December 21, 2020, 05:29:32 pm »
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.

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

PeterB

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Ground sprite changed on map change
« Reply #1 on: January 10, 2021, 10:58:15 am »
Have you changed the tileset and sprite image or are you putting a new image over the top of the existing one?

If you have changed the tileset and sprite image with a new one i cant see why it would revert back to the original??