Search Unity

Please help, simple game concept, have no idea where to start !

Discussion in 'Scripting' started by OvidiuGhe, Dec 12, 2012.

  1. OvidiuGhe

    OvidiuGhe

    Joined:
    Oct 1, 2012
    Posts:
    12
    Hello everybody!

    I got this idea for a game prototype and I basically want to make a small cube walking on a bigger cube face and I don't know where should I begin :)

    I attached a simple image and I want the yellow cube to be able to be controlled by the player with keyboard and when the yellow cube reaches one of the edges to swap on the next edge.

    Any advice on how can I start? I use unity for some time now, feeling quite comfy with C# :)

    Thank you!
     

    Attached Files:

    • $PS.png
      $PS.png
      File size:
      80.5 KB
      Views:
      914
  2. Alex Cruba

    Alex Cruba

    Joined:
    Aug 16, 2011
    Posts:
    564
    It's a prototype so before trying a solution:

    1) Is the concept of cube moving on cube like shown in the pic the final goal?
    2) Will it be 1st view and what happens when it comes to the border: Should the big cube rotate?
     
  3. OvidiuGhe

    OvidiuGhe

    Joined:
    Oct 1, 2012
    Posts:
    12
    Hey Alex, thank you for your time!

    1) Yes, this is the final goal.
    2) The camera will be fixed and the player will see only one face of the cube at a time.
    And yes, the red cube should rotate when the yellow cube reach and passes the edge onto the next face.
     
  4. Alex Cruba

    Alex Cruba

    Joined:
    Aug 16, 2011
    Posts:
    564
    I'll think about it and come back with a silly solution in around a hour... ;)
     
  5. OvidiuGhe

    OvidiuGhe

    Joined:
    Oct 1, 2012
    Posts:
    12
    Thank you a lot :)
    I don't ask for somebody to code-it for me, I just felt like I simply don't have any clue on where to begin and how exactly should be approached :)
     
  6. Alex Cruba

    Alex Cruba

    Joined:
    Aug 16, 2011
    Posts:
    564
    Well... My only idea at the moment is to check the distance from yellow cube to the border and rotate the red cube in relation to the distance the yellow cube has passed.

    So let's start the yellow cube in the middle, the result would be:

    1) check the distance from cube position to border
    2) tell red cube to rotate 10 degrees each ummmmm 100 feet distance passed.

    Do you have an idea what I mean? If not I could do you a small pic.

    I use to breake big problems in pieces, so after that step I would think about kinetic, gravity and how to tilt the yellow cube when moving over the border (corner).
     
  7. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,528
    I'd begin by creating two cubes.

    Then I'd create some scripts.

    1) a script attached to the little cube to move cube around
    2) a script attached to the little cube to control sticking it to the large cube
    3) a script attached to the large cube to control rotation
     
  8. Alex Cruba

    Alex Cruba

    Joined:
    Aug 16, 2011
    Posts:
    564
    I think the gravity thing will be a problem. When the yellow cube start moving to the corner the red cube starts rotating. At this point we need glue (or hony if you don't have glue). When yellow cube crosses 50% of it's body over the corner, the glue thing must be deactivated, to make it possible to tilt the cube. Then glue must stick again.
     
  9. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,528
    you don't need gravity. You're movement can be just stuck to the surface of the cube. What is gravity going to be used for anyhow?

    And lets say you do want gravity... so when you get to the edge you turn off gravity for the player, you animate the player cube to the new side, and then turn it back on with the new gravity direction.
     
  10. Alex Cruba

    Alex Cruba

    Joined:
    Aug 16, 2011
    Posts:
    564
    Ah, so you mean the yellow cube don't have to tilt because it automatically has right position when the red cubes rotation is done? Okok, sometimes I think kind of complicate - I just try to make concepty for the future normally. ;)

    Posting this, I have a more important question to Ovi: How about corners? Is there a safetyzone planned to avoid that?
     
  11. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,528
    make the rotation actually be the camera moving around the cube.

    or rotate the cube, and have the yellow player cube be a child of the major cube

    and don't use gravity, there's no need for it.
     
  12. OvidiuGhe

    OvidiuGhe

    Joined:
    Oct 1, 2012
    Posts:
    12
    wow hearing you guys talking about it brings me some ideas and new approaches :D
    will try and let you know the results ;)

    thank you!