Loading from a file...

Started by
7 comments, last by PepsiPlease 21 years, 11 months ago
Hey, I was wondering, are there any good tutorials or does anyone have any good tips on how to load levels from a file. I don''t want the actual code itself, just to be pointed in the right direction, so I can learn it myself. Thanks
Advertisement
Goto http://nehe.gamedev.net.

There are lots of tutorials including one or two on loading levels.
I have read those tutorials, like number 10, but they deal with a fps environment, and the game I am currently developing is more of an isometric/3d view. I was wondering if there is a more specific tutorials on the type of game I have.
t''is all the same princlple really, just a different way of presenting the data on screen
Ok, I''ll go study tut 10 again...
You know, I still think that''s kind of complicated. Since my game is simple, couldn''t I just do something like:

(.txt file)
1111111111111
1000000000001
2000000000111
2000000000001
1000000000001
1111111111111

(in code)
if(n==1)
{
drawCement();
}

if(n==2)
{
drawWood();
}

else if(n==0)
{
drawFloor();
}




Would something like that work?
You have an idea, so try it. Think about it. I''ve often tried to think of ways to solve a particular task for game programming, come up with a solution, then later discovered a tutorial that describes the exact same method I devised.
You''ve discovered tilemapping. Now run with it =)
You''ll find as you try out techniques like this it''ll slowly start to evolve on you (been experiencing this a lot myself). Best way to learn is to try out all your ideas, see what works and what doesn''t, what can be done better, what you should avoid like the plague.
Try that idea, tweak it to your needs, tear it all down if you need to. You''ll gain much more skill working with these things instead of hanging around here =)
_______________________________________Pixelante Game Studios - Fowl Language
quote:Original post by PepsiPlease
You know, I still think that''s kind of complicated. Since my game is simple, couldn''t I just do something like:

(.txt file)
1111111111111
1000000000001
2000000000111
2000000000001
1000000000001
1111111111111

(in code)
if(n==1)
{
drawCement();
}

if(n==2)
{
drawWood();
}

else if(n==0)
{
drawFloor();
}




Would something like that work?


yes, in fact this is how the tutorial tells you to do it..
see http://www.gamedev.net/reference/articles/article1256.asp

This topic is closed to new replies.

Advertisement