Results 1 to 12 of 12

Thread: Loading new levels

  1. #1

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544

    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 )
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  2. #2
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    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...

  3. #3

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    Examples please
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

  4. #4
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    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...

  5. #5
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    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=

  6. #6
    Addicted Member
    Join Date
    Aug 2002
    Location
    Baltimore, MD
    Posts
    230
    <scratches head and wonders why a post about a C++ game is being made on a VB forum>

  7. #7
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    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.

  8. #8
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    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.

  9. #9
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    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

  10. #10
    Frenzied Member Zaei's Avatar
    Join Date
    Jul 2002
    Location
    My own little world...
    Posts
    1,710
    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.

  11. #11
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Yes me to actually, but I find it easyer to explain in vb-languagae then in English....

  12. #12

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    Thanks all
    I also hate to post code... takes the fun out of learning.
    Youre right Zaei
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width