moving a object

Discussion in 'C' started by thapchi, Mar 10, 2010.

  1. thapchi

    thapchi New Member

    Joined:
    Mar 9, 2010
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    Can anybody tell me how to move a object in c++

    Like if i am making a game

    I have not started dont ask me about code

    So if i am making a game and my character is this @ then i want to move @ how can i move it in game

    like when i press the arrow keys it should move

    can anybody give me a little eg.

    like make a program and move @ when we press arrow keys
     
  2. thapchi

    thapchi New Member

    Joined:
    Mar 9, 2010
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    sorry i forgot to mention its a console program
     
  3. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    First display the @ at the starting position.
    When the user presses a key, determine the new position, write a space to the old position and the @ to the new position.
    This will give the impression that the @ has moved.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice