Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Marble Solitaire C#

Discussion in 'Scripting' started by madassemblage, Jan 17, 2015.

  1. madassemblage

    madassemblage

    Joined:
    Oct 29, 2014
    Posts:
    3
    Need help on making "Marble solitaire game 3D". (not same game but exact same logic)
    I really dont have an idea from where do i start.

    If anybody know any assets for this game please do let me know.
    Can i use "grid framework asset" for the same?
     
  2. TheForsaken95

    TheForsaken95

    Joined:
    Aug 29, 2014
    Posts:
    30
    I would recommend starting out by creating a card shaped cube, and write a script to copy and stack them, you could do this with a for loop and instantiate.

    Each card that you stack needs to be assigned a number and a card type, so that you could get the result 7 of clubs, or 3 of hearts.

    Once you get a stacked deck of cards with their correct values, it will be easier to take the next step forward.
     
  3. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    I'd actually suggest going the other way. Build a data structure first that represents the game. Tack on the graphics later.
     
    OboShape and ZO5KmUG6R like this.
  4. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Deck of cards for a marble game? LOL
     
  5. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    As a disclaimer my post only makes sense if the second post is relevant. I didn't google the game to find out what it's about.

    If it's a physics based marbles game then starting with the actual representation of a marble makes sense. Forget data structures.
     
  6. madassemblage

    madassemblage

    Joined:
    Oct 29, 2014
    Posts:
    3

    Here is the image of "Marble solitaire" game. The word "solitaire" is making confusion :)
    Any help on this would be appreciated.

    Thanks in advance.
     
  7. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Agree with you there BM in getting the structure and thought process down first.
    Write down how you play it at each step and what u want to happen. Soon find as you build that up you will end up with small bunches of lines that can be lumped together and an outline process
    Ie
    select ball-
    check for empty space 2 holes away with a ball inbetween
    move ball
    Remove ball jumped over

    There's a match 3 tutorial I've found by Grin Grim Tutorials, and there's parts of that could be useful for checking adjacent neighbours on board.

    I should get home later today ,and back to my pc, so ill find link and update here.
     
  8. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    So it's not a physics based game. In that awe start off with a data structure that will hold the positions of all marbles. Then work out al algorithm for testing the validity of a move. Then define win conditions. Build graphics right at the end. You should be able to have a prototype up in a day or so.

    I have played the game, but our version used pins instead of marbles.
     
  9. madassemblage

    madassemblage

    Joined:
    Oct 29, 2014
    Posts:
    3
    Thanks Obo Shape

    Just started with the board and pins basic code.
    Now my board is able to calculate which areas are filled and which ones are empty. And for the pins they all gather information about neighbours on board. Its a very rough code though, but atleast i got started.

    @ BoredMormon : i am also using pins in my game (by the way do you have any other name for this game?)

    Thanks
     
  10. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    Chinese checkers I think