|
-
Dec 10th, 2002, 06:32 AM
#1
Thread Starter
Frenzied Member
Loading new levels
Hi 
I have just finished programming my Breakout game in C++ using DirectX, but the game only has one level....I need some advice in doing the level loading....Should I just create a funtion called LoadLevel and have it take an integer as parameter?? for instance if the user have finished level 1:
PHP Code:
LoadLevel(2); // Load level 2
And then in an a header file write 1000 lines of code to change the position of the blokcs???
Or is there an easier way??(please say there is )
-
Dec 10th, 2002, 07:24 AM
#2
What about making a text file. That contains the position of the blokcs. Something like this:
00122200110
00122201100
00112200012
11111111111
Wher 1=one kind of block 2=an other kind of block and so on.
Then you open up the file. Makes a 2dimensional array. And puts the blocks where they are supposed to be. You can do this for every level. One texy file for every level...
-
Dec 10th, 2002, 07:43 AM
#3
Thread Starter
Frenzied Member
Examples please
-
Dec 10th, 2002, 07:48 AM
#4
Originally posted by CyberCarsten
Examples please
OK, I can't do that in C++. I don't know how to read and write to files in C++. Sorry. But I will tell you if I tumbel over an example...
-
Dec 10th, 2002, 08:53 AM
#5
You can do a search on google on "C++" + "tiles". I did a quick search and found a lot of things. In tile based games, they use the same technique that I talk about....
see if you can get some ideas of this...
Map Editor:
http://www.geocities.com/wonworkers/mapedv1.zip
Google search:
http://www.google.com/search?q=%22c%...e-s%C3%B8k&lr=
-
Dec 10th, 2002, 09:45 AM
#6
Addicted Member
<scratches head and wonders why a post about a C++ game is being made on a VB forum>
-
Dec 10th, 2002, 10:11 AM
#7
Frenzied Member
Originally posted by Machaira
<scratches head and wonders why a post about a C++ game is being made on a VB forum>
As if it really mattered =P. The algorithms are the same, only the syntax differs.
Z.
-
Dec 10th, 2002, 10:12 AM
#8
Frenzied Member
Furthermore, the I believe the longest non Chit Chat thread on these boards is the Times of War thread, which is being written in C++ =)
Z.
-
Dec 10th, 2002, 10:12 AM
#9
Originally posted by Zaei
As if it really mattered =P. The algorithms are the same, only the syntax differs.
Z.
Yes and I tryed with a "algorithm"...but he asks for a sample....but you can C++ can't you Zaei
-
Dec 10th, 2002, 10:18 AM
#10
Frenzied Member
Yes, though the question has been answered in the C++ forum already =P.
I also hate to post code... takes the fun out of learning.
Z.
-
Dec 10th, 2002, 10:20 AM
#11
Yes me to actually, but I find it easyer to explain in vb-languagae then in English....
-
Dec 10th, 2002, 11:01 AM
#12
Thread Starter
Frenzied Member
Thanks all 
I also hate to post code... takes the fun out of learning.
Youre right Zaei
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|