Sign in to follow this  
  • entries
    686
  • comments
    1952
  • views
    385725

MAGIC...er...which day is it again?

Sign in to follow this  
Stompy9999

80 views

Action screenshot:


So yeah, the player is now in the game, and the gameplay has taken shape. Like I hoped, the game makes it easy to break ice and press switches, and less easy to single handedly fight a bunch of enemies. If I can design some good levels, than it should be quite a bit of fun.

Also, I need to come up with a name for it. I'm thinking something like "Trouble in the Tower", but I don't know.

Since this has been the longest I've worked with XNA on a single project, it's been quite a learning experience. I've learned, for instance, that it's probably better to use sprite sheets rather than individual files for each sprite, so I only have to apply the alpha background once. I've learned things about XNA that will help when I start working on my sidescrolling beat-em-up project after Blocky Man.

I can't seem to figure out how to read from files in C# or XNA, so I figure I'll just hardcode the maps for this game. In either case, I need to find out a way to do it tonight, so that I'll be able to get the game ready for submission tomorrow. The game is in no sense polished, but it's playable and interesting.
Sign in to follow this  


3 Comments


Recommended Comments

While not having programmed in either XNA or C# (well, that that much anyway) and I seriously want to keep away from VB (I don't know, it isn't that it's an "easy" language, it's just incompatible with me :P).
I would suggest looking into the "package" System.IO

Share this comment


Link to comment
Quote:
Original post by Stompy9999
I can't seem to figure out how to read from files in C#.


System.IO.StreamReader is pretty easy to use if you want to read text files. You just instatiate one with like:

StreamReader sr=new StreamReader("map.txt");

then you can use sr.Peek() or sr.Read() to read single characters. They both return -1 for EOF.

Obviously it provides a wealth of more higher level reading methods, but based on the two above it's possible to parse a text file in any way you want.

Someone here (Rav, I think) suggested to me reading the whole text file into a string then using the C# regular expression library to parse it. I'm sure they're right but I haven't looked into it yet.

Share this comment


Link to comment
I'll have to look into it after the contest. I thought I wouldn't have enough time before to learn it, but I probably could have. Now I ended up hardcoding the levels, oh well[grin]

Quote:
Someone here (Rav, I think) suggested to me reading the whole text file into a string then using the C# regular expression library to parse it. I'm sure they're right but I haven't looked into it yet.


This was what I was thinking of doing, because it doesn't look as easy to parse a file in C# as in C++. I've gotten so used to using C++'s file streams that anything else seems so much harder.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now