Weekly Qbasic and Qb64 Lesson Topics
April 19, 2024, 01:11:22 pm
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Want to see a specific Tutorial? ASK!
 
  Home Help Search Arcade Links Staff List Login Register  

Duke Nukem Game Rewrite.

Pages: [1] 2 3
  Print  
Author Topic: Duke Nukem Game Rewrite.  (Read 2125 times)
Unseen Machine
Post Demos
*
Posts: 46


« on: June 01, 2011, 08:02:35 pm »

It looks fine Wink, i allways use VQB so i get the Visual Basic style look, i am still making my Wolf3D one and its very complicated (lot's of options/modes that all need accounting for). As for level's, this bit of code converts a two dimensional array (Column, Row) into data style staments in a external file

Code:
            '//Convert level into data style statements
            FOR i% = 1 TO 50 '// Column
                DataString$ = ""
                FOR j% = 1 TO 50 '// Row
                    IF j% > 1 THEN DataString$ = DataString$ + ","
                    DataString$ = DataString$ + STR$(Walls(i%, j%))
                NEXT
                PRINT #1, DataString$
            NEXT

This bit converts it back from the file into data for the array...

Code:
OPEN GameFile$ FOR INPUT AS #1
FOR i% = 1 TO 50
    LINE INPUT #1, DataLine$
    RowCnt% = 1
    FOR j% = 0 TO LEN(DataLine$)
        IF INSTR(j%, DataLine$, ",") > 0 THEN
            Level(i%, RowCnt%) = VAL(MID$(DataLine$, j%, INSTR(j%, DataLine$, ",") - j%))
            j% = INSTR(j%, DataLine$, ",")
            RowCnt% = RowCnt% + 1
        ELSE
            Level(i%, RowCnt%) = VAL(MID$(DataLine$, j%))
        END IF
    NEXT
NEXT

I use them in my Wolf3D editor/game engine and they seem to work pretty well.

If i made you a shell for the editor with VQB would you be ok with that? You can do all the function and graphics code, but i'll make the buttons and thier control structures etc that will enable background, foreground sprite mode...etc. I just think it could save a lot of time in the coding as well as make it pretty, I hope we are aiming to impress the community with this. But i don't want to piss you off or overstep the mark, afterall it's your project, feel free to tell me to back/f off if you want Wink.

All the best mate,

John

p.s Here is VQB02 if you dont have it...http://dl.dropbox.com/u/8822351/VQB02.zip
Report Spam   Logged

Pages: [1] 2 3
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum


Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy