Author Topic: Game Engine | ASCII Terrain Engine v.1.2  (Read 4997 times)

0 Members and 1 Guest are viewing this topic.

Offline Virtusoroca

  • Newbie
  • Posts: 24
    • View Profile
Game Engine | ASCII Terrain Engine v.1.2
« on: May 03, 2020, 07:47:12 pm »
Hello everyone. Just arrived. Excited with QB64 and the forum. Finished my first program since the mid '90s! Its a very limited game engine focused on ASCII characters, where you can load customized maps and players from txt files, with collision detection (Players x Maps), and DebugMode. My time is running out so I skiped some demo scenes I planned and decided to share what I have. Looking forward to some harsh comments, particulary regarding collision detection. Start: unpack everything in QB root and hit run. For more: take a look at README.TXT.

Code: QB64: [Select]
  1. '=======================================================1.     IDENTIFICATION
  2. 'ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  3. 'º ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ  ASCII TERRAIN ENGINE  ÛÛßßÛÛ ÛÛßßÛÛ º
  4. 'º ÛÛ     Û     ÛÛ         v.1.2          ÛÛ ÞÛÛ ÛÛÛÛÛ  º [attachment=1]
  5. 'º ÛÛ  Û  Û  Û  ÛÛ                        ÛÛÜÞÛÛ ÛÛÜÜÛÛ º
  6. 'º    Û  Û  Û     For Game Developers     ßß          º
  7. 'º ÛÛ  Û  Û  Û  ÛÛ  By Virtusoroca, 2020  ÛÛßßßß ÛÛ  ÛÛ º
  8. 'º ÛÛ  Û     Û  ÛÛ      Made in QB64      ÛÛßßÛÛ ÛÛÜÜÛÛ º
  9. 'º ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ  For more: README.TXT  ÛÛÜÜÛÛ     ÛÛ º
  10. 'ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  11. '========================================================================================2. SYSTEM SETTINGS
  12. WindowWidth = 1200 '                                                                        Sets Window Width with 1200 pixels
  13. WindowHeight = 800 '                                                                        Sets Window Height with 800 pixels
  14. ColorMode = 256 '                                                                           Sets Color Mode with 256 colors
  15. SCREEN _NEWIMAGE(WindowWidth, WindowHeight, ColorMode) '                                    Sets Window: 1200x800, 256 colors
  16. _SCREENMOVE _DESKTOPWIDTH / 2 - (WindowWidth / 2), _DESKTOPHEIGHT / 2 - (WindowHeight / 2) 'Puts Window in the middle of the desktop screen
  17. _TITLE "Ascii Terrain Engine v. 1.2" '                                                      Asign title to the window
  18. OPTION BASE 1 '                                                                             Sets first element of arrays to 1 not 0
  19. '=======================================================3.     DECLARATIONS
  20. '-------------------------------------------------------3.1.   Subroutines
  21. '.......................................................3.1.1. Maps
  22. DECLARE SUB LoadMapStructure ()'                               Loads MapStructure files (0s and 1s)
  23. DECLARE SUB ReadMapStructure ()'                               Interprets MapStructure files (0s and 1s)
  24. DECLARE SUB LoadMapDesign ()'                                  Loads MapDesign files
  25. DECLARE SUB PrintMapDesign ()'                                 Prints MapDesign on screen
  26. '.......................................................3.1.2. Players
  27. DECLARE SUB LoadPlayerStructure ()'                            Loads PlayerStructure files (0s and 1s)
  28. DECLARE SUB ReadPlayerStructure ()'                            Interprets PlayerStructure files (0s and 1s)
  29. DECLARE SUB LoadPlayerDesign ()'                               Loads PlayerDesign files
  30. DECLARE SUB PrintPlayerDesign ()'                              Prints PlayerDesign on screen
  31. DECLARE SUB MovePlayer ()'                                     Detect keyboard input and calculates collision events
  32. '.......................................................3.1.3. General
  33. DECLARE SUB LoadIntro ()'                                      Loads information from System files
  34. DECLARE SUB PrintIntro ()'                                     Prints system information on screen
  35. DECLARE SUB LoadGame ()'                                       Executes the load/read files routines
  36. DECLARE SUB ChangeLevel ()'                                    Stores conditions and executes maps transitions
  37. DECLARE SUB DebugScreen ()'                                    Prints status for debug (right side of the screen)
  38. '-------------------------------------------------------3.2.   Types
  39. '.......................................................3.2.1. Files
  40. TYPE FilesLibrary '                                            Stores loaded files information
  41.     h AS INTEGER '                                             Hight
  42.     w AS INTEGER '                                             Width
  43.     a AS INTEGER '                                             Area
  44.     p AS STRING '                                              File path
  45.     t AS STRING '                                              Title
  46.     tx AS INTEGER '                                            X Coordinates for Title
  47.     ty AS INTEGER '                                            Y Coordinates for Title
  48. END TYPE '                                                     Closes Type declaration
  49. TYPE FileLines '                                               Stores data extracted from loaded files
  50.     n AS STRING '                                              As ASCII sequence
  51. END TYPE '                                                     Closes Type declaration
  52. TYPE FileTiles '                                               Stores interpreted characters extracted from lines
  53.     x AS INTEGER '                                             X Coordinate
  54.     y AS INTEGER '                                             Y Coordinate
  55.     s AS STRING '                                              Stores "structure" tile
  56.     d AS STRING '                                              Stores "design" tile
  57.     b AS INTEGER '                                             Stores block property (1=True)
  58. END TYPE '                                                     Closes Type declaration
  59. '.......................................................3.2.2. Players
  60. TYPE Players '                                                 Stores Players information
  61.     x AS INTEGER '                                             X Coordinate
  62.     y AS INTEGER '                                             Y coordinate
  63.     a AS INTEGER '                                             Active (1=True)
  64.     b AS INTEGER '                                             Blocked move (1=True)
  65.     d AS STRING '                                              Direction
  66.     v AS INTEGER '                                             Visibility range
  67. END TYPE '                                                     Closes Type declaration
  68. '.......................................................3.2.2. Fields
  69. TYPE Fields '                                                  Stores field calculations (currently: collision events)
  70.     b AS INTEGER '                                             Blocking check (1=True)
  71. END TYPE '                                                     Closes Type declaration
  72. '-------------------------------------------------------3.3.   Variables (Part1)
  73. '.......................................................3.3.1. General
  74. DIM SHARED KeyPress AS STRING '                                Stores keyboard input
  75. DIM SHARED SkipIntro AS INTEGER '                              Stores Intro status
  76. DIM SHARED DebugMode AS INTEGER '                              Stores Debug status
  77. DIM SHARED NumSystemFiles AS INTEGER '                         Stores number of system files
  78. SkipIntro = 0 '                                                Option (0=False, 1= TRUE)
  79. DebugMode = 0 '                                                Option (0=False, 1= TRUE)
  80. NumSystemFiles = 3 '                                           Specifies the number SystemFiles to handle
  81. '.......................................................3.3.2. Maps
  82. DIM SHARED NumLevels AS INTEGER '                              Stores the total number of maps
  83. DIM SHARED CurrentLevel AS INTEGER '                           Stores the map currently active
  84. NumLevels = 2 '                                                Specifies the total number of maps
  85. CurrentLevel = 1 '                                             Specifies the maps currently active
  86. '.......................................................3.3.3, Players
  87. DIM SHARED NumPlayers AS INTEGER '                             Stores the total number of Players
  88. NumPlayers = 2 '                                               Specifies the total number of Players
  89. '-------------------------------------------------------3.4.   Arrays (Part 1)
  90. '.......................................................3.4.1. General
  91. DIM SHARED SystemFile(NumSystemFiles) AS FilesLibrary '        Creates a type array of (currently) 3 elements for handling SystemFlies
  92. '.......................................................3.4.2. Maps
  93. DIM SHARED MapStructure(NumLevels) AS FilesLibrary '           Creates a type array of (currently) 2 elements for handling MapStructure files
  94. DIM SHARED MapDesign(NumLevels) AS FilesLibrary '              Creates a type array of (currently) 2 elements for handling MapDesign files
  95. '.......................................................3.4.3. Players
  96. DIM SHARED PlayerStructure(NumPlayers) AS FilesLibrary '       Creates a type array of (currently) 2 elements for handling PlayersStructure files
  97. DIM SHARED PlayerDesign(NumPlayers) AS FilesLibrary '          Creates a type array of (currently) 2 elements for handling PlayersDesign files
  98. DIM SHARED Player(NumPlayers) AS Players '                     Creates a type array of (currently) 2 elements for handling Players on screen
  99. '-------------------------------------------------------3.5.   Variables (Part2)
  100. '.......................................................3.5.1. General
  101. SystemFile(1).p = "./AppTitle.txt" '                           Specifies file path to the Title image on Intro screen
  102. SystemFile(1).h = 23 '                                         Specifies height of the same file
  103. SystemFile(1).w = 51 '                                         Specifies width of the same file
  104. SystemFile(2).p = "./AppLogo.txt" '                            Specifies file path to the Logo image on Intro screen
  105. SystemFile(2).h = 7 '                                          Specifies height of the same file
  106. SystemFile(2).w = 15 '                                         Specifies width of the same file
  107. SystemFile(3).p = "./AppInfo.txt" '                            Specifies file path to the QB64 logo and additional info on Intro screen
  108. SystemFile(3).h = 16 '                                         Specifies height of the same file
  109. SystemFile(3).w = 28 '                                         Specifies width of the same file
  110. '.......................................................3.5.2. Maps
  111. FOR A = 1 TO NumLevels '                                       Initiate loop for 1 to (currently) 2
  112.     MapStructure(A).h = 45 '                                   Assigns height for all MapStructure files to be loaded
  113.     MapStructure(A).w = 100 '                                  Assigns height for all MapStructure files to be loaded
  114.     MapStructure(A).a = MapStructure(A).h * MapStructure(A).w 'Calculates and asigns the area of all MapStructure files to be loaded
  115. NEXT '                                                         End of loop
  116. MapStructure(1).p = "./MapStructure1.txt" '                    Specifies the path for MapStructure file of Level 1
  117. MapDesign(1).p = "./MapDesign1.txt" '                          Specifies the path for MapDesign file of Level 1
  118. MapDesign(1).t = "DEMO 1 RogueLike" '                          Specifies the name for MapDesign file of Level 2
  119. MapDesign(1).tx = 12 '                                         Specifies the X coordinate for Title of Level 1
  120. MapDesign(1).ty = 72 '                                         Specifies the Y coordinate for Title of Level 1
  121. MapStructure(2).p = "./MapStructure2.txt" '                    Specifies the path for MapStructure file of Level 2
  122. MapDesign(2).p = "./MapDesign2.txt" '                          Specifies the path for MapDesign file of Level 2
  123. MapDesign(2).t = "DEMO 2 UnderDevelopment" '                   Specifies the name for MapDesign file of Level 1
  124. MapDesign(2).tx = 2 '                                          Specifies the X coordinate for Title of Level 2
  125. MapDesign(2).ty = 2 '                                          Specifies the X coordinate for Title of Level 2
  126. '.......................................................3.5.3. Players
  127. PlayerStructure(1).p = "./PlayerStructure1.txt" '              Specifies the path for PlayerStructure file of Player 1
  128. PlayerDesign(1).p = "./PlayerDesign1.txt" '                    Specifies the path for PlayerDesign file of Player 1
  129. PlayerStructure(1).h = 3 '                                     Specifies the hight of PlayerStructure file of Player 1
  130. PlayerStructure(1).w = 3 '                                     Specifies the width of PlayerStructure file of Player 1
  131. Player(1).a = 1 '                                              Sets Player 1 as active for Level 1
  132. Player(1).x = 22 '                                             Sets x coordinate for start position of Player 1
  133. Player(1).y = 79 '                                             Sets y coordinate for start position of Player 1
  134. Player(1).d = "Still" '                                        Sets starting direction label of Player 1
  135. PlayerStructure(2).p = "./PlayerStructure1.txt" '              Specifies the path for PlayerStructure file of Player 2
  136. PlayerDesign(2).p = "./PlayerDesign1.txt" '                    Specifies the path for PlayerDesign file of Player 2
  137. PlayerStructure(2).h = 3 '                                     Specifies the hight of PlayerStructure file of Player 2
  138. PlayerStructure(2).w = 3 '                                     Specifies the width of PlayerStructure file of Player 2
  139. Player(2).a = 1 '                                              Sets Player 1 as active for Level 1
  140. Player(2).x = 22 '                                             Sets x coordinate for start position of Player 2
  141. Player(2).y = 76 '                                             Sets y coordinate for start position of Player 2
  142. Player(2).d = "Still" '                                        Sets starting direction label of Player 2
  143. '---------------------------------------------------------------------------------------------------------------3.6.   Arrays (Part 2)
  144. '...3.6.1. General
  145. DIM SHARED SystemLine(NumSystemFiles, SystemFile(1).h) AS FileLines '                                           Creates a type array to store line strings of loaded files (System)
  146. '...3.6.2. Maps
  147. DIM SHARED MapLine(NumLevels, MapStructure(NumLevels).h) AS FileLines '                                         Creates a type array to store line strings extracted of loaded files (Maps)
  148. DIM SHARED MapTile(NumLevels, MapStructure(NumLevels).h, MapStructure(NumLevels).w) AS FileTiles '              Creates a type array to store tiles (characters) extracted from loaded lines (Maps)
  149. '...3.6.3. Players
  150. DIM SHARED PlayerTile(NumPlayers, PlayerStructure(NumPlayers).h, PlayerStructure(NumPlayers).w) AS FileTiles '  Creates a type array to store line strings extracted of loaded files (Players)
  151. DIM SHARED PlayerLine(NumPlayers, PlayerStructure(NumPlayers).h) AS FileLines '                                 Creates a type array to store tiles (characters) extracted from loaded lines (Players)
  152. DIM SHARED PlayerCollisionField(NumPlayers, 3, 3) AS Fields '                                                   Creates a type array of (currently) 18 positions to store collision calculation for current direction of Player (2 x 3x3 characters)
  153. '=======================================================4.     MAIN ROUTINE
  154. LoadIntro '                                                    See "Declarations" above
  155. PrintIntro '                                                   See "Declarations" above
  156. LoadGame '                                                     See "Declarations" above
  157. PRINT "Loading data..." '                                      Gives the program a few seconds to data sink in
  158. _DELAY 3 '                                                     Sets a 3 seconds delay before start
  159. DO '                                                           Initiates Game as a DO/UNTIL loop
  160.     ChangeLevel '                                              See "Declarations" above
  161.     _LIMIT 60 '                                                Sets the refresh rate of the screen at 30 frames per second
  162.     KeyPress = UCASE$(INKEY$) '                                Reads user input on keyboard
  163.     MovePlayer '                                               See "Declarations" above
  164.     PCOPY _DISPLAY, 1 '                                        Stores the screen currently displayed as 1
  165.     PrintMapDesign '                                           See "Declarations" above
  166.     PrintPlayerDesign '                                        See "Declarations" above
  167.     DebugScreen '                                              See "Declarations" above
  168.     _DISPLAY '                                                 Turns off auto refresh of screen (avoids flickering)
  169.     PCOPY 1, _DISPLAY '                                        Reloads screen previously stored as 1, considering changes (as movement)
  170. LOOP UNTIL KeyPress = "Q" '                                    Closes game loop when "Q" is pressed
  171. CLS '                                                          Clear the screen
  172. END '                                                          Ends the program
  173. '=======================================================5.     SUB ROUTINES
  174. '-------------------------------------------------------5.1.   LoadIntro
  175. SUB LoadIntro
  176.     IF SkipIntro = 0 THEN
  177.         FOR B = 1 TO NumSystemFiles
  178.             OPEN SystemFile(B).p FOR INPUT AS #1
  179.             FOR A = 1 TO SystemFile(B).h
  180.                 INPUT #1, SystemLine(B, A).n
  181.             NEXT A
  182.             CLOSE #1
  183.         NEXT B
  184.     END IF
  185. '-------------------------------------------------------5.2.   PrintIntro
  186. SUB PrintIntro
  187.     IF SkipIntro = 0 THEN
  188.         COLOR 25
  189.         FOR A = 1 TO SystemFile(1).h
  190.             LOCATE A + 4, (150 - SystemFile(1).w) / 2
  191.             PRINT SystemLine(1, A).n
  192.         NEXT
  193.         FOR A = 1 TO SystemFile(2).h
  194.             LOCATE A + 5, 84
  195.             PRINT SystemLine(2, A).n
  196.         NEXT
  197.         COLOR 29
  198.         FOR A = 1 TO SystemFile(3).h
  199.             LOCATE A + SystemFile(1).h + 6, (150 - SystemFile(3).w) / 2
  200.             PRINT SystemLine(3, A).n
  201.         NEXT
  202.         DO UNTIL INKEY$ <> ""
  203.         LOOP
  204.     END IF
  205. '-------------------------------------------------------5.3.   LoadGame
  206. SUB LoadGame
  207.     CLS
  208.     LoadMapStructure
  209.     ReadMapStructure
  210.     LoadMapDesign
  211.     LoadPlayerStructure
  212.     ReadPlayerStructure
  213.     LoadPlayerDesign
  214. '-------------------------------------------------------5.4.   LoadMapStructure
  215. SUB LoadMapStructure
  216.     OPEN MapStructure(CurrentLevel).p FOR INPUT AS #1
  217.     FOR A = 1 TO MapStructure(CurrentLevel).h
  218.         INPUT #1, MapLine(CurrentLevel, A).n
  219.         FOR B = 1 TO MapStructure(CurrentLevel).w
  220.             MapTile(CurrentLevel, A, B).s = MID$(MapLine(CurrentLevel, A).n, B, 1)
  221.         NEXT B
  222.     NEXT A
  223.     CLOSE #1
  224. '-------------------------------------------------------5.5.   LoadPlayerStructure
  225. SUB LoadPlayerStructure
  226.     FOR C = 1 TO NumPlayers
  227.         IF Player(C).a = 1 THEN
  228.             OPEN PlayerStructure(C).p FOR INPUT AS #1
  229.             FOR A = 1 TO PlayerStructure(C).h
  230.                 INPUT #1, PlayerLine(C, A).n
  231.                 FOR B = 1 TO PlayerStructure(C).w
  232.                     PlayerTile(C, A, B).s = MID$(PlayerLine(C, A).n, B, 1)
  233.                 NEXT B
  234.             NEXT A
  235.             CLOSE #1
  236.         END IF
  237.     NEXT C
  238. '-------------------------------------------------------5.6.   ReadMapStructure
  239. SUB ReadMapStructure
  240.     FOR A = 1 TO MapStructure(CurrentLevel).h
  241.         FOR B = 1 TO MapStructure(CurrentLevel).w
  242.             SELECT CASE MapTile(CurrentLevel, A, B).s
  243.                 CASE "0"
  244.                     MapTile(CurrentLevel, A, B).b = 0
  245.                 CASE "1"
  246.                     MapTile(CurrentLevel, A, B).b = 1
  247.             END SELECT
  248.         NEXT B
  249.     NEXT A
  250. '-------------------------------------------------------5.7.   ReadPlayerStructure
  251. SUB ReadPlayerStructure
  252.     FOR C = 1 TO NumPlayers
  253.         IF Player(C).a = 1 THEN
  254.             FOR A = 1 TO PlayerStructure(C).h
  255.                 FOR B = 1 TO PlayerStructure(C).w
  256.                     SELECT CASE PlayerTile(C, A, B).s
  257.                         CASE "0"
  258.                             PlayerTile(C, A, B).b = 0
  259.                         CASE "1"
  260.                             PlayerTile(C, A, B).b = 1
  261.                     END SELECT
  262.                 NEXT B
  263.             NEXT A
  264.         END IF
  265.     NEXT C
  266. '-------------------------------------------------------5.8.   LoadMapDesign
  267. SUB LoadMapDesign
  268.     OPEN MapDesign(CurrentLevel).p FOR INPUT AS #1
  269.     FOR A = 1 TO MapStructure(CurrentLevel).h
  270.         INPUT #1, MapLine(CurrentLevel, A).n
  271.         FOR B = 1 TO MapStructure(CurrentLevel).w
  272.             MapTile(CurrentLevel, A, B).d = MID$(MapLine(CurrentLevel, A).n, B, 1)
  273.         NEXT B
  274.     NEXT A
  275.     CLOSE #1
  276. '-------------------------------------------------------5.9.   LoadPlayerDesign
  277. SUB LoadPlayerDesign
  278.     FOR C = 1 TO NumPlayers
  279.         IF Player(C).a = 1 THEN
  280.             OPEN PlayerDesign(C).p FOR INPUT AS #1
  281.             FOR A = 1 TO PlayerStructure(C).h
  282.                 INPUT #1, PlayerLine(C, A).n
  283.                 FOR B = 1 TO PlayerStructure(C).w
  284.                     PlayerTile(C, A, B).d = MID$(PlayerLine(C, A).n, B, 1)
  285.                 NEXT B
  286.             NEXT A
  287.             CLOSE #1
  288.         END IF
  289.     NEXT C
  290. '-------------------------------------------------------5.10.  PrintMapDesign
  291. SUB PrintMapDesign
  292.     COLOR 23
  293.     FOR A = 1 TO MapStructure(CurrentLevel).h
  294.         FOR B = 1 TO MapStructure(CurrentLevel).w
  295.             IF DebugMode = 0 THEN
  296.                 LOCATE A, B
  297.                 PRINT MapTile(CurrentLevel, A, B).d
  298.             ELSEIF DebugMode = 1 THEN
  299.                 IF MapTile(CurrentLevel, A, B).s = "1" THEN
  300.                     LOCATE A, B
  301.                     PRINT MapTile(CurrentLevel, A, B).s
  302.                 END IF
  303.             END IF
  304.         NEXT B
  305.     NEXT A
  306.     LOCATE MapDesign(CurrentLevel).tx, MapDesign(CurrentLevel).ty
  307.     COLOR 3
  308.     PRINT MapDesign(CurrentLevel).t
  309. '-------------------------------------------------------5.11.  PrintPlayerDesign
  310. SUB PrintPlayerDesign
  311.     FOR C = 1 TO NumPlayers
  312.         IF Player(C).a = 1 THEN
  313.             FOR A = 1 TO PlayerStructure(C).h
  314.                 FOR B = 1 TO PlayerStructure(C).w
  315.                     IF DebugMode = 0 THEN
  316.                         IF PlayerTile(C, A, B).d <> " " THEN
  317.                             LOCATE Player(C).x + A - 1, Player(C).y + B - 1
  318.                             COLOR 15
  319.                             PRINT PlayerTile(C, A, B).d
  320.                         END IF
  321.                     ELSEIF DebugMode = 1 THEN
  322.                         IF PlayerTile(C, A, B).s = "1" THEN
  323.                             LOCATE Player(C).x + A - 1, Player(C).y + B - 1
  324.                             COLOR 15
  325.                             PRINT PlayerTile(C, A, B).s
  326.                         END IF
  327.                     END IF
  328.                 NEXT B
  329.             NEXT A
  330.         END IF
  331.     NEXT C
  332. '-------------------------------------------------------5.12.  MovePlayer   !!! REWRITE !!! CONDENSE AND IMPROVE: EDGE-SENSITIVITY FOR BIGGER THAN 3X3 PLAYER
  333. SUB MovePlayer
  334.     SELECT CASE KeyPress
  335.         '...............................................5.12.1.Player1 UP
  336.         CASE CHR$(0) + CHR$(72)
  337.             PlayerCollisionField(1, 1, 1).b = PlayerTile(1, 1, 1).b * MapTile(CurrentLevel, (Player(1).x - 1), Player(1).y + 0).b
  338.             PlayerCollisionField(1, 1, 2).b = PlayerTile(1, 1, 2).b * MapTile(CurrentLevel, (Player(1).x - 1), Player(1).y + 1).b
  339.             PlayerCollisionField(1, 1, 3).b = PlayerTile(1, 1, 3).b * MapTile(CurrentLevel, (Player(1).x - 1), Player(1).y + 2).b
  340.             PlayerCollisionField(1, 2, 1).b = PlayerTile(1, 2, 1).b * MapTile(CurrentLevel, (Player(1).x + 0), Player(1).y + 0).b
  341.             PlayerCollisionField(1, 2, 2).b = PlayerTile(1, 2, 2).b * MapTile(CurrentLevel, (Player(1).x + 0), Player(1).y + 1).b
  342.             PlayerCollisionField(1, 2, 3).b = PlayerTile(1, 2, 3).b * MapTile(CurrentLevel, (Player(1).x + 0), Player(1).y + 2).b
  343.             PlayerCollisionField(1, 3, 1).b = PlayerTile(1, 3, 1).b * MapTile(CurrentLevel, (Player(1).x + 1), Player(1).y + 0).b
  344.             PlayerCollisionField(1, 3, 2).b = PlayerTile(1, 3, 2).b * MapTile(CurrentLevel, (Player(1).x + 1), Player(1).y + 1).b
  345.             PlayerCollisionField(1, 3, 3).b = PlayerTile(1, 3, 3).b * MapTile(CurrentLevel, (Player(1).x + 1), Player(1).y + 2).b
  346.             IF (PlayerCollisionField(1, 1, 1).b = 0) AND (PlayerCollisionField(1, 1, 2).b = 0) AND (PlayerCollisionField(1, 1, 3).b = 0) AND (PlayerCollisionField(1, 2, 1).b = 0) AND (PlayerCollisionField(1, 2, 2).b = 0) AND (PlayerCollisionField(1, 2, 3).b = 0) AND (PlayerCollisionField(1, 3, 1).b = 0) AND (PlayerCollisionField(1, 3, 2).b = 0) AND (PlayerCollisionField(1, 3, 3).b = 0) THEN
  347.                 Player(1).x = Player(1).x - 1
  348.                 Player(1).d = "Up"
  349.             ELSE Player(1).x = Player(1).x
  350.             END IF
  351.             '...........................................5.12.2.Player1 DOWN
  352.         CASE CHR$(0) + CHR$(80)
  353.             PlayerCollisionField(1, 1, 1).b = PlayerTile(1, 1, 1).b * MapTile(CurrentLevel, (Player(1).x + 1), Player(1).y + 0).b
  354.             PlayerCollisionField(1, 1, 2).b = PlayerTile(1, 1, 2).b * MapTile(CurrentLevel, (Player(1).x + 1), Player(1).y + 1).b
  355.             PlayerCollisionField(1, 1, 3).b = PlayerTile(1, 1, 3).b * MapTile(CurrentLevel, (Player(1).x + 1), Player(1).y + 2).b
  356.             PlayerCollisionField(1, 2, 1).b = PlayerTile(1, 2, 1).b * MapTile(CurrentLevel, (Player(1).x + 2), Player(1).y + 0).b
  357.             PlayerCollisionField(1, 2, 2).b = PlayerTile(1, 2, 2).b * MapTile(CurrentLevel, (Player(1).x + 2), Player(1).y + 1).b
  358.             PlayerCollisionField(1, 2, 3).b = PlayerTile(1, 2, 3).b * MapTile(CurrentLevel, (Player(1).x + 2), Player(1).y + 2).b
  359.             PlayerCollisionField(1, 3, 1).b = PlayerTile(1, 3, 1).b * MapTile(CurrentLevel, (Player(1).x + 3), Player(1).y + 0).b
  360.             PlayerCollisionField(1, 3, 2).b = PlayerTile(1, 3, 2).b * MapTile(CurrentLevel, (Player(1).x + 3), Player(1).y + 1).b
  361.             PlayerCollisionField(1, 3, 3).b = PlayerTile(1, 3, 3).b * MapTile(CurrentLevel, (Player(1).x + 3), Player(1).y + 2).b
  362.             IF (PlayerCollisionField(1, 1, 1).b = 0) AND (PlayerCollisionField(1, 1, 2).b = 0) AND (PlayerCollisionField(1, 1, 3).b = 0) AND (PlayerCollisionField(1, 2, 1).b = 0) AND (PlayerCollisionField(1, 2, 2).b = 0) AND (PlayerCollisionField(1, 2, 3).b = 0) AND (PlayerCollisionField(1, 3, 1).b = 0) AND (PlayerCollisionField(1, 3, 2).b = 0) AND (PlayerCollisionField(1, 3, 3).b = 0) THEN
  363.                 Player(1).x = Player(1).x + 1
  364.                 Player(1).d = "Down"
  365.             ELSE Player(1).x = Player(1).x
  366.             END IF
  367.             '...........................................5.12.3.Player1 LEFT
  368.         CASE CHR$(0) + CHR$(75)
  369.             PlayerCollisionField(1, 1, 1).b = PlayerTile(1, 1, 1).b * MapTile(CurrentLevel, (Player(1).x + 0), Player(1).y - 1).b
  370.             PlayerCollisionField(1, 1, 2).b = PlayerTile(1, 1, 2).b * MapTile(CurrentLevel, (Player(1).x + 0), Player(1).y + 0).b
  371.             PlayerCollisionField(1, 1, 3).b = PlayerTile(1, 1, 3).b * MapTile(CurrentLevel, (Player(1).x + 0), Player(1).y + 1).b
  372.             PlayerCollisionField(1, 2, 1).b = PlayerTile(1, 2, 1).b * MapTile(CurrentLevel, (Player(1).x + 1), Player(1).y - 1).b
  373.             PlayerCollisionField(1, 2, 2).b = PlayerTile(1, 2, 2).b * MapTile(CurrentLevel, (Player(1).x + 1), Player(1).y + 0).b
  374.             PlayerCollisionField(1, 2, 3).b = PlayerTile(1, 2, 3).b * MapTile(CurrentLevel, (Player(1).x + 1), Player(1).y + 1).b
  375.             PlayerCollisionField(1, 3, 1).b = PlayerTile(1, 3, 1).b * MapTile(CurrentLevel, (Player(1).x + 2), Player(1).y - 1).b
  376.             PlayerCollisionField(1, 3, 2).b = PlayerTile(1, 3, 2).b * MapTile(CurrentLevel, (Player(1).x + 2), Player(1).y + 0).b
  377.             PlayerCollisionField(1, 3, 3).b = PlayerTile(1, 3, 3).b * MapTile(CurrentLevel, (Player(1).x + 2), Player(1).y + 1).b
  378.             IF (PlayerCollisionField(1, 1, 1).b = 0) AND (PlayerCollisionField(1, 1, 2).b = 0) AND (PlayerCollisionField(1, 1, 3).b = 0) AND (PlayerCollisionField(1, 2, 1).b = 0) AND (PlayerCollisionField(1, 2, 2).b = 0) AND (PlayerCollisionField(1, 2, 3).b = 0) AND (PlayerCollisionField(1, 3, 1).b = 0) AND (PlayerCollisionField(1, 3, 2).b = 0) AND (PlayerCollisionField(1, 3, 3).b = 0) THEN
  379.                 Player(1).y = Player(1).y - 1
  380.                 Player(1).d = "Left"
  381.             ELSE Player(1).y = Player(1).y
  382.             END IF
  383.             '...........................................5.12.4.Player1 RIGHT
  384.         CASE CHR$(0) + CHR$(77)
  385.             PlayerCollisionField(1, 1, 1).b = PlayerTile(1, 1, 1).b * MapTile(CurrentLevel, (Player(1).x + 0), Player(1).y + 1).b
  386.             PlayerCollisionField(1, 1, 2).b = PlayerTile(1, 1, 2).b * MapTile(CurrentLevel, (Player(1).x + 0), Player(1).y + 2).b
  387.             PlayerCollisionField(1, 1, 3).b = PlayerTile(1, 1, 3).b * MapTile(CurrentLevel, (Player(1).x + 0), Player(1).y + 3).b
  388.             PlayerCollisionField(1, 2, 1).b = PlayerTile(1, 2, 1).b * MapTile(CurrentLevel, (Player(1).x + 1), Player(1).y + 1).b
  389.             PlayerCollisionField(1, 2, 2).b = PlayerTile(1, 2, 2).b * MapTile(CurrentLevel, (Player(1).x + 1), Player(1).y + 2).b
  390.             PlayerCollisionField(1, 2, 3).b = PlayerTile(1, 2, 3).b * MapTile(CurrentLevel, (Player(1).x + 1), Player(1).y + 3).b
  391.             PlayerCollisionField(1, 3, 1).b = PlayerTile(1, 3, 1).b * MapTile(CurrentLevel, (Player(1).x + 2), Player(1).y + 1).b
  392.             PlayerCollisionField(1, 3, 2).b = PlayerTile(1, 3, 2).b * MapTile(CurrentLevel, (Player(1).x + 2), Player(1).y + 2).b
  393.             PlayerCollisionField(1, 3, 3).b = PlayerTile(1, 3, 3).b * MapTile(CurrentLevel, (Player(1).x + 2), Player(1).y + 3).b
  394.             IF (PlayerCollisionField(1, 1, 1).b = 0) AND (PlayerCollisionField(1, 1, 2).b = 0) AND (PlayerCollisionField(1, 1, 3).b = 0) AND (PlayerCollisionField(1, 2, 1).b = 0) AND (PlayerCollisionField(1, 2, 2).b = 0) AND (PlayerCollisionField(1, 2, 3).b = 0) AND (PlayerCollisionField(1, 3, 1).b = 0) AND (PlayerCollisionField(1, 3, 2).b = 0) AND (PlayerCollisionField(1, 3, 3).b = 0) THEN
  395.                 Player(1).y = Player(1).y + 1
  396.                 Player(1).d = "Right"
  397.             ELSE Player(1).y = Player(1).y
  398.             END IF
  399.             '...........................................5.12.5.Player2 UP
  400.         CASE "W"
  401.             PlayerCollisionField(2, 1, 1).b = PlayerTile(2, 1, 1).b * MapTile(CurrentLevel, (Player(2).x - 1), Player(2).y + 0).b
  402.             PlayerCollisionField(2, 1, 2).b = PlayerTile(2, 1, 2).b * MapTile(CurrentLevel, (Player(2).x - 1), Player(2).y + 1).b
  403.             PlayerCollisionField(2, 1, 3).b = PlayerTile(2, 1, 3).b * MapTile(CurrentLevel, (Player(2).x - 1), Player(2).y + 2).b
  404.             PlayerCollisionField(2, 2, 1).b = PlayerTile(2, 2, 1).b * MapTile(CurrentLevel, (Player(2).x + 0), Player(2).y + 0).b
  405.             PlayerCollisionField(2, 2, 2).b = PlayerTile(2, 2, 2).b * MapTile(CurrentLevel, (Player(2).x + 0), Player(2).y + 1).b
  406.             PlayerCollisionField(2, 2, 3).b = PlayerTile(2, 2, 3).b * MapTile(CurrentLevel, (Player(2).x + 0), Player(2).y + 2).b
  407.             PlayerCollisionField(2, 3, 1).b = PlayerTile(2, 3, 1).b * MapTile(CurrentLevel, (Player(2).x + 1), Player(2).y + 0).b
  408.             PlayerCollisionField(2, 3, 2).b = PlayerTile(2, 3, 2).b * MapTile(CurrentLevel, (Player(2).x + 1), Player(2).y + 1).b
  409.             PlayerCollisionField(2, 3, 3).b = PlayerTile(2, 3, 3).b * MapTile(CurrentLevel, (Player(2).x + 1), Player(2).y + 2).b
  410.             IF (PlayerCollisionField(2, 1, 1).b = 0) AND (PlayerCollisionField(2, 1, 2).b = 0) AND (PlayerCollisionField(2, 1, 3).b = 0) AND (PlayerCollisionField(2, 2, 1).b = 0) AND (PlayerCollisionField(2, 2, 2).b = 0) AND (PlayerCollisionField(2, 2, 3).b = 0) AND (PlayerCollisionField(2, 3, 1).b = 0) AND (PlayerCollisionField(2, 3, 2).b = 0) AND (PlayerCollisionField(2, 3, 3).b = 0) THEN
  411.                 Player(2).x = Player(2).x - 1
  412.                 Player(2).d = "Up"
  413.             ELSE Player(2).x = Player(2).x
  414.             END IF
  415.             '...........................................5.12.6.Player2 DOWN
  416.         CASE "S"
  417.             PlayerCollisionField(2, 1, 1).b = PlayerTile(2, 1, 1).b * MapTile(CurrentLevel, (Player(2).x + 1), Player(2).y + 0).b
  418.             PlayerCollisionField(2, 1, 2).b = PlayerTile(2, 1, 2).b * MapTile(CurrentLevel, (Player(2).x + 1), Player(2).y + 1).b
  419.             PlayerCollisionField(2, 1, 3).b = PlayerTile(2, 1, 3).b * MapTile(CurrentLevel, (Player(2).x + 1), Player(2).y + 2).b
  420.             PlayerCollisionField(2, 2, 1).b = PlayerTile(2, 2, 1).b * MapTile(CurrentLevel, (Player(2).x + 2), Player(2).y + 0).b
  421.             PlayerCollisionField(2, 2, 2).b = PlayerTile(2, 2, 2).b * MapTile(CurrentLevel, (Player(2).x + 2), Player(2).y + 1).b
  422.             PlayerCollisionField(2, 2, 3).b = PlayerTile(2, 2, 3).b * MapTile(CurrentLevel, (Player(2).x + 2), Player(2).y + 2).b
  423.             PlayerCollisionField(2, 3, 1).b = PlayerTile(2, 3, 1).b * MapTile(CurrentLevel, (Player(2).x + 3), Player(2).y + 0).b
  424.             PlayerCollisionField(2, 3, 2).b = PlayerTile(2, 3, 2).b * MapTile(CurrentLevel, (Player(2).x + 3), Player(2).y + 1).b
  425.             PlayerCollisionField(2, 3, 3).b = PlayerTile(2, 3, 3).b * MapTile(CurrentLevel, (Player(2).x + 3), Player(2).y + 2).b
  426.             IF (PlayerCollisionField(2, 1, 1).b = 0) AND (PlayerCollisionField(2, 1, 2).b = 0) AND (PlayerCollisionField(2, 1, 3).b = 0) AND (PlayerCollisionField(2, 2, 1).b = 0) AND (PlayerCollisionField(2, 2, 2).b = 0) AND (PlayerCollisionField(2, 2, 3).b = 0) AND (PlayerCollisionField(2, 3, 1).b = 0) AND (PlayerCollisionField(2, 3, 2).b = 0) AND (PlayerCollisionField(2, 3, 3).b = 0) THEN
  427.                 Player(2).x = Player(2).x + 1
  428.                 Player(2).d = "Down"
  429.             ELSE Player(2).x = Player(2).x
  430.             END IF
  431.             '...........................................5.12.7.Player2 LEFT
  432.         CASE "A"
  433.             PlayerCollisionField(2, 1, 1).b = PlayerTile(2, 1, 1).b * MapTile(CurrentLevel, (Player(2).x + 0), Player(2).y - 1).b
  434.             PlayerCollisionField(2, 1, 2).b = PlayerTile(2, 1, 2).b * MapTile(CurrentLevel, (Player(2).x + 0), Player(2).y + 0).b
  435.             PlayerCollisionField(2, 1, 3).b = PlayerTile(2, 1, 3).b * MapTile(CurrentLevel, (Player(2).x + 0), Player(2).y + 1).b
  436.             PlayerCollisionField(2, 2, 1).b = PlayerTile(2, 2, 1).b * MapTile(CurrentLevel, (Player(2).x + 1), Player(2).y - 1).b
  437.             PlayerCollisionField(2, 2, 2).b = PlayerTile(2, 2, 2).b * MapTile(CurrentLevel, (Player(2).x + 1), Player(2).y + 0).b
  438.             PlayerCollisionField(2, 2, 3).b = PlayerTile(2, 2, 3).b * MapTile(CurrentLevel, (Player(2).x + 1), Player(2).y + 1).b
  439.             PlayerCollisionField(2, 3, 1).b = PlayerTile(2, 3, 1).b * MapTile(CurrentLevel, (Player(2).x + 2), Player(2).y - 1).b
  440.             PlayerCollisionField(2, 3, 2).b = PlayerTile(2, 3, 2).b * MapTile(CurrentLevel, (Player(2).x + 2), Player(2).y + 0).b
  441.             PlayerCollisionField(2, 3, 3).b = PlayerTile(2, 3, 3).b * MapTile(CurrentLevel, (Player(2).x + 2), Player(2).y + 1).b
  442.             IF (PlayerCollisionField(2, 1, 1).b = 0) AND (PlayerCollisionField(2, 1, 2).b = 0) AND (PlayerCollisionField(2, 1, 3).b = 0) AND (PlayerCollisionField(2, 2, 1).b = 0) AND (PlayerCollisionField(2, 2, 2).b = 0) AND (PlayerCollisionField(2, 2, 3).b = 0) AND (PlayerCollisionField(2, 3, 1).b = 0) AND (PlayerCollisionField(2, 3, 2).b = 0) AND (PlayerCollisionField(2, 3, 3).b = 0) THEN
  443.                 Player(2).y = Player(2).y - 1
  444.                 Player(2).d = "Left"
  445.             ELSE Player(2).y = Player(2).y
  446.             END IF
  447.             '...........................................5.12.8.Player2 RIGHT
  448.         CASE "D"
  449.             PlayerCollisionField(2, 1, 1).b = PlayerTile(2, 1, 1).b * MapTile(CurrentLevel, (Player(2).x + 0), Player(2).y + 1).b
  450.             PlayerCollisionField(2, 1, 2).b = PlayerTile(2, 1, 2).b * MapTile(CurrentLevel, (Player(2).x + 0), Player(2).y + 2).b
  451.             PlayerCollisionField(2, 1, 3).b = PlayerTile(2, 1, 3).b * MapTile(CurrentLevel, (Player(2).x + 0), Player(2).y + 3).b
  452.             PlayerCollisionField(2, 2, 1).b = PlayerTile(2, 2, 1).b * MapTile(CurrentLevel, (Player(2).x + 1), Player(2).y + 1).b
  453.             PlayerCollisionField(2, 2, 2).b = PlayerTile(2, 2, 2).b * MapTile(CurrentLevel, (Player(2).x + 1), Player(2).y + 2).b
  454.             PlayerCollisionField(2, 2, 3).b = PlayerTile(2, 2, 3).b * MapTile(CurrentLevel, (Player(2).x + 1), Player(2).y + 3).b
  455.             PlayerCollisionField(2, 3, 1).b = PlayerTile(2, 3, 1).b * MapTile(CurrentLevel, (Player(2).x + 2), Player(2).y + 1).b
  456.             PlayerCollisionField(2, 3, 2).b = PlayerTile(2, 3, 2).b * MapTile(CurrentLevel, (Player(2).x + 2), Player(2).y + 2).b
  457.             PlayerCollisionField(2, 3, 3).b = PlayerTile(2, 3, 3).b * MapTile(CurrentLevel, (Player(2).x + 2), Player(2).y + 3).b
  458.             IF (PlayerCollisionField(2, 1, 1).b = 0) AND (PlayerCollisionField(2, 1, 2).b = 0) AND (PlayerCollisionField(2, 1, 3).b = 0) AND (PlayerCollisionField(2, 2, 1).b = 0) AND (PlayerCollisionField(2, 2, 2).b = 0) AND (PlayerCollisionField(2, 2, 3).b = 0) AND (PlayerCollisionField(2, 3, 1).b = 0) AND (PlayerCollisionField(2, 3, 2).b = 0) AND (PlayerCollisionField(2, 3, 3).b = 0) THEN
  459.                 Player(2).y = Player(2).y + 1
  460.                 Player(2).d = "Right"
  461.             ELSE Player(2).y = Player(2).y
  462.             END IF
  463.     END SELECT
  464. '-------------------------------------------------------5.13.  ChangeLevel
  465. SUB ChangeLevel
  466.     '...................................................5.13.1.Level 1 to 2
  467.     IF Player(1).y >= 97 AND CurrentLevel = 1 THEN
  468.         CurrentLevel = 2
  469.         Player(1).y = 4
  470.         Player(2).a = 0
  471.         LoadGame
  472.         '...............................................5.13.2.Level 2 to 1
  473.     ELSEIF Player(1).y <= 3 AND CurrentLevel = 2 THEN
  474.         CurrentLevel = 1
  475.         Player(1).y = 96
  476.         Player(2).a = 1
  477.         LoadGame
  478.     END IF
  479. '-------------------------------------------------------5.14.  DebugScreen
  480. SUB DebugScreen
  481.     COLOR 31
  482.     FOR a = 1 TO 45
  483.         LOCATE a, 103
  484.         PRINT "º"
  485.     NEXT
  486.     DebugX = 3
  487.     DebugY = 105
  488.     LOCATE 1, DebugY
  489.     PRINT "DEBUG SCREEN"
  490.     COLOR 28
  491.     LOCATE DebugX, DebugY
  492.     PRINT "Current Level:"; CurrentLevel
  493.     LOCATE DebugX + 1, DebugY
  494.     PRINT "MapStructure (File): "; MapStructure(CurrentLevel).p
  495.     LOCATE DebugX + 2, DebugY
  496.     PRINT "MapDesign (File): "; MapDesign(CurrentLevel).p
  497.     LOCATE DebugX + 2, DebugY
  498.     PRINT "MapDesign (Title): "; MapDesign(CurrentLevel).t
  499.     LOCATE DebugX + 3, DebugY
  500.     PRINT "PlayerStructure(1): "; PlayerStructure(1).p
  501.     LOCATE DebugX + 4, DebugY
  502.     PRINT "PlayerDesign(1): "; PlayerDesign(1).p
  503.     LOCATE DebugX + 5, DebugY
  504.     PRINT "MovePlayer(1) [Last move]: "; Player(1).d
  505.     LOCATE DebugX + 6, DebugY
  506.     PRINT "Player(1).x: "; Player(1).x
  507.     LOCATE DebugX + 7, DebugY
  508.     PRINT "Player(1).y: "; Player(1).y
  509.     LOCATE DebugX + 9, DebugY
  510.     PRINT "PlayerStructure(1) x MapStructure("; CurrentLevel; ")"
  511.     LOCATE DebugX + 10, DebugY
  512.     PRINT "(CollisionField for last KeyPress)"
  513.     LOCATE DebugX + 11, DebugY
  514.     PRINT PlayerCollisionField(1, 1, 1).b; PlayerCollisionField(1, 1, 2).b; PlayerCollisionField(1, 1, 3).b
  515.     LOCATE DebugX + 12, DebugY
  516.     PRINT PlayerCollisionField(1, 2, 1).b; PlayerCollisionField(1, 2, 2).b; PlayerCollisionField(1, 2, 3).b
  517.     LOCATE DebugX + 13, DebugY
  518.     PRINT PlayerCollisionField(1, 3, 1).b; PlayerCollisionField(1, 3, 2).b; PlayerCollisionField(1, 3, 3).b
  519.     COLOR 31
  520.     LOCATE DebugX + 37, DebugY
  521.     PRINT "Arrows = Move Player 1"
  522.     LOCATE DebugX + 38, DebugY
  523.     PRINT "'WASD' = Move Player 2"
  524.     LOCATE DebugX + 40, DebugY
  525.     PRINT "F1 = Debug Mode (ON/OFF)"
  526.     LOCATE DebugX + 41, DebugY
  527.     PRINT "F5 = Reload files (edit on the fly)"
  528.     LOCATE DebugX + 42, DebugY
  529.     PRINT "Q  = Quit program"
  530.     SELECT CASE KeyPress
  531.         CASE CHR$(0) + CHR$(59)
  532.             SELECT CASE DebugMode
  533.                 CASE 1: DebugMode = 0
  534.                 CASE 0: DebugMode = 1
  535.             END SELECT
  536.         CASE CHR$(0) + CHR$(63)
  537.             LoadGame
  538.     END SELECT
  539. '=======================================================6.     END OF PROGRAM
  540.  
