Josh64

Untitled

Feb 2nd, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. function Mod:onSpikesInit()
  2.  
  3. local room = game:GetRoom()
  4. local grides = room:GetGridSize()
  5. -- local seed = game:GetSeeds():GetStartSeed()
  6. local backdrop = room:GetBackdropType()
  7.  
  8. for j=1, grides do
  9. local gridEnt = room:GetGridEntity(j)
  10. if gridEnt then
  11. if gridEnt:ToSpikes() then
  12. -- if gridEnt.Type == GridEntityType.GRID_SPIKES
  13. -- or gridEnt.Type == GridEntityType.GRID_SPIKESONOFF then
  14. if backdrop == 6 then
  15. -- replace the sprite/spritesheet
  16. gridEnt:GetSprite():ReplaceSpritesheet(0, "gfx/grid/custom/grid_spikes_flooded.png")
  17. gridEnt:GetSprite():LoadGraphics()
  18. end
  19. end
  20. end
  21. end
  22. end
  23.  
  24. Spikes:AddCallback(ModCallbacks.MC_PRE_ROOM_ENTITY_SPAWN, Mod.onSpikesInit)
Add Comment
Please, Sign In to add comment