Search Unity

game design for basic programming structures

Discussion in 'Game Design' started by Ixquic2D, Feb 27, 2015.

  1. Ixquic2D

    Ixquic2D

    Joined:
    Sep 9, 2014
    Posts:
    25
    Hello all, could you please tell me some ideas about how to make a good game design for basic programming structures like while, for, if/else, switch using Unity in 2D?

    Thank you, :p
     
  2. RockoDyne

    RockoDyne

    Joined:
    Apr 10, 2014
    Posts:
    2,234
    Realistically there isn't much. Potentially simple games like pong or breakout could work since they are mostly setup, but until you get to objects, it's going to be easy to make things that are way too complicated and just bad practice. I would say that around the time you get people introduced to inheritance, that would be about the time where it's easier to introduce people to the unity api and all the matrix math that's involved.

    The lesson of the day: games and novice programmers just don't mesh well.
     
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Perhaps the question is about making a programming game? I have lots of ideas on that. There are a handful of decent programming games — some of them made in Unity — but none that come close to my "dream" design.

    Of course, dreams are cheap (and so is talk). So, unless and until I actually get around to building it, I'll gladly tip my hat to anybody who makes a decent programming game!

    (Ah, RoboWar... I miss you.)
     
  4. Ixquic2D

    Ixquic2D

    Joined:
    Sep 9, 2014
    Posts:
    25
    Thank you for each answer, in fact, one of the things that i want to prove is that with games every novice programmer can learn to program. Could you please tell me more about handful and decent programming games? That give me good ideas to implement the one i am designing now? :p
     
  5. Not_Sure

    Not_Sure

    Joined:
    Dec 13, 2011
    Posts:
    3,546
    Here's an idea I threw together this week-end and you're welcome to it.

    One Player Pong.

    I got the idea watching Futurama. Leela was playing Pong by herself and I though, "Yeah, why not?"

    So I made a paddle with a square, a ball, two walls on each side of the screen, and a textmesh for the score. The ball and walls had a collider, the ball had a rigidbody, and the paddle had a trigger.

    All four objects were made with blocks.

    I only attached code to the ball and the paddle.

    The ball was programed to add one point each time it hit the paddle and add force upward and horizontally away from the paddle. When it went too far down, it cleared the score and jumped to the start position.

    The paddle was programed to move with the mouse and given a max distance with a simple "if" statement.

    In all it was about 1 hour of work.
     
    AndrewGrayGames likes this.
  6. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    @JoeStrout gave you an excellent example. Robot wars and virus/worm battles were a big thing at one time.
     
  7. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Also look up Light Bot, Cargo Bot, and all the mini-games at Code.org.
     
  8. Gigiwoo

    Gigiwoo

    Joined:
    Mar 16, 2011
    Posts:
    2,981
    What?!? No idea what the OP's after. Perhaps this belongs in the scripting forum...

    Gigi

    PS - Kudos to @GarBenjamin , @JoeStrout , and @Not_Sure for your thoughtful replies. Makes me want to keep this thread.
     
  9. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    http://www.codeavengers.com/

    These guys seem to have had some success gamifying learning programming. Plus I'm friends with the guy who runs the site, so I'll put in a plug for him.
     
    elmar1028 likes this.
  10. Lime_x

    Lime_x

    Joined:
    May 1, 2009
    Posts:
    210
    There are really a lot of good examples of how to learn about programming and about implementing it in action, on this thread.

    One example that I was going to suggest would maybe be something even simpler.
    Something like a questionaire. Where the player has multiple options to answer a question, once the question is answered, the right answer is shown and the next question shows up. This requires very little knowledge of graphics at all and the programmer can focus on the programming problems.
    For example:
    - Practicing 'if-statments' by checking if a button is pressed.
    - Once they've understood that, they can practice 'switch statements', for the different answers the player gets to choose from.
    - If you want to be more advanced, tell the programmer to sort the answers in alphabetic order. (using a 'for-loop', etc)
    It's enough if they sort by the first letter of the sentence.
    - As for 'while'...well I haven't thought of a good example for it yet, but I'm sure you could figure out a way to learn how to use that aswell.

    Like what's already been mentioned before by JoeStrout, I can also recommend Light bot as a good game to understand programming better. (especially for understanding usage functions)

    I wish you best of luck. :)
     
  11. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    C# is a fine place to teach those things. But learning them through unity probably wouldn't be great because of built in things like start and update. I do think games are the best way to learn programming, but programming environments with too much built in stuff could negatively impact what is actually being learned.

    If you're interested in a super basic 2d game, you could do something ui driven like tic tac toe and make the whole thing with the new gui system. You can use your if and loop expressions to check for win conditions.