Problem with a game im making

This is a discussion on Problem with a game im making within the Game Programming forums, part of the General Programming Boards category; Im making a top view roleplaying type game that uses a matrix for the world, in which each number in ...

  1. #1
    TheGr8one
    Guest

    Problem with a game im making

    Im making a top view roleplaying type game that uses a matrix for the world, in which each number in the matrix represents a square in the world for now i got a 80x80 matrix and if the number is 0 its red, 1 its green, 2 its blue. Also everytime the user presses up, down, left, or right the world moves with the player one square at time and it re-renders where the user is currenty looking, the player is always in the center of the screen and world moves with the player, what im trying to do is make the player move more smoothly and track where the player is currently at in the matrix instead of the player moving on square at a time which looks bad. The player views the world 20x20 at a time. Any Ideas?

    Thanks
    Chris

  2. #2
    TheGr8one
    Guest
    im using OpenGL to make this game

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    411
    Change your player position variables to floats, and add a second set of variables that are the destination of the player, then move the player a little closer to that spot each time the scene is drawn, If you want cross system support you will have to do a time based movement.

    Now your player will never get exactly on the spot, so you will just have to use an if statement to check if the player is close enough to stop moveing.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem with game code.
    By ajdspud in forum C++ Programming
    Replies: 5
    Last Post: 02-14-2006, 06:39 PM
  2. Problem with drafts game
    By InvertedSaint in forum C Programming
    Replies: 6
    Last Post: 12-21-2005, 10:55 PM
  3. problem with my opegl game...
    By revelation437 in forum Game Programming
    Replies: 6
    Last Post: 11-25-2004, 11:32 AM
  4. Making a game
    By KneeGrow in forum Game Programming
    Replies: 1
    Last Post: 04-16-2004, 01:40 PM
  5. Random Number problem in number guessing game...
    By -leech- in forum Windows Programming
    Replies: 8
    Last Post: 01-15-2002, 05:00 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21