Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
Z

Zeikcied

@Zeikcied
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Text file parsing
    Z Zeikcied

    Ok, well, it's a puzzle game much like PopCap's Mummy Maze. The parts that I would put in a text file is simply the starting point of the player and enemy (or enemies), the exit, and the walls. All of which I currently have hard coded into an array. Since I only have one level, it seems nice enough, but on a 25x25 grid, and a two dimensional array, it takes a lot of lines of manual code to fill it up for just one level. That's why I don't want to have to hard code several levels. It would be so much easier if I could just compile the program once, and just add files as I go along, thus adding more levels. Sure, cheaters could just place themselves next to the exit, but what is the fun in that? As for all this serializing stuff...I don't think I have learned that yet. Also, I work much better with examples. Preferably commented examples. So, could you please point me toward one? I would very much appreciate it. I know how to open files and use the stremreader, but I only know how to use the StreamReader for one line at a time, though I suppose I could use a For loop to go through the characters and then use a Switch...Case statement to parse the text into the correct object for the array. But I was hoping for something easier. Assuming it is possible to make it easier.

    C# csharp game-dev data-structures json help

  • Text file parsing
    Z Zeikcied

    I have an unfinished C# puzzle game I wrote, and I want to change it to use a text file to load the levels by parsing the text. I don't know how exactly to do it. I would also like to be able to read a directory and list each text file in an array, so I don't have to alter the code to add new levels. Can someone please help?

    C# csharp game-dev data-structures json help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups