0 votes

Hey, guys. I'll just have to ask for help with this. As you can see on the screenshot I can still play even if the counter is less than 0 already and the game over window didn't show up. Also there are times that the Victory Window appears twice when the game is won. I hope you can help me with this. Thank you ahead. here's the code which I think is responsible for it

here is the code:

ffunc updatecounter():
counter -= 1
emitsignal("setcounterinfo", currentcounter)
if currentcounter <= 0:
counter = 0

func gameover():
if current
counter == 0 and boardstable:
lose = true
prints("youlose" , youlose)

func ongridupdatecounter():
if ismoves:

  • the last function is ongridcounter() is connected thru signal from another .gd file.
    func after
    for i in width:
    for j in height:
    if allpieces[i][j] != null:
    if match
    at(i, j, allpieces[i][j].color) or allpieces[i][j].matched:
    if !damagedslime:
    streak = 1
    movechecked = false
    slime = false
    colorbombused = false
    if isdeadlocked():
    move = true
    matchfound = false
    emitsignal("updatecounter") << the emition of signal
Godot version Godot 3.3
in Engine by (14 points)
edited by

Please properly copy, paste, and markdown your code (use the formatting buttons to help you).

Thank you for the interest of helping me. I have pasted the codes already in case you want to take a look. Thanks again.

1 Answer

0 votes

The only thing I could say without a copy of your code, not just a picture is that board_stable is never assigned to true which makes you_lose never be set to true through the if statement.

If that does not work or you do not know why that is happening please copy and paste all of the code that has a problem here or into something like https://pastebin.com/ so that we could help you further.

by (72 points)

I get what you mean. I will try if this works. Thank you.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.