Author Topic: Find The Gold!  (Read 7700 times)

0 Members and 1 Guest are viewing this topic.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Find The Gold!
« Reply #30 on: October 27, 2020, 06:26:15 pm »
The target-like things? Do you mean the yellow dots in the map? That's where the gold is. You are the red one.

No this:

 
image_2020-10-27_182605.png

Marked as best answer by SierraKen on October 27, 2020, 06:23:56 pm

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Find The Gold!
« Reply #31 on: October 27, 2020, 06:42:19 pm »
LOL nah I just added the countdown. :)) Here you go:

Code: QB64: [Select]
  1. 'Find the Gold! by SierraKen
  2. 'October 27, 2020
  3. 'Thanks for the great mapping code by FellipeHeitor and help from B+ and ideas from Aurel!
  4. 'Newest Additions: Mine Shafts and Music.
  5. 'Music created by me many years ago.
  6. 'Added random houses on each level.
  7. 'Added 5 extra gold bars on each level.
  8. 'Added Map in lower right corner.
  9. 'Added countdown of gold bars per level.
  10.  
  11. SCREEN _NEWIMAGE(800, 600, 32)
  12.  
  13. TYPE object
  14.     x AS SINGLE
  15.     y AS SINGLE
  16.  
  17. DIM SHARED player AS object
  18. DIM SHARED camera AS object
  19. DIM playerSpeed AS SINGLE
  20. DIM minelevel AS SINGLE
  21. DIM level AS SINGLE
  22. DIM score AS SINGLE
  23. DIM leveltime AS SINGLE
  24. DIM gametime AS SINGLE
  25. DIM seconds AS SINGLE
  26. DIM goldx(50), goldy(50)
  27.  
  28. _TITLE "Loading....."
  29. s& = _SNDOPEN("Hello_Martian_Home.mp3")
  30. start:
  31. minelevel = 50
  32. score = 0
  33. level = 1
  34. gbars = 20
  35. gbars$ = STR$(gbars)
  36. start2:
  37. player.x = _WIDTH / 2
  38. player.y = _HEIGHT / 2
  39.  
  40. map = _NEWIMAGE(_WIDTH * 7, _HEIGHT * 7, 32)
  41.  
  42. _DEST map
  43.  
  44. CLS , _RGB32(0, 200, 0)
  45. _LIMIT 2000
  46.  
  47. 'Lakes
  48. FOR lakes = 1 TO 100
  49.     w = RND
  50.     h = RND
  51.     sze = (RND * 250) + 100
  52.     shape = RND
  53.     FOR sz = .25 TO sze STEP .25
  54.         CIRCLE (w * _WIDTH, h * _HEIGHT), sz, _RGB32(0, 128, 255), , , shape
  55.     NEXT sz
  56. NEXT lakes
  57.  
  58. 'Hills
  59. FOR hills = 1 TO 1200
  60.     xx = (RND * _WIDTH)
  61.     sz = INT(RND * 100) + 200
  62.     shape = RND
  63.     hillcolors:
  64.     blue = blue + .05
  65.     c3 = INT(RND * 50) + 20 + blue
  66.     c2 = c3 * 2
  67.     c1 = c3 * 3
  68.     IF c1 = 255 AND c2 = 255 AND c3 = 128 THEN GOTO hillcolors:
  69.     yy = yy + 4
  70.     FOR hill = 1 TO sz STEP .25
  71.         hh = hh + .025
  72.         IF hh > 100 THEN hh = 100
  73.         cc1 = c1 + hh
  74.         cc2 = c2 + hh
  75.         cc3 = c3 + hh
  76.         CIRCLE (xx, yy), hill, _RGB32(cc1, cc2, cc3), 2 * _PI, _PI, shape
  77.     NEXT hill
  78.     hh = 0
  79. NEXT hills
  80. blue = 0
  81. yy = 0
  82.  
  83. 'Trees
  84. FOR trees = 1 TO 1000
  85.     tx = RND
  86.     tx = tx * _WIDTH
  87.     ty = RND
  88.     ty = ty * _HEIGHT
  89.     tsz = (RND * 40) + 10
  90.     LINE (tx, ty)-(tx, ty + tsz + 5), _RGB32(188, 127, 127)
  91.     FOR branches = ty TO ty + tsz STEP 3
  92.         trim = trim + 2
  93.         LINE (tx, branches)-(tx - trim, branches + 5), _RGB32(0, 183, 127)
  94.         LINE (tx, branches)-(tx + trim, branches + 5), _RGB32(0, 183, 127)
  95.     NEXT branches
  96.     trim = 0
  97. NEXT trees
  98.  
  99. 'Mine Shafts
  100. FOR mines = 1 TO minelevel
  101.     mines:
  102.     bx = RND
  103.     bx = bx * _WIDTH
  104.     by = RND
  105.     by = by * _HEIGHT
  106.     IF bx < 500 AND by < 400 THEN GOTO mines:
  107.     FOR sz = .25 TO 10 STEP .25
  108.         CIRCLE (bx, by), sz, _RGB32(0, 0, 5)
  109.     NEXT sz
  110. NEXT mines
  111.  
  112. 'Houses
  113. FOR houses = 1 TO 10
  114.     xhouse = INT(RND * _WIDTH)
  115.     yhouse = INT(RND * _HEIGHT)
  116.     szhouse = INT(RND * 60) + 30
  117.     LINE (xhouse, yhouse)-(xhouse + szhouse, yhouse + szhouse), _RGB32(183, 161, 150), BF
  118.     'roof
  119.     FOR sz = .25 TO (szhouse / 2) STEP .25
  120.         CIRCLE (xhouse + (szhouse / 2), yhouse), sz, _RGB32(150, 105, 105), _PI * 2, _PI, .5
  121.     NEXT sz
  122.     'door
  123.     LINE (xhouse + (szhouse / 2) - szhouse * .1, yhouse + szhouse - 15)-(xhouse + (szhouse / 2) + szhouse * .1, yhouse + szhouse), _RGB32(150, 105, 105), BF
  124.     'windows
  125.     LINE (xhouse + szhouse * .2, yhouse + szhouse * .2)-(xhouse + szhouse * .4, yhouse + szhouse * .4), _RGB32(150, 105, 105), BF
  126.     LINE (xhouse + szhouse * .6, yhouse + szhouse * .2)-(xhouse + szhouse * .8, yhouse + szhouse * .4), _RGB32(150, 105, 105), BF
  127. NEXT houses
  128.  
  129.  
  130. 'Place Gold
  131. FOR gold = 1 TO 25
  132.     gold:
  133.     w2 = INT(RND * _WIDTH) - 40
  134.     h2 = INT(RND * _HEIGHT) - 40
  135.     goldx(gold) = w2
  136.     goldy(gold) = h2
  137.     IF w2 < 40 THEN w2 = 40
  138.     IF h2 < 40 THEN h2 = 40
  139.     IF h2 > (_HEIGHT - 150) THEN GOTO gold:
  140.     IF POINT(w2, h2) = _RGB32(255, 255, 128) THEN GOTO gold:
  141.     IF POINT(w2, h2) = _RGB32(0, 0, 0) THEN GOTO gold:
  142.     IF POINT(w2, h2) = _RGB32(0, 0, 5) THEN GOTO gold:
  143.     FOR check = -10 TO 10
  144.         IF POINT(w2 + check, h2 + check) = _RGB32(183, 161, 150) THEN GOTO gold:
  145.         IF POINT(w2 + check, h2 + check) = _RGB32(150, 105, 105) THEN GOTO gold:
  146.     NEXT check
  147.     'Gold
  148.     COLOR _RGB32(0, 0, 0), _RGB32(255, 255, 128)
  149.     _PRINTSTRING (w2, h2), "GOLD"
  150. NEXT gold
  151.  
  152.  
  153.  
  154. IF level > 1 THEN GOTO begin:
  155.  
  156. playerSpeed = 8
  157.  
  158. CONST keyUP = 18432
  159. CONST keyDOWN = 20480
  160. CONST keyLEFT = 19200
  161. CONST keyRIGHT = 19712
  162. CONST keyESC = 27
  163. _PUTIMAGE (camera.x, camera.y), map
  164.  
  165. LOCATE 3, 22: PRINT "Use the arrow keys (or WASD keys) to find 20 gold bars per level."
  166. LOCATE 4, 22: PRINT "To make it a little easier, there are 25 gold bars on each level."
  167. LOCATE 5, 22: PRINT "Every level will have a shorter time."
  168. LOCATE 6, 22: PRINT "After Level 10 you win the game."
  169. LOCATE 7, 22: PRINT "Be careful not to step in the black mine shafts or they will send"
  170. LOCATE 8, 22: PRINT "you to a random location."
  171. LOCATE 9, 22: PRINT "Every level will have more mine shafts."
  172. LOCATE 10, 22: PRINT "Use the Map in the lower right corner to see where the gold is placed."
  173. LOCATE 11, 22: PRINT "Map will not remove gold dot after you have picked it up."
  174. LOCATE 12, 22: PRINT "You show up on the map as a red dot."
  175. LOCATE 14, 22: PRINT "Game and Music created by SierraKen."
  176. LOCATE 17, 32: PRINT "* Press Any Key To Begin. *"
  177. _TITLE "Find The Gold!"
  178. pause:
  179. a$ = INKEY$
  180. IF a$ <> "" THEN GOTO begin:
  181. GOTO pause:
  182.  
  183. begin:
  184. score$ = STR$(score)
  185. level$ = STR$(level)
  186. _TITLE "Level: " + level$ + "   Score: " + score$
  187. seconds = INT(TIMER)
  188.     CLS
  189.     leveltime = level * 10
  190.     gametime = (410 - leveltime) - (INT(TIMER) - seconds)
  191.     _PUTIMAGE (camera.x, camera.y), map
  192.     LOCATE 1, 1: PRINT "Time Left: "; gametime
  193.     IF gametime < 1 THEN GOTO done:
  194.     IF _KEYDOWN(keyUP) OR _KEYDOWN(119) THEN
  195.         player.y = player.y - playerSpeed
  196.         t = t + 1
  197.         score$ = STR$(score)
  198.         level$ = STR$(level)
  199.         coordx$ = STR$(player.x)
  200.         coordy$ = STR$(player.y)
  201.         _TITLE "Level: " + level$ + "   Score: " + score$ + "                         Coordinates: " + coordx$ + "," + coordy$ + "                    Gold Bars Left To Get: " + gbars$
  202.     END IF
  203.     IF _KEYDOWN(keyDOWN) OR _KEYDOWN(115) THEN
  204.         player.y = player.y + playerSpeed
  205.         t = t + 1
  206.         score$ = STR$(score)
  207.         level$ = STR$(level)
  208.         coordx$ = STR$(player.x)
  209.         coordy$ = STR$(player.y)
  210.         _TITLE "Level: " + level$ + "   Score: " + score$ + "                         Coordinates: " + coordx$ + "," + coordy$ + "                    Gold Bars Left To Get: " + gbars$
  211.     END IF
  212.     IF _KEYDOWN(keyLEFT) OR _KEYDOWN(97) THEN
  213.         player.x = player.x - playerSpeed
  214.         t = t + 1
  215.         score$ = STR$(score)
  216.         level$ = STR$(level)
  217.         coordx$ = STR$(player.x)
  218.         coordy$ = STR$(player.y)
  219.         _TITLE "Level: " + level$ + "   Score: " + score$ + "                         Coordinates: " + coordx$ + "," + coordy$ + "                    Gold Bars Left To Get: " + gbars$
  220.     END IF
  221.     IF _KEYDOWN(keyRIGHT) OR _KEYDOWN(100) THEN
  222.         player.x = player.x + playerSpeed
  223.         t = t + 1
  224.         score$ = STR$(score)
  225.         level$ = STR$(level)
  226.         coordx$ = STR$(player.x)
  227.         coordy$ = STR$(player.y)
  228.         _TITLE "Level: " + level$ + "   Score: " + score$ + "                         Coordinates: " + coordx$ + "," + coordy$ + "                    Gold Bars Left To Get: " + gbars$
  229.     END IF
  230.     IF _KEYDOWN(keyESC) THEN END
  231.     IF player.x < 0 THEN player.x = 0
  232.     IF player.x > _WIDTH(map) THEN player.x = _WIDTH(map)
  233.     IF player.y < 0 THEN player.y = 0
  234.     IF player.y > _HEIGHT(map) THEN player.y = _HEIGHT(map)
  235.  
  236.     adjustCamera
  237.  
  238.     'Draw Head
  239.     FOR sz = .25 TO 10 STEP .25
  240.         CIRCLE (player.x + camera.x, player.y + camera.y), sz, _RGB32(255, 166, 127)
  241.     NEXT sz
  242.     'Draw Smile
  243.     CIRCLE (player.x + camera.x, player.y + camera.y + 2), 7, _RGB32(255, 0, 0), _PI, 2 * _PI, .5
  244.     'Draw Eyes
  245.     CIRCLE (player.x + camera.x - 4, player.y + camera.y - 2), 1, _RGB32(0, 0, 255)
  246.     CIRCLE (player.x + camera.x + 4, player.y + camera.y - 2), 1, _RGB32(0, 0, 255)
  247.     'hat
  248.     LINE (player.x + camera.x - 10, player.y + camera.y - 10)-(player.x + camera.x + 10, player.y + camera.y - 9), _RGB32(155, 0, 0), BF
  249.     LINE (player.x + camera.x - 5, player.y + camera.y - 9)-(player.x + camera.x + 5, player.y + camera.y - 15), _RGB32(155, 0, 0), BF
  250.     'body
  251.     LINE (player.x + camera.x, player.y + camera.y + 10)-(player.x + camera.x, player.y + camera.y + 20), _RGB32(155, 0, 0)
  252.  
  253.     IF t > 7 THEN t = 0
  254.  
  255.     'rest of body
  256.     IF t = 0 THEN
  257.         'left arm
  258.         LINE (player.x + camera.x, player.y + camera.y + 13)-(player.x + camera.x - 15, player.y + camera.y + 25), _RGB32(155, 0, 0)
  259.         'right arm
  260.         LINE (player.x + camera.x, player.y + camera.y + 13)-(player.x + camera.x + 15, player.y + camera.y + 25), _RGB32(155, 0, 0)
  261.         'left leg
  262.         LINE (player.x + camera.x, player.y + camera.y + 20)-(player.x + camera.x - 15, player.y + camera.y + 35), _RGB32(155, 0, 0)
  263.         'right leg
  264.         LINE (player.x + camera.x, player.y + camera.y + 20)-(player.x + camera.x + 15, player.y + camera.y + 35), _RGB32(155, 0, 0)
  265.     END IF
  266.  
  267.     IF t = 1 OR t = 7 THEN
  268.         'left arm
  269.         LINE (player.x + camera.x, player.y + camera.y + 13)-(player.x + camera.x - 11, player.y + camera.y + 25), _RGB32(155, 0, 0)
  270.         'right arm
  271.         LINE (player.x + camera.x, player.y + camera.y + 13)-(player.x + camera.x + 11, player.y + camera.y + 25), _RGB32(155, 0, 0)
  272.         'left leg
  273.         LINE (player.x + camera.x, player.y + camera.y + 20)-(player.x + camera.x - 11, player.y + camera.y + 35), _RGB32(155, 0, 0)
  274.         'right leg
  275.         LINE (player.x + camera.x, player.y + camera.y + 20)-(player.x + camera.x + 11, player.y + camera.y + 35), _RGB32(155, 0, 0)
  276.     END IF
  277.  
  278.     IF t = 2 OR t = 6 THEN
  279.         'left arm
  280.         LINE (player.x + camera.x, player.y + camera.y + 13)-(player.x + camera.x - 9, player.y + camera.y + 24), _RGB32(155, 0, 0)
  281.         'right arm
  282.         LINE (player.x + camera.x, player.y + camera.y + 13)-(player.x + camera.x + 9, player.y + camera.y + 24), _RGB32(155, 0, 0)
  283.         'left leg
  284.         LINE (player.x + camera.x, player.y + camera.y + 20)-(player.x + camera.x - 9, player.y + camera.y + 35), _RGB32(155, 0, 0)
  285.         'right leg
  286.         LINE (player.x + camera.x, player.y + camera.y + 20)-(player.x + camera.x + 9, player.y + camera.y + 35), _RGB32(155, 0, 0)
  287.     END IF
  288.  
  289.     IF t = 3 OR t = 5 THEN
  290.         'left arm
  291.         LINE (player.x + camera.x, player.y + camera.y + 13)-(player.x + camera.x - 7, player.y + camera.y + 24), _RGB32(155, 0, 0)
  292.         'right arm
  293.         LINE (player.x + camera.x, player.y + camera.y + 13)-(player.x + camera.x + 7, player.y + camera.y + 24), _RGB32(155, 0, 0)
  294.         'left leg
  295.         LINE (player.x + camera.x, player.y + camera.y + 20)-(player.x + camera.x - 7, player.y + camera.y + 35), _RGB32(155, 0, 0)
  296.         'right leg
  297.         LINE (player.x + camera.x, player.y + camera.y + 20)-(player.x + camera.x + 7, player.y + camera.y + 35), _RGB32(155, 0, 0)
  298.     END IF
  299.  
  300.     IF t = 4 THEN
  301.         'left arm
  302.         LINE (player.x + camera.x, player.y + camera.y + 13)-(player.x + camera.x - 5, player.y + camera.y + 23), _RGB32(155, 0, 0)
  303.         'right arm
  304.         LINE (player.x + camera.x, player.y + camera.y + 13)-(player.x + camera.x + 5, player.y + camera.y + 23), _RGB32(155, 0, 0)
  305.         'left leg
  306.         LINE (player.x + camera.x, player.y + camera.y + 20)-(player.x + camera.x - 5, player.y + camera.y + 35), _RGB32(155, 0, 0)
  307.         'right leg
  308.         LINE (player.x + camera.x, player.y + camera.y + 20)-(player.x + camera.x + 5, player.y + camera.y + 35), _RGB32(155, 0, 0)
  309.     END IF
  310.  
  311.     FOR check = -15 TO 15
  312.         IF POINT(player.x + check, player.y + check) = _RGB32(255, 255, 128) THEN
  313.             _DEST map
  314.             FOR sz = .2 TO 35 STEP .2
  315.                 CIRCLE (player.x + check, player.y + check), sz, _RGB32(127, 255, 127)
  316.             NEXT sz
  317.             GOSUB findgold:
  318.         END IF
  319.         IF POINT(player.x + check, player.y - check) = _RGB32(255, 255, 128) THEN
  320.             _DEST map
  321.             FOR sz = .2 TO 35 STEP .2
  322.                 CIRCLE (player.x + check, player.y - check), sz, _RGB32(127, 255, 127)
  323.             NEXT sz
  324.             GOSUB findgold:
  325.         END IF
  326.         IF POINT(player.x - check, player.y + check) = _RGB32(255, 255, 128) THEN
  327.             _DEST map
  328.             FOR sz = .2 TO 35 STEP .2
  329.                 CIRCLE (player.x - check, player.y + check), sz, _RGB32(127, 255, 127)
  330.             NEXT sz
  331.             GOSUB findgold:
  332.         END IF
  333.     NEXT check
  334.  
  335.     FOR checkmines = -5 TO 5
  336.         IF POINT(player.x + checkmines, player.y + checkmines) = _RGB32(0, 0, 5) THEN
  337.             _DEST map
  338.             FOR sz = .25 TO 35 STEP .25
  339.                 CIRCLE (player.x + checkmines, player.y + checkmines), sz, _RGB32(127, 127, 127)
  340.             NEXT sz
  341.             FOR sz = 1 TO 35 STEP 5
  342.                 CIRCLE (player.x + checkmines, player.y + checkmines), sz, _RGB32(127, 0, 0)
  343.                 SOUND 150 + (sz * 3), 1
  344.                 _DELAY .05
  345.             NEXT sz
  346.             player.x = INT(_WIDTH(map) * RND)
  347.             player.y = INT(_HEIGHT(map) * RND)
  348.             score$ = STR$(score)
  349.             level$ = STR$(level)
  350.             coordx$ = STR$(player.x)
  351.             coordy$ = STR$(player.y)
  352.             _TITLE "Level: " + level$ + "   Score: " + score$ + "                         Coordinates: " + coordx$ + "," + coordy$ + "                   Gold Bars Left To Get: " + gbars$
  353.             _DEST 0
  354.             GOTO nex:
  355.         END IF
  356.         IF POINT(player.x + checkmines, player.y - checkmines) = _RGB32(0, 0, 5) THEN
  357.             _DEST map
  358.             FOR sz = .25 TO 35 STEP .25
  359.                 CIRCLE (player.x + checkmines, player.y - checkmines), sz, _RGB32(127, 127, 127)
  360.             NEXT sz
  361.             FOR sz = 1 TO 35 STEP 5
  362.                 CIRCLE (player.x + checkmines, player.y - checkmines), sz, _RGB32(127, 0, 0)
  363.                 SOUND 150 + (sz * 3), 1
  364.                 _DELAY .05
  365.             NEXT sz
  366.             player.x = INT(_WIDTH(map) * RND)
  367.             player.y = INT(_HEIGHT(map) * RND)
  368.             score$ = STR$(score)
  369.             level$ = STR$(level)
  370.             coordx$ = STR$(player.x)
  371.             coordy$ = STR$(player.y)
  372.             _TITLE "Level: " + level$ + "   Score: " + score$ + "                         Coordinates: " + coordx$ + "," + coordy$ + "                    Gold Bars Left To Get: " + gbars$
  373.             _DEST 0
  374.             GOTO nex:
  375.         END IF
  376.         IF POINT(player.x - checkmines, player.y + checkmines) = _RGB32(0, 0, 5) THEN
  377.             _DEST map
  378.             FOR sz = .25 TO 35 STEP .25
  379.                 CIRCLE (player.x - checkmines, player.y + checkmines), sz, _RGB32(127, 127, 127)
  380.             NEXT sz
  381.             FOR sz = 1 TO 35 STEP 5
  382.                 CIRCLE (player.x - checkmines, player.y + checkmines), sz, _RGB32(127, 0, 0)
  383.                 SOUND 150 + (sz * 3), 1
  384.                 _DELAY .05
  385.             NEXT sz
  386.             player.x = INT(_WIDTH(map) * RND)
  387.             player.y = INT(_HEIGHT(map) * RND)
  388.             score$ = STR$(score)
  389.             level$ = STR$(level)
  390.             coordx$ = STR$(player.x)
  391.             coordy$ = STR$(player.y)
  392.             _TITLE "Level: " + level$ + "   Score: " + score$ + "                         Coordinates: " + coordx$ + "," + coordy$ + "                    Gold Bars Left To Get: " + gbars$
  393.             _DEST 0
  394.             GOTO nex:
  395.         END IF
  396.     NEXT checkmines
  397.     nex:
  398.  
  399.     'Map
  400.     radarx1 = (_WIDTH + 735) - _WIDTH
  401.     radary1 = (_HEIGHT + 535) - _HEIGHT
  402.     radarx2 = (_WIDTH + 785) - _WIDTH
  403.     radary2 = (_HEIGHT + 585) - _HEIGHT
  404.     LINE (radarx1, radary1)-(radarx2, radary2), _RGB32(0, 0, 0), BF
  405.     xradar = player.x / 112: yradar = player.y / 84
  406.     FOR sz = .25 TO 2 STEP .25
  407.         CIRCLE ((radarx1 + xradar), (radary1 + yradar)), sz, _RGB32(255, 0, 0)
  408.     NEXT sz
  409.     FOR gold2 = 1 TO 25
  410.         xgold = goldx(gold2) / 112: ygold = goldy(gold2) / 84
  411.         FOR sz = .25 TO 1 STEP .25
  412.             CIRCLE ((radarx1 + xgold), (radary1 + ygold)), sz, _RGB32(255, 255, 0)
  413.         NEXT sz
  414.     NEXT gold2
  415.  
  416.     _DISPLAY
  417.     _LIMIT 60
  418.  
  419. findgold:
  420. FOR snd = 400 TO 800 STEP 100
  421.     SOUND snd, .5
  422. NEXT snd
  423. score = score + 100
  424. score$ = STR$(score)
  425. level$ = STR$(level)
  426. coordx$ = STR$(player.x)
  427. coordy$ = STR$(player.y)
  428. gbars = gbars - 1
  429. gbars$ = STR$(gbars)
  430. _TITLE "Level: " + level$ + "   Score: " + score$ + "                         Coordinates: " + coordx$ + "," + coordy$ + "                    Gold Bars Left To Get: " + gbars$
  431. IF score / 2000 = INT(score / 2000) THEN
  432.     level = level + 1
  433.     minelevel = minelevel + 50
  434.     level$ = STR$(level)
  435.     coordx$ = STR$(player.x)
  436.     coordy$ = STR$(player.y)
  437.     _TITLE "Level: " + level$ + "   Score: " + score$ + "                         Coordinates: " + coordx$ + "," + coordy$ + "                    Gold Bars Left To Get: " + gbars$
  438.     IF level = 11 THEN GOTO win:
  439.     gbars = 20
  440.     gbars$ = STR$(gbars)
  441.     GOTO start2:
  442.  
  443. done:
  444. LOCATE 10, 45: PRINT "G A M E     O V E R"
  445. FOR snd = 450 TO 150 STEP -25
  446.     SOUND snd, .5
  447. NEXT snd
  448. LOCATE 13, 45: PRINT "Again (Y/N)?"
  449. ag:
  450. ag$ = INKEY$
  451. IF ag$ = "y" OR ag$ = "Y" THEN GOTO start:
  452. IF ag$ = "n" OR ag$ = "N" THEN END
  453. GOTO ag:
  454.  
  455. win:
  456. level = 10
  457. level$ = STR$(level)
  458. _TITLE "Level: " + level$ + "   Score: " + score$ + "                         Coordinates: " + coordx$ + "," + coordy$
  459. LOCATE 10, 45: PRINT "G A M E     W O N ! ! ! ! ! ! !"
  460. FOR snd = 450 TO 150 STEP -25
  461.     SOUND snd, .5
  462. NEXT snd
  463. LOCATE 13, 45: PRINT "Again (Y/N)?"
  464. ag2:
  465. ag$ = INKEY$
  466. IF ag$ = "y" OR ag$ = "Y" THEN GOTO start:
  467. IF ag$ = "n" OR ag$ = "N" THEN END
  468. GOTO ag2:
  469.  
  470. 'Thanks to FelippeHeitor for this Sub and the camera code above.
  471. SUB adjustCamera
  472.     IF player.x + camera.x > _WIDTH / 2 OR player.x + camera.x < _WIDTH / 2 THEN
  473.         camera.x = _WIDTH / 2 - player.x
  474.     END IF
  475.     IF camera.x > 0 THEN camera.x = 0
  476.     IF camera.x < -(_WIDTH(map) - _WIDTH) THEN camera.x = -(_WIDTH(map) - _WIDTH)
  477.  
  478.     IF player.y + camera.y > _HEIGHT / 2 OR player.y + camera.y < _HEIGHT / 2 THEN
  479.         camera.y = _HEIGHT / 2 - player.y
  480.     END IF
  481.     IF camera.y > 0 THEN camera.y = 0
  482.     IF camera.y < -(_HEIGHT(map) - _HEIGHT) THEN camera.y = -(_HEIGHT(map) - _HEIGHT)
  483.  
* Find The Gold.zip (Filesize: 2.71 MB, Downloads: 147)

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Find The Gold!
« Reply #32 on: October 27, 2020, 06:43:37 pm »
Woops sorry (I'm half-with it right now LOL). The grey target looking things is what happens after you have already used a mine shaft. That way you know you have been there before and can't use that mine shaft anymore. :)

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Find The Gold!
« Reply #33 on: October 28, 2020, 03:24:29 pm »
I finally won the game. :) It's not hard now with the mini-map. :)

Find The Gold - game by SierraKen 6 - You Won.jpg
* Find The Gold - game by SierraKen 6 - You Won.jpg (Filesize: 123.3 KB, Dimensions: 799x627, Views: 171)