when the player reaches 50 clicks, the level becomes 2 and the picture changes, but the game starts to lag. The click texture works slowly, and it’s impossible to click quickly. It’s strange, but it’s not the texture; it’s a PNG format
What happens here is that as soon as you reach 50 clic, first it changes the texture to “normal1” and then to “normal2” 60 times per seconds
This is because you check “if clic > 20” and “if clic > 50”. When clic is superior to 50 it is also superior to 20 so both conditions are met.
You should try something like :
if clic >50:
$TouchScreenButton.texture_normal = load(“res://newpict/normal2.png”)
$TouchScreenButton.texture_pressed = load(“res://newpict/clic2.png”)
$Labellvl.text = "Уровень: " + str(2)
elif clic > 20:
$TouchScreenButton.texture_normal = load(“res://newpict/normal1.png”)
$TouchScreenButton.texture_pressed = load(“res://newpict/clic1.png”)
$Labellvl.text = "Уровень: " + str(1)
You don’t need this _physics_process() at all, that’s what causing you issues - you’re loading textures every physics frame. This should work the same and be much more efficient: