Skip to main content
gamedev.net
🔒 Locked

Loading from a file...

Started by PepsiPlease May 24, 2002 at 10:34 PM 7 replies 550+ views
Original Post
PepsiPlease
PepsiPlease
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
PepsiPlease
PepsiPlease
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.
_the_phantom_
_the_phantom_
t''is all the same princlple really, just a different way of presenting the data on screen
PepsiPlease
PepsiPlease
Ok, I''ll go study tut 10 again...
PepsiPlease
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?
tyreth
tyreth
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.
LockePick
LockePick
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 =)
psijgo
psijgo
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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.