Results 1 to 16 of 16
  1. #1
    drens is offline Member
    Join Date
    Jun 2010
    Posts
    9
    Rep Power
    0

    Default Best way to make an ASCII game?

    I'm pretty clueless on this one. How do I go about making a game using only ASCII characters? (including filled blocks, etc that are found in other ASCII games)

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  3. #3
    drens is offline Member
    Join Date
    Jun 2010
    Posts
    9
    Rep Power
    0

    Default

    I think I know most of what I need as far as what goes on "behind the scenes". I know about methods, classes, arrays, loops, recursion, whatever. Input-and-output-wise, I've gotten input through System.in and output through System.out for mathematical problems without any GUIs, but obviously they won't help. The last 2 days I've taught myself through google how to make a game with full graphics with java.awt. I've just never done anything quite like this, so I don't know what kinds of libraries I need and how to set it up.
    Last edited by drens; 06-13-2010 at 05:10 AM.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Maybe I'm the one that's confused. What do you mean precisely by making an "ASCII Game" and "filled blocks"?

  5. #5
    drens is offline Member
    Join Date
    Jun 2010
    Posts
    9
    Rep Power
    0

    Default

    Sorry if I'm not explaining myself well... I'm never good at that. So I'm going to pull up a picture.

    The game Kroz is an old game that uses only ASCII text for graphics, but there are some extra "block" characters, like the filled brown blocks and filled blue blocks to the right side. For now I don't really care about those blocks, or the colours, I'd just like to get the basic text working.

    edit: The answer was much simpler than I thought, Graphics.drawString(). I was thinking of Graphics as something that just draws images when I made this thread. I was probably thinking too hard. Thanks anyway, you can ignore this thread.
    edit: Well that's STILL not quite the same, but it seems to be the best I can do.
    Last edited by drens; 06-13-2010 at 07:22 PM.

  6. #6
    MarsTeam is offline Member
    Join Date
    Jun 2010
    Posts
    8
    Rep Power
    0

    Default

    those filled block aren't any extra characters, they can be found on various places at ASCII character map.

  7. #7
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,337
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by drens View Post
    I'm pretty clueless on this one. How do I go about making a game using only ASCII characters? (including filled blocks, etc that are found in other ASCII games)
    You don't just want to use the ASCII characters in the range 0x00 - 0x7f but you also want to use characters from a 'code page' (characters in the range 0x80 - 0xff). Unicode doesn't have code pages, those pages are a mess. Unicode does have those 'glyphs' (character shapes) but they have different code points (i.e. not all in the range 0x80 - 0xff).

    kind regards,

    Jos

  8. #8
    drens is offline Member
    Join Date
    Jun 2010
    Posts
    9
    Rep Power
    0

    Default

    Quote Originally Posted by MarsTeam View Post
    those filled block aren't any extra characters, they can be found on various places at ASCII character map.
    Quote Originally Posted by JosAH View Post
    You don't just want to use the ASCII characters in the range 0x00 - 0x7f but you also want to use characters from a 'code page' (characters in the range 0x80 - 0xff). Unicode doesn't have code pages, those pages are a mess. Unicode does have those 'glyphs' (character shapes) but they have different code points (i.e. not all in the range 0x80 - 0xff).

    kind regards,

    Jos
    Thanks for the tip, I didn't realize.

    Also, I haven't found a clean way to make the engine - I can only fake it by making a grid and printing the characters spaced evenly with a proper font. Is there no better way to do this?
    Last edited by drens; 06-14-2010 at 05:59 PM.

  9. #9
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,337
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by drens View Post
    Thanks for the tip, I didn't realize.

    Also, I haven't found a clean way to make the engine - I can only fake it by making a grid and printing the characters spaced evenly with a proper font. Is there no better way to do this?
    As I wrote Unicode doesn't have code pages; they were a mess and don't exist anymore. You have to find a mono spaced font (every character takes up the same width) and that font has to be capable of displaying those funny characters you want. Maybe the Courier New font can do it.

    kind regards,

    Jos

  10. #10
    drens is offline Member
    Join Date
    Jun 2010
    Posts
    9
    Rep Power
    0

    Default

    Quote Originally Posted by JosAH View Post
    As I wrote Unicode doesn't have code pages; they were a mess and don't exist anymore. You have to find a mono spaced font (every character takes up the same width) and that font has to be capable of displaying those funny characters you want. Maybe the Courier New font can do it.

    kind regards,

    Jos
    I already found one - Perfect DOS VGA. Using an app called fontshower I looked at it and it has the special characters.

  11. #11
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,337
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by drens View Post
    I already found one - Perfect DOS VGA. Using an app called fontshower I looked at it and it has the special characters.
    Is that a font you can download?

    kind regards,

    Jos

  12. #12
    drens is offline Member
    Join Date
    Jun 2010
    Posts
    9
    Rep Power
    0

    Default

    Quote Originally Posted by JosAH View Post
    Is that a font you can download?

    kind regards,

    Jos
    Yes, the download button's on the right.

    The only problem is that the characters are spaced 1 pixel farther away from each other than normal... it doesn't matter the way I'm drawing them though.
    (Yes, I am a VERY BIG nitpick!)

  13. #13
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,337
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by drens View Post
    Yes, the download button's on the right.

    The only problem is that the characters are spaced 1 pixel farther away from each other than normal... it doesn't matter the way I'm drawing them though.
    (Yes, I am a VERY BIG nitpick!)
    What do you mean by "1 pixel farther away than normal"? It's a monospaced font isn't it? And what is "normal"?

    kind regards,

    Jos

  14. #14
    drens is offline Member
    Join Date
    Jun 2010
    Posts
    9
    Rep Power
    0

    Default

    Quote Originally Posted by JosAH View Post
    What do you mean by "1 pixel farther away than normal"? It's a monospaced font isn't it? And what is "normal"?

    kind regards,

    Jos
    It is, but each letter has slightly more extra space to the right than in the command prompt. Not a huge deal, I'm just really picky.
    Last edited by drens; 06-14-2010 at 09:44 PM.

  15. #15
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,337
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by drens View Post
    It is, but each letter has slightly more extra space to the right than in the command prompt. Not a huge deal, I'm just really picky.
    You could create a little image from each glyph and have its rightmost column removed; you will end up with a lot of small images though ...

    kind regards,

    Jos

  16. #16
    drens is offline Member
    Join Date
    Jun 2010
    Posts
    9
    Rep Power
    0

    Default

    Quote Originally Posted by JosAH View Post
    You could create a little image from each glyph and have its rightmost column removed; you will end up with a lot of small images though ...

    kind regards,

    Jos
    Nah, it's already fixed, I just made a 2D array of chars and printed them out in 8x16 cells instead of whatever it would be otherwise. (I was planning on doing that anyway, so everything worked out okay.) Hopefully it won't make too many problems crop up later. :)

Similar Threads

  1. Help to make a game ???
    By Peter20 in forum Java Applets
    Replies: 3
    Last Post: 05-10-2010, 05:36 AM
  2. Replies: 6
    Last Post: 12-15-2009, 02:33 AM
  3. Help to make memory game :=)
    By arian88 in forum AWT / Swing
    Replies: 7
    Last Post: 10-15-2009, 06:23 AM
  4. Replies: 3
    Last Post: 04-20-2009, 09:53 PM
  5. how to make mastermind game
    By javabeginer in forum New To Java
    Replies: 10
    Last Post: 04-14-2009, 02:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •