GNOME Bugzilla – Bug 757874
Handle worm respawning on top of another worm
Last modified: 2015-12-10 19:26:08 UTC
> I think that the worms currently passing by the spawn point of the respawning > worm should be able to do so without colliding with the respawning worm. We can > emphasize that but making the respawning worm transparent and have it stand > still until all tiles are clear. This is the solution me and Michael agreed on in https://bugzilla.gnome.org/show_bug.cgi?id=754608 We're open to new or better ideas.
Created attachment 315988 [details] [review] Patch for making worms transparent on respawn I made it so worms are "dematerialized" upon respawn (they act as empty chars in the board, so any worm can move there). Also, they will only materialize if they are able to do so. If there is another worm on top of them, the materializing will be postponed.
Created attachment 315995 [details] [review] Updated patch for making worms transparent on respawn
Created attachment 316027 [details] [review] Patch for ghost bonus On top of my previous patch, this one introduces a new bonus type that grants temporary transparency. The spawn settings and effect are for testing purposes and will probably be modified if it is decided that I can implement this.
Review of attachment 315995 [details] [review]: I'm not exactly sure if you should be able to move while dematerialized. The initial idea was to have the worm stand still until all tiles are clear, but maybe it's better the way you implemented it here. What do you guys think? ::: src/worm.vala @@ +276,3 @@ + private void materialize (int [,] board) + { + foreach (var pos in list) You should use brackets if you have more than one line inside the for loop. @@ +293,3 @@ + rounds_dematerialized = rounds; + is_materialized = false; + foreach (var pos in list) Same as above.
Review of attachment 316027 [details] [review]: I'm not exactly sure if we want this bonus or not. My main concern is that is the animation is the same as the respawning one from the previous patch and it might cause some confusion while playing. I'd like to hear some opinions first. ::: src/nibbles-game.vala @@ +404,3 @@ boni.add_bonus (board, x, y, BonusType.REVERSE, good, 150); break; + default: I don't think it's a good idea to add it on the default label. You should also tweak the number above (41), as it changes the pace of the game quite a bit.
Created attachment 316514 [details] [review] Updated patch for making worms transparent on respawn (In reply to Iulian Radu from comment #4) > Review of attachment 315995 [details] [review] [review]: > > I'm not exactly sure if you should be able to move while dematerialized. The > initial idea was to have the worm stand still until all tiles are clear, but > maybe it's better the way you implemented it here. > > What do you guys think? > > ::: src/worm.vala > @@ +276,3 @@ > + private void materialize (int [,] board) > + { > + foreach (var pos in list) > > You should use brackets if you have more than one line inside the for loop. > > @@ +293,3 @@ > + rounds_dematerialized = rounds; > + is_materialized = false; > + foreach (var pos in list) > > Same as above. Fixed the brackets issue. The main reason for allowing worms to move on respawn is to not have them stuck in case an enemy worm feels like camping the respawn spot.
(In reply to Iulian Radu from comment #5) > Review of attachment 316027 [details] [review] [review]: > > I'm not exactly sure if we want this bonus or not. My main concern is that > is the animation is the same as the respawning one from the previous patch > and it might cause some confusion while playing. I'd like to hear some > opinions first. > > ::: src/nibbles-game.vala > @@ +404,3 @@ > boni.add_bonus (board, x, y, BonusType.REVERSE, > good, 150); > break; > + default: > > I don't think it's a good idea to add it on the default label. You should > also tweak the number above (41), as it changes the pace of the game quite a > bit. Regarding the bonus, I was thinking about refactoring it and make it last until the first collision with another worm (or yourself). After the collision, the ex-ghost worm would now be flashing, indicating that the effect is going to expire. Also, maybe bonuses that are about to vanish from the board should also flash. Regarding the value 41, I only used that for testing purposes as I wanted your opinion on the bonus itself.
Review of attachment 316514 [details] [review]: Looks good.
I'm closing this as the bug has been fixed. You should submit a new bug report with your patch for the proposed bonus. That way, it will be easier to get some more opinions and make a decision.