Search Unity

Imitating "Turtle Logo" behaviour in C#?

Discussion in 'Scripting' started by BlackArcane, Apr 24, 2013.

  1. BlackArcane

    BlackArcane

    Joined:
    Jun 26, 2011
    Posts:
    119
    Hey all! I am trying to create a "Tutle Logo" interpreter in C# for use within Unity3D. If you haven't heard of Turtle Logo before, imagine a turtle that can move around the screen and upon user indication can also draw a continuous line behind it. It can also face any direction. It is controlled using the Logo programming language. How can I implement such a thing? Thanks in advance! :)
     
  2. ardo314

    ardo314

    Joined:
    Jul 7, 2012
    Posts:
    334
    Where exactly is your problem?

    You could just go ahead and create a Turtle-script containing the appropriate methods, like forward, turn etc.
    And then call them in a fancy way from its start method.

    Or do you want to create your own cmd window where you can enter and execute code from? That would be a little overdone in unity.
     
  3. BlackArcane

    BlackArcane

    Joined:
    Jun 26, 2011
    Posts:
    119
    No in fact I am wondering how I can tell it to move two "blocks" in front... I guess I could implement a "grid" but I don't know what to do exactly. Also, I need a way of spawning a continuous line that I can interrupt for a little while and then keep spawning.
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,145
    You could use Vectrosity for the line-drawing stuff, and an invisible game object for the turtle. That way you can control it with Rotate and Translate functions. The hard part would be writing a Logo interpreter, though Logo is relatively simple and limited so it shouldn't be super-hard.

    --Eric
     
  5. TheRaider

    TheRaider

    Joined:
    Dec 5, 2010
    Posts:
    2,182
    You just divide your coordinate system into a grid. For example make each square 1 by 1.