* ATE_v1b.rar (Filesize: 8.89 KB, Downloads: 167)

FellippeHeitor

  • Guest
Re: Game Engine | ASCII Terrain Engine v.1.2
« Reply #1 on: May 03, 2020, 07:57:20 pm »
Welcome aboard, Virtusoroca! I bet @TerryRitchie for one will surely notice your commenting style ;-)

Great ASCII art too! Bonus points for QB64's logo in ASCII (I do not recall an ASCII rendition of our logo being done before ;-))

Fellippe.

Offline TerryRitchie

  • Seasoned Forum Regular
  • Posts: 495
  • Semper Fidelis
    • View Profile
Re: Game Engine | ASCII Terrain Engine v.1.2
« Reply #2 on: May 03, 2020, 08:00:37 pm »
Welcome!

That's the first thing I noticed when I loaded the code - The QB64 logo in ASCII.

Really cool concept and execution. I found no faults anywhere in movement around the two demo levels. I was never really a big fan of ASCII RPG type games because they always felt too cramped to me. This does not. Very well done.

(Yep, I noticed the generous use of comments - awesome!)
In order to understand recursion, one must first understand recursion.

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: Game Engine | ASCII Terrain Engine v.1.2
« Reply #3 on: May 04, 2020, 01:58:02 am »
Welcome to the forum, Virtusoroca!
Its a very nice ASCII Terrain engine. Also, your code is very neat and pleasing to see.
if (Me.success) {Me.improve()} else {Me.tryAgain()}


