How do I destroy a sprite? Bug in game?

0 favourites
  • 13 posts
From the Asset Store
Match same tiles with each other as fast as you can and earn more score during a limited time!
  • I am making an online multiplayer card game and I am trying destroy the card sprites after the round is over. The weird thing is that I use the exact code for the other players and it works fine.

    After the round is over, Player 1, 2 ,3's card are destroyed but player 4's cards are destroyed but one. It is frustrating matter. I have looked all over for the bug but to no avail. Something about the last player keeps spawning a card on Player 1 card slot after it is destroyed. I disable the code and let it play and it works fine for the second round. But something about the first round makes it spawn another card. Any help would be greatly appreciated. Also I tried using the debugger to find the code that is making the Player 4 card respawn, but it was no help. When I use the breakpoint at that event, it works fine in the preview. That is all I know. Any help is appreciated. Thanks! Also

    Here is a video link for the bug. I tried my best to explain what is going on.

    Also I have provided a link to the capx if you want to look through it.

    https://dl.dropboxusercontent.com/u/157600816/Super%20Six%20Card%20Game%20%28Alpha%29.capx

  • Wsoukkachang Had a look - and bugs like this going to take awhile to figure out.

    1) You need to comment - hard to understand you thought process, and what connects what without comments, and next month you would have forgotten it too, so comments help others see what you doing, but also remind you what you did - lol.

    Seriously, it is going to take considerable amount of time to make sense of uncommented events even before trying to track down the underlying issue.

    2) I just tried it and made players(2 and 4 win) and no issue with card not being destroyed.

    I would suggest making use of break points (rightclick on event and toggle break points) you can then move through the code in debugger mode from breakpoint to breakpoint to narrow down the issue.

    Sidenote: nice job with multiplayer plugin nice job with game, still a long way to go, but very nice.

    NEED TO COMMENT THOUGH! lol - Yes I'm shouting

  • and player 2 won.

    Might be specific card? Or animation frame? Or other? Haven't got time to make sense of it. Try the breakpoint, try to use problem cards see if they stick etc

  • Lol I know it's confusing with such little comments. :/ I am starting to write more so it won't confuse me either. Thanks for taking a look at it though. Yeah the code works for player 1 flawlessly, just wondered why I didn't for the rest of them. They call on the same message to destroy when the round is over, but they do different things depending on the Player won. It might be my computer or something. That is weird that it worked for you, logically, it should work for me as well, but for some reason it destroys the card then it respawns. Thanks for the input, I am still working on the fix.

  • Wsoukkachang Had a look - and bugs like this going to take awhile to figure out.

    1) You need to comment - hard to understand you thought process, and what connects what without comments, and next month you would have forgotten it too, so comments help others see what you doing, but also remind you what you did - lol.

    Seriously, it is going to take considerable amount of time to make sense of uncommented events even before trying to track down the underlying issue.

    2) I just tried it and made players(2 and 4 win) and no issue with card not being destroyed.

    I would suggest making use of break points (rightclick on event and toggle break points) you can then move through the code in debugger mode from breakpoint to breakpoint to narrow down the issue.

    Sidenote: nice job with multiplayer plugin nice job with game, still a long way to go, but very nice.

    NEED TO COMMENT THOUGH! lol - Yes I'm shouting

    I took your advice and put in comments! Thanks! Hopefully this will make it easier for the both us to figure this out.

    https://dl.dropboxusercontent.com/u/157600816/Super%20Six%20Card%20Game%20%28Alpha%29.capx

  • Still needs more info in comments But helps a bit.

    Just ran another test (quickly) and again I didn't see the card not being destroyed. I had each player win, and all four times cards were destroyed. Try clearing your cache? Try running it in different browser?

    I am running in chrome latest version.

  • That is so weird!!! It works for me too now. I wonder why? I did not clear the cache or anything. I just woke up this morning and tried the game out and BAM! Everything works. Something must be up with my computer or something... I am using Chrome latest version as well. You think it has to do with connecting to the signalling server "wss://multiplayer.scirra.com" ?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You think it has to do with connecting to the signalling server "wss://multiplayer.scirra.com" ?

    Nope, I doubt that. It is probably cache, and you saved a newer version so it flushed(updated) saved files. Remember it saves entire game to cache, and only updates once it detects never version. You making comments bumped it to a newer version.

  • > You think it has to do with connecting to the signalling server "wss://multiplayer.scirra.com" ?

    >

    Nope, I doubt that. It is probably cache, and you saved a newer version so it flushed(updated) saved files. Remember it saves entire game to cache, and only updates once it detects never version. You making comments bumped it to a newer version.

    Hmm, I did not know that. That might have been why.

  • Thanks for the info it looks like it is working now!

  • Now I have come upon another bug! When Player 4 wins round one and two, it does not spawn the "MiniCards" for Player 1 and 2.

    [attachment=1:183ex367][/attachment:183ex367]

    But when Player 1 wins round one, then Player 4 wins round two, it works. Weird thing is that it is calling the same code for round two to spawn the "MiniCards" in the "Destoy11 Group event" so it should not matter who won the first round right? I'm stumped. Any help is very much appreciated.

    [attachment=0:183ex367][/attachment:183ex367]

    Here is the capx file link:

    https://dl.dropboxusercontent.com/u/157600816/Card%20Game/Super%20Six%20Card%20Game.capx

  • Bump.

  • Need help! I think it is a bug in the multiplayer object. When I change one event, it affects the other players. For example, when I disable an event, in Player 3, it affects Player 4's card spawning problem (it works with this event off but I need it to destroy the card). I was wondering if anyone else is receiving this problem? Like the events are linked in some way.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)