Search Unity

Berry Match-Three Thread

Discussion in 'Assets and Asset Store' started by yurowm, Jun 29, 2015.

  1. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    It is pretty simple. Use this code for geitting level number: LevelProfile.main.level

    As I understood it will be something like toffee tornado? http://candycrush.wikia.com/wiki/Toffee_Tornado
    If so you need to look how it works with weed block. Color of this block you may get from chip color.
     
    Last edited: Dec 15, 2015
    SanSolo likes this.
  2. Sreeraj

    Sreeraj

    Joined:
    Apr 27, 2015
    Posts:
    14
    Hi, I want to create a bomb based on swap direction. How can I find out in which direction the swap was made? I need to know whether the swap was vertical or horizontal.
    I see there are allsides,straightsides and slantsides arrays in utils, but they are read only. How can I get this information? thanks
     
    Last edited: Dec 17, 2015
  3. SanSolo

    SanSolo

    Joined:
    Feb 25, 2014
    Posts:
    85
    Hi declare a public string variable moveDirection in ControlAssistant.cs. Then,
    Code (csharp):
    1.  
    2. if (move.magnitude > Screen.height * 0.05f) {
    3.                 foreach (Side side in Utils.straightSides)
    4.                     if (Vector2.Angle (move, Utils.SideOffsetX (side) * Vector2.right + Utils.SideOffsetY (side) * Vector2.up) <= 45) {
    5.                         pressedChip.Swap (side);
    6.                                
    7.                     }
    8.                 ///////My own implementation
    9.                 if (Mathf.Abs(move.x) < Mathf.Abs(move.y)) {
    10.                     if (move.y > 0) {
    11.                        
    12.                         movDir = "Vert";
    13.                     } else {
    14.                        
    15.                         movDir="Vert";
    16.                     }
    17.                 }
    18.                 else {
    19.                     if (move.x > 0) {
    20.                        
    21.                         movDir = "Hor";
    22.                     } else {
    23.                        
    24.                         movDir="Hor";
    25.                     }
    26.  
    27.  
    28.  
    29.                
    30.             }
    31.  
    32.                 pressedChip = null;
    33.  
    34.  
    35.         }
    Wherever you need the movement information, use :

    Code (csharp):
    1. if(ControlAssistant.main.movDir=="Hor")
     
  4. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    Hi!
    First way which I see, that you need to made some changes in the Chip.Swap(Side side) function:
    Code (CSharp):
    1.     public void  Swap (Side side){
    2.         if (!parentSlot) return;
    3.  
    4.         if (chipType == "SwapBomb")
    5.             gameObject.GetComponent<SwapBomb>().Swaped(side);
    6.  
    7.         if (parentSlot[side].GetChip().chipType == "SwapBomb")
    8.             parentSlot[side].GetChip().gameObject.GetComponent<SwapBomb>.Swaped(Utils.MirrorSide(side));
    9.  
    10.         if (parentSlot[side]) AnimationAssistant.main.SwapTwoItem(this, parentSlot[side].GetChip());
    11.     }
    Where SwapBomb is your bomb class.
    After that in SwapBomb class you need to add one function:

    Code (CSharp):
    1.     public void Swaped(Side side) {
    2.         if (Utils.SideOffsetX(side) != 0)
    3.             Debug.Log("Horizontal");
    4.  
    5.         if (Utils.SideOffsetY(side) != 0)
    6.             Debug.Log("Vertical");
    7.     }
    You should to understand that Swaped function will be called always when player is trying to make swap. Even if this swap is unsuccessful. So in this function you need to save in variable value of direction, and when DestroyChip function will be called you will to know in which direction swap was made.
     
  5. Sreeraj

    Sreeraj

    Joined:
    Apr 27, 2015
    Posts:
    14
    Thanks that works.
    I want to add another type of block. This block doesn't interact with anything. Just sits there. It is not destructible. It's a passive element. How can I add it to the list of blocks?
     
  6. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    You can check how other blocks implemented in the level editor.
    But I don't understand the sense of this block. You can remove slot from any place. It will work like your type of block.
     
  7. Sreeraj

    Sreeraj

    Joined:
    Apr 27, 2015
    Posts:
    14
    @SanSolo Thanks but your answer did not help.

    @moneycan
    That is not what I need. I have two bombs : horizontal and vertical.
    Depending on which direction swap was made, i have to create either horizontal bomb or vertical bomb.

    For this, I need to find swap direction in Control Assistant. If last swap was horizontal, get horizontal bomb. If it was vertical, get vertical bomb.
     
  8. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    If I clearly understand, you trying to make Striped Candy from Candy Crash Saga?
    If so, it don't depend from swap direction. it depends from direction of matching.
    For this case (SessionAssistant.MatchSolution):
    Code (CSharp):
    1.         // Check for I4 model to create a simple bomb
    2.         //
    3.         // I4 model
    4.         //
    5.         // X
    6.         // X
    7.         // X   XXXX
    8.         // X
    9.         //
    10.         if (solution.count >= 4) {
    11.             if (solution.v && !solution.h) {
    12.                 FieldAssistant.main.GetNewVerticalBomb(puX, puY, FieldAssistant.main.GetSlot(puX, puY).transform.position, solution.id);
    13.                 return;
    14.             }
    15.             if (!solution.v && solution.h) {
    16.                 FieldAssistant.main.GetNewHorizontalBomb(puX, puY, FieldAssistant.main.GetSlot(puX, puY).transform.position, solution.id);
    17.                 return;
    18.             }
    19.         }
    For case which you described, I don't the any problem. You know how to get swap direction. And you know where is bomb creating code. You have all of you need.
     
  9. Sreeraj

    Sreeraj

    Joined:
    Apr 27, 2015
    Posts:
    14
    That is still a problem. I'm building a bomb that is generated on L combination. So, my SessionAssistant has to be like this:

    Code (csharp):
    1.  
    2. if(solution.v && solution.h)
    3. {
    4.   if(lastSwap was horixontal)
    5.    GetHorizontalBomb();
    6.  
    7. else if (lastSwap was vertical)
    8.  GetVerticalBomb();
    9. }
    10.  
     
  10. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    I already answered you how you can get swap direction.
     
  11. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    Hey, guys!
    Some information about next update!
    Few more options for customization. Now adding of new power ups to the code much easier. And now you can customize rules of creating power ups just in the inspector.
    img1.png
    1. This is Content Assistant. You already know what is it.
    2. Now you can turn on square combination matching. Like in Candy Crush Soda.
    3. This is a power ups settings place. If you want to add new power up, you can add new prefabs in the ContentAssistant. And here you can register these prefabs like a power ups.
    4. This is a system name of the power up. This name will be used in the code for manipulation with power up.
    5. This is name of prefab which you add in the ContentAssistant. If you will forget to add it, you will see an error.
    img2.PNG
    6. Color toggle. You will turn it on if you will use separate prefab for each color.
    7. And it is easy to add and remove.
    8. Combination settings area. Here you can edit rule of creating powerups on the field. You can set what type of power up will be created after each of combination.
    9. Priority column. Here you can set the combination priority number. The lower the number, the higher the priority is a combination of.
    10. Square combination type. There is sence to have only one square combination. Or no one, if you turned off square combinations at all.
    11. This combination require more then 2 chips on the vertical.
    12. This combination require more then 2 chips on the horizontal.
    13. Minimal count of chips in this combination.
    14. Powerup which will be created when this combination matched. List of powerup you can set in the PowerUps area.
    15. Tag field. For each combination you can set special tag. You can use this tag for writting additional logic for each combination.
    img3.PNG
    16. And of course. It is easy to add and remove. Also you can sort it by priority.

    Next update will be avaliable in January
     
    Last edited: Dec 19, 2015
    shoni-wheeler likes this.
  12. Sreeraj

    Sreeraj

    Joined:
    Apr 27, 2015
    Posts:
    14
    @moneycan there's an issue with shake button. When user clicks shake and immediately clicks on some other booster like switch, the game behaves unpredictably and sometimes hangs. Is there a fix to this?
     
  13. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    Try to add this line in the BoosterButton file. It will help.
    Code (CSharp):
    1.     void OnClick () {
    2.         if (!SessionAssistant.main.isPlaying) return; // <- this line
    3.  
    4.         if (StoreInventory.GetItemBalance (boosterItemId) == 0) {
    5.             UIServer.main.ShowPage("Store");
    6.             return;
    7.         }
    8.         if (type == BoosterButtonType.Message)
    9.             SendMessage(value, SendMessageOptions.DontRequireReceiver);
    10.         if (type == BoosterButtonType.Page)
    11.             UIServer.main.ShowPage(value);
    12.     }
     
  14. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    Hey guys!
    Check it out! Berry Match Three v4.0 trailer!
     
    Xentar likes this.
  15. joshjzx

    joshjzx

    Joined:
    Dec 25, 2015
    Posts:
    5
    Hi Viktor looks like its ready to release great job :)
     
  16. joshjzx

    joshjzx

    Joined:
    Dec 25, 2015
    Posts:
    5
    i also noticed a bugt with the jelly/ice block that you can move the chip inside it, this shouldnt be the case, havent gone to deep into the code yet to check how it handles the blocking slots
     
  17. Xentar

    Xentar

    Joined:
    Apr 8, 2011
    Posts:
    23
    I'm... going to suffer porting all my "features" to this new version :(
    I already created like 5 new game types, near 10 types of chips and "special" assistants... heheheeee... -__-
    Please, a detailed changelog.txt xD
    Diffmerge all the way...

    Looks awesome, btw.
     
    Last edited: Dec 26, 2015
  18. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    Hi, thanks!
    I think you should use it only for new games.
    If I were you, I would have gone crazy :)
    As for changelog. That's all I can remember:
    • New bomb added: Rainbow Heart and Ladybird
    • Square combinations added
    • Energy system added
    • UI improvements:
      • Images added where it is needed
      • Now UI works in a both screen orientation. Hot screen orientation changing is supported.
      • Now boosters has a beautiful 3d animation.
      • For each level map location can be attached original level background.
      • For each Page (in UIServer) can be attached music track.
      • UI structure changed (UI-flow)
    • Level map improvements
      • Now level map consist of map locations. Every location which user can't see, will be removed, and it will be created when player will scroll to this location. It will save device resources when you use large map.
      • Now user can zoom in/out level map in portrait mode.
    • Fixed a large number of bugs
    • Soomla Store plugin updated to the last version.
    • Now Soomla Store plugin is now responsible only for IAPs. So if you want to replace it to another billing system, it will not a problem.
    • Now you can set gravity direction for each slots in level editor.
    • Single-use boosters added. (Booster which user select before level started). Bombs, Rainbow Hearts and Ladybirds.
    • "Rate it" popup added
    Extended version (will be avaliable in a month after standart version will be released)
    • Facebook connection
      • Player data cloud storing (Parse.com service)
      • Leaderboards for each level for player, his friends and bots.
      • Score sharing
      • Friends inviting
    • Ads added (Unity Ads, Chartboost, AdColony)
      • Rewarded video ads in Berry Store
      • For each page (in UIServer) can be attached ads showing event
    • Tutorial system added. For each level you can attach dialog of two game characters. It will very helpful for creating tutorial or for narrative your story.
    • "New version avalaible" popup added.
    • Gathering statistics
     
  19. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    Hi! Thanks! It really ready. I am going to submit this version before the end of the year.
    Could you better explain this bug. I can't understand.
     
    Last edited: Dec 26, 2015
  20. Xentar

    Xentar

    Joined:
    Apr 8, 2011
    Posts:
    23
    Viktor, when you say "extended version" is a different release with extra features, no? you have in mind a way to upgrade from standard or as addon you can plug-in to it?
     
  21. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    It will be the same game with additional premium features. And yes it will be another asset with higher price. And when the main asset will one year old, I will be able to make paid upgrade to extended version for old customers.
     
  22. joshjzx

    joshjzx

    Joined:
    Dec 25, 2015
    Posts:
    5
    Hi Viktor

    the jelly bug is that you can still make a match from the fruit under the jelly by moving it instead of having a falling piece make the match to clear it.

    The blue marked jelly fruit can be moved to make a match, i wouldn't have expect this to be the desired behavior.

    http://s4.postimg.org/yvwgi57fh/1apture.png
     
  23. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    This is not a bug at all. Jelly mechanic works like the same in the Candy Crush.
     
  24. joshjzx

    joshjzx

    Joined:
    Dec 25, 2015
    Posts:
    5
    no worries, works for me then :)

    thanks Viktor.
     
  25. SanSolo

    SanSolo

    Joined:
    Feb 25, 2014
    Posts:
    85
    Hi Viktor, there's an issue I'm facing. I create levels in the editor. Then, when I close the project and reopen later, all the level design modifications I did are lost.
     
  26. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    All? It sounds like you forgot to save your scene
     
  27. SanSolo

    SanSolo

    Joined:
    Feb 25, 2014
    Posts:
    85
    I modified a level in demo scene (Level 15). Then Saved scene, saved project. Then closed the project and later reopened. Modifications made to lvl 15 are gone.
     
  28. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    What kind of modifications you made? I know about this bug http://forum.unity3d.com/goto/post?id=2412567
    I just checked. I made some changes in level 15 design, and after restart all changes wasn't lost.
     
  29. SanSolo

    SanSolo

    Joined:
    Feb 25, 2014
    Posts:
    85
    Sorry my bad. I didn't notice Levelbutton is a prefab. Forgot to click Apply after making changes
     
  30. SanSolo

    SanSolo

    Joined:
    Feb 25, 2014
    Posts:
    85
    Actually, no. If I click "Apply", basically all levels turn into the latest modified level.
     
  31. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    Applying changes is a bag idea. You may try to reset level component.
     
  32. NBJack

    NBJack

    Joined:
    Jun 26, 2014
    Posts:
    3
    Great find; I'm encountering the same problem. Can you elaborate on where and how you set the drag threshold?
     
  33. Sylwest-Production

    Sylwest-Production

    Joined:
    Nov 18, 2015
    Posts:
    5
    Hi,
    When you say "replace" do you mean directly via a external image program (like paint) ? Or else, where is the Sprite renderer? I can't find it in the folder match-tree engine -> sprites -> berries -> SimpleCandyBlueA (for example)....???

    Thx for your help.
     
  34. joshjzx

    joshjzx

    Joined:
    Dec 25, 2015
    Posts:
    5
    he means copy over them with your sprites named the same as the original ones into the berries folder..
     
    Sylwest-Production likes this.
  35. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    upload_2015-12-31_0-55-3.png
     
    NBJack and yurowm like this.
  36. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    Hi,
    Do yourself a favour and DO NOT rename the prefabs or sprites, the names are used throughout the code, if you want to change the sprites create your own using the same names as in the sprite folder, there are three sprites for each A,B and C.
    Then just replace the contents of the Berries Folder with your sprites.
    The code randomizes the sprites throughout the game.

    John
     
    NBJack, Sylwest-Production and yurowm like this.
  37. Sylwest-Production

    Sylwest-Production

    Joined:
    Nov 18, 2015
    Posts:
    5
    Ok thx to both of you :) have a great day :)
     
  38. NBJack

    NBJack

    Joined:
    Jun 26, 2014
    Posts:
    3
  39. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    Hi to all,
    The 4th version is pending review now. All, who interested in the last version, may play the demo in the Google Play.

    Happy New Year!
    img.PNG
     
    Tapgames and Xentar like this.
  40. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    Hi Viktor,

    Happy New Year.

    John

    Just tried the demo, needs works, level 14 no Jellies left but offering five extra moves, cannot see the win.

    Press pause and then info button, images tracking on screen.

    No Jelly image showing on Level Target window.

    Don't know how to get screenshots off an android.
     
    Last edited: Jan 1, 2016
  41. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    Hi John,

    Hah! Yes, I have some problems with QA. Thank you. I fixed and resubmitting it now.
     
  42. daschatten

    daschatten

    Joined:
    Jul 16, 2015
    Posts:
    208
    Hi,

    i have the same problem as SanSolo, Level changes are not saved. I found out that in "Inspector normal mode" levels are not saved but in "debug mode" levels are saved. Double checked this with a new project.

    Maybe this is a unity 5.3 issue?
     
  43. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    Hi,
    Yes! I just checked it in 5.3, and I lost all changes that I made. I will find solution now. Thank you!
     
  44. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    @daschatten @SanSolo

    I found the solution.
    You need to find all custom editor scripts. Yurowm\Match-Tree Engine\Scripts\Editor
    And for all scripts you need to make some changes.
    1. Open script and find OnInspectorGUI() function.
    2. First or one of first lines of this functions must be xxxx = (Class) target; where xxxx - some variable, Class - name of the editable component class. After this line you need to write new line: Undo.RecordObject(xxxx, ""); Write variable from previous line instead of xxxx.
    3. In the end of this functions body you need to find EditorUtility.SetDirty(xxxx); line. Remove this line.

    Also I recommend you to use Unity 5.1.3. This is version which I used for development Berry Match-Three.

    img.PNG
     
    Last edited: Jan 4, 2016
  45. shoni-wheeler

    shoni-wheeler

    Joined:
    Oct 25, 2014
    Posts:
    102
    Hi Viktor,
    How long before it is available!!

    John
     
  46. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    Hi John,
    I submitted it 2 January. Now it is pending review. Usually it takes about 1-2 weeks. 3 sometimes. So I wait that it will be approved in 10-15 Jan. I can't tell certain date, because it doesn't depends on me. So it goes.
     
  47. DarkSlash

    DarkSlash

    Joined:
    Sep 30, 2011
    Posts:
    128
    I played the demo and I saw the documentation. According to the pdf, the only thing you need to do is create a new UI Button, attach a script... and that's it! Is that easy to create a level? And This needs to be done WHERE? In a new scene? As a child of an object in the example scene? How it works? What are the completes steps for creating a level?
     
  48. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    I didn't update the user manual since version 2.0. Sorry about that.
    Check this video

    Also I recommend you to wait until 4th version will be avaliable. There will be new live documentation.
     
  49. zero_null

    zero_null

    Joined:
    Mar 11, 2014
    Posts:
    159
    Hi Victor! I hope you are doing great. I am just interested to know few things !
    Can we change sugar with many different objects? Collectables?
    Can we change animations of different bombs?
    I am really looking forward for the new version. It looks great in the trailer but have noticed few bugs.
     
  50. yurowm

    yurowm

    Joined:
    Feb 16, 2015
    Posts:
    136
    Hi!
    You can change everything in this game. It depends only on your skills.
    Of course you can change this images. You don't need even open the Unity for this. As for animations, there used standard unity animations tools. If you know how it works, you will be able to change it.
    What kind of bugs do you mean? Write it and I will add it in the special manual page.
    I don't want to make new submission now because it will delay the release.
    Just write all bugs which you found, and you will be able to fix it self when it will be released.
     
    Last edited: Jan 5, 2016