My Projects - https://github.com/AshishKingdom?tab=repositories
OpenGL tutorials - https://ashishkingdom.github.io/OpenGL-Tutorials

Offline Virtusoroca

  • Newbie
  • Posts: 24
    • View Profile
Re: Game Engine | ASCII Terrain Engine v.1.2
« Reply #4 on: May 05, 2020, 02:42:16 pm »
Hi @FellippeHeitor thanks for warm welcome and the he bônus point! :D

Hello @TerryRitchie and thanks for the remarks on comments. I think that in a code community its essential. I even like to declare subs, although its optional. Its brings some clarity to the hole thing -- a panoramic view of what lies ahead.

And thanks @Ashish for the compliments. I very much appreciate it. :D :D

Im working in the 1.3 version, adding new features and fixing some bugs. Comming back to work but hoping to keep going with some demo scenes and other improvements. When posting the new version I will bring some issues regarding collision detection on a code level.

Here is a preview of 1.3
Thanks agian and see you guys soon!
tela.jpg
* tela.jpg (Filesize: 545.93 KB, Dimensions: 1920x1080, Views: 294)
« Last Edit: May 05, 2020, 03:06:51 pm by Virtusoroca »

Offline OldMoses

  • Seasoned Forum Regular
  • Posts: 469
    • View Profile
Re: Game Engine | ASCII Terrain Engine v.1.2
« Reply #5 on: May 06, 2020, 07:15:35 pm »
That is so friggen cool, I just gave you a named subdirectory on my machine. You are the master of ASCII, and I love your comment style. I may have to study and assimilate some of that. Very well executed.

Offline Virtusoroca

  • Newbie
  • Posts: 24
    • View Profile
Re: Game Engine | ASCII Terrain Engine v.1.2
« Reply #6 on: May 07, 2020, 07:08:25 pm »
Hi @OldMoses! As a librarian Im always concearned with information access. Then the tendency to have all my code properly "classified". :p

Im glad you enjoyed it and thanks for the comments. Soon I will be back with a new version, in wich I have already included a DarkMode.

When switched it restrics player visibility to a fixed narrow field as in Dungeon RPG games. Not sure if this function has a proper name but its there.
DarkMode.jpg
* DarkMode.jpg (Filesize: 496.33 KB, Dimensions: 1920x1080, Views: 257)