How do I destroy a sprite? Bug in game?

Get help using Construct 2

Post » Tue May 06, 2014 8:08 am

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.

https://www.youtube.com/watch?v=acvYhDVCfkE

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
Last edited by Wsoukkachang on Tue May 06, 2014 10:36 am, edited 1 time in total.
B
19
S
3
G
1
Posts: 37
Reputation: 1,433

Post » Tue May 06, 2014 8:45 am

@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 ;)
You do not have the required permissions to view the files attached to this post.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Tue May 06, 2014 8:57 am

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
You do not have the required permissions to view the files attached to this post.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Tue May 06, 2014 9:26 am

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.
B
19
S
3
G
1
Posts: 37
Reputation: 1,433

Post » Tue May 06, 2014 10:38 am

DUTOIT wrote:@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! :D 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
B
19
S
3
G
1
Posts: 37
Reputation: 1,433

Post » Tue May 06, 2014 12:03 pm

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.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Tue May 06, 2014 7:14 pm

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" ?
B
19
S
3
G
1
Posts: 37
Reputation: 1,433

Post » Tue May 06, 2014 7:24 pm

Wsoukkachang wrote: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 you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Tue May 06, 2014 7:54 pm

DUTOIT wrote:
Wsoukkachang wrote: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.
B
19
S
3
G
1
Posts: 37
Reputation: 1,433

Post » Wed May 07, 2014 6:43 am

Thanks for the info it looks like it is working now!
B
19
S
3
G
1
Posts: 37
Reputation: 1,433

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 11 guests