GameMaker Textures are messed up

  • Thread starter Deleted member 16767
  • Start date
D

Deleted member 16767

Guest

As you can see on the video, sometimes when the boss switches his sprite_index, it gets kinda glitchy and some random tileset sprite shows up.

How do I fix this?
 

rIKmAN

Member

As you can see on the video, sometimes when the boss switches his sprite_index, it gets kinda glitchy and some random tileset sprite shows up.

How do I fix this?
Try clearing the project cache (broom icon near the run button in the IDE) and recompiling / running the game.
 

rIKmAN

Member
I've done that several times.
Oh, well sorry, I'm not psychic and you didn't mention that in your OP.

Are you sure the graphics that pop in are from a tileset and not another sprite that could be caused by an incorrect image_index assigment or your code switching sprites for a frame when it shouldn't be?

Also try manually clearing all caches, closing GMS2, reopening it, then loading and running your project.
Find the buttons to do this in File > Preferences > General > Paths
 
D

Deleted member 16767

Guest
All I had to do was delete this code and it works fine now
if counter_spin_time < 0
{
global.boxer_boss_action_l = sprite_index = spr_boxerboss_stun
global.boxer_boss_action_b = sprite_index = spr_boxerboss_stun
global.boxer_boss_action_r = sprite_index = spr_boxerboss_stun
global.boxer_boss_action_f = sprite_index = spr_boxerboss_stun
counter_spin = 600
}
 

Mike

nobody important
GMC Elder
This type of code does not work in GML. You need to break it up into multiple lines.

Code:
global.boxer_boss_action_l = sprite_index = spr_boxerboss_stun
becomes

Code:
global.boxer_boss_action_l = spr_boxerboss_stun;
sprite_index = spr_boxerboss_stun;
 
Top