Thread: Help getting started on Rogue

  1. #1
    Registered User
    Join Date
    Jan 2013
    Posts
    7

    Help getting started on Rogue

    I've been assigned to program rogue using the ncurses library, which wil need
    1. File I/O
    2. String parsing
    3. User input (h,j,k,l)
    4. Room drawing

    And i have no idea where to start.
    Can anyone give me some advice where i can start with this program?

  2. #2
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    Well, I'd first start by listing out what components your design has and how they relate to one another, so you have a big picture view of what you need to do.

    When I tackle a large project I tackle the model first (i.e. the internal representation of the data). In your case, that would be how you store the room, how you store the relationships between rooms, how you store objects inside rooms, etc. Once that's done, other components become easier to deal with.
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

  3. #3
    Registered User
    Join Date
    Jan 2013
    Posts
    7
    Store the room as in which files to place it in?
    Or would drawing the room come first?

  4. #4
    Registered User
    Join Date
    May 2003
    Posts
    1,619
    Well, file I/O is really about how to load and save the data. Drawing the room is about how to visualize the data. The model is how to represent the data itself.

    For example, what kind of structs will you use to store the data, etc.

    For example, in chess, maybe I would make a Board struct that contained a 64-element long array representing the 64 positions on the game board, each of which could either be null (empty) or a pointer to a Piece struct. The piece struct would have a member that described which type of piece it was (pawn, king, rook, etc.) and a color (white or black). The model might also have some helper functions to get the piece at an x,y coordinate or to move a piece from one position to another, validating the move was legal.

    Displaying the board to a human is separate from the model - that's generally called a view in architectural patterns. The view is a human-friendly representation of the data that is stored in the model.
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

  5. #5
    Registered User
    Join Date
    Jan 2013
    Posts
    7
    So i'll have to make a whole new file jsut for storing the actually game?
    Dayum time to google how to do that

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++: Writing game program...Rogue-Like?
    By rvbplayer123 in forum C++ Programming
    Replies: 1
    Last Post: 12-06-2012, 04:23 PM
  2. rogue - the screen shot collection
    By Salem in forum General Discussions
    Replies: 8
    Last Post: 05-23-2011, 05:44 PM
  3. Rogue Dao Studios is looking for 1-2 C# programmers
    By roguedaostudios in forum Projects and Job Recruitment
    Replies: 2
    Last Post: 08-10-2010, 09:33 PM
  4. Rogue Leader
    By Scourfish in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 11-15-2001, 12:51 PM
  5. rogue spear fans only..
    By abhiboy007 in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 09-16-2001, 10:42 AM