Results 1 to 10 of 10

Thread: Level files for BreakOut game...

  1. #1

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

    Level files for BreakOut game...

    Hi.
    Anyone know if there's and easy way of creating level files for a breakout game. Right now I am entering all the coordinates of the blocks into a text file, and takes for ever just to make one level!
    Please say there is an easier way....
    my level file has the following format:
    PHP Code:
    xx // number of blocks
    xx yy //coord of block 
    PS: the // comments doesn't exist in the real level file
    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
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    how many variations of blocks are there?

    if there are less than 255 (which I assume there are) then I would just store a marker for each potential block (one marker being for no block present).

    eg:

    assuming the format is:
    width
    height
    one line of blocks
    one line of blocks
    ...

    and the block markers are:

    A = space
    B = standard block
    C = indestructible block

    the file could be:
    5
    3
    BACAB
    BBBBB
    ABCBA


    alternatively, you could write a level editor program to let you just draw the level files.

  3. #3

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544
    I only have one type of blocks at the moment, so I will only need to set the coordinates....
    And I think it would be easier to write the level manually than to write an editor for it
    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
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    you might have only one type of block at the moment, but will you ever add more? if yes, it's best to allow for it now.

    in terms of writing a level editor - how many levels are you going to create? if you use a file format like the one I suggested & it's more than 3 or 4, I would recommend doing an editor.

  5. #5
    Addicted Member NOMADMAN's Avatar
    Join Date
    Aug 2002
    Location
    Closer than you think
    Posts
    237
    if there are less than 255 (which I assume there are) then I would just store a marker for each potential block (one marker being for no block present).
    255? wow what a keyboard, mine only has 96 different characters!

    (because you're using characters in the level file)

    I'm not tring to be an a$$ it just comes natural. I was just curious how you got 255.

    N

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    that's a poor keyboard!

    There are 256* characters in the Ascii chart, not all of them can be done directly on a specific keyboard key, but more than half can (note 'a' <> 'A').

    To see more than just the ones on the keyboard just go into Character Map (under programs-accessories if it is installed), or search VB help for Ascii


    (and yes - I know that using ones that aren't on the keyboard would make it harder, but it's irrelevant for this game).

    *256 characters allows 255 blocks, as one must be an empty space.

  7. #7
    Addicted Member NOMADMAN's Avatar
    Join Date
    Aug 2002
    Location
    Closer than you think
    Posts
    237
    ill count my keyboard and you tell me what im missing to make mine 'poor'.

    alpha w/ shift = 52
    numbers w/ shift = 20
    misc characters w/ shift = 22

    grand total: 94, guess i miss counted before.

    255/2 > 94 so what are the ones im missing to be more than half?

    and yes it is relivate seeing that not all ascii characters can be represented in a text file

    we're splitting hairs here but i thought it was important to correct you when you said that. who knows if someone will find this thread, make a breakout game with ascii as level files and expect to easily make levels by hand.

    NOMAD

  8. #8
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    Originally posted by NOMADMAN
    [B]ill count my keyboard and you tell me what im missing to make mine 'poor'.
    It was a joke, hence the
    (by the way, you forgot tab, and Alt-Gr versions!)

    and yes it is relivate seeing that not all ascii characters can be represented in a text file

    we're splitting hairs here but i thought it was important to correct you when you said that.
    true - there are about 10 to 15 characters you cant put in a text file, and over a hundred more that you can't use by pressing a specific keyboard key.

    who knows if someone will find this thread, make a breakout game with ascii as level files and expect to easily make levels by hand.
    I don't see a game like this needing that many variations, as this style of game only needs 5-10 different types of blocks, maybe 5 colours of each (if different colours are used).

    if for some reason there were more variety required, binary files would be much better.

  9. #9
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    Here! Try my level editor (the game is in the zip too)!

    It stores the bitmap data for each brick and different settings for each brick and it also stores the map - All in one binary file.

    The game is well commented but if you have any questions on how the editor works, just ask.
    Attached Files Attached Files
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  10. #10
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431
    As for the 'over a hundred more that you can't use by pressing a specific keyboard key [combination]', try using Alt+NumpadKey, NumpadKey, NumpadKey. NumpadKey being 0-9 on the number pad

    (Ex. Alt+2, 1, 3 = ¨V [won't show up correctly here]).
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

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