Author Topic: eRATication Mark II  (Read 5203 times)

0 Members and 1 Guest are viewing this topic.

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
eRATication Mark II
« on: July 27, 2018, 02:00:54 am »
A first release of eRATication Mark II!
Modifications:
Splash Screen
Title screen
Menu with following options:
  Play game
  High Scores
  Options(volume controls, not finished yet)
  Help pages
  Quit
Audio SFX & BGM

There are still somethings that need finishing, but its playable and can track high scores.
* eRATication.rar (Filesize: 5.99 MB, Downloads: 306)
Granted after becoming radioactive I only have a half-life!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: eRATication Mark II
« Reply #1 on: July 27, 2018, 10:41:18 am »
Hi Cobalt

Love the music and sound effects and how you have modified the game!

Append: Ha! I thought you had downloaded the Naalaa version and included it but apparently the rar folder extracted right into the Naalaa one. The versions coexist peacefully enough. :D
« Last Edit: July 27, 2018, 10:58:48 am by bplus »

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: eRATication Mark II
« Reply #2 on: July 28, 2018, 11:48:28 am »
with any luck when(if) .NET comes back up I'll be able to find a way to keep the high scores online so everybody can see how others are doing at it.  Trying to decide just how far to go with the rat explosions too, I want to do something kinda showy but keep it basic too. I'll have to dig up some of my old fireworks programs. maybe I can find the old ABC resource, have a copy of it somewhere.
Granted after becoming radioactive I only have a half-life!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: eRATication Mark II
« Reply #3 on: July 28, 2018, 03:24:23 pm »
with any luck when(if) .NET comes back up I'll be able to find a way to keep the high scores online so everybody can see how others are doing at it.  Trying to decide just how far to go with the rat explosions too, I want to do something kinda showy but keep it basic too. I'll have to dig up some of my old fireworks programs. maybe I can find the old ABC resource, have a copy of it somewhere.

Here is something I dug up:
Code: QB64: [Select]
  1. _TITLE "le bombe"
  2. 'QB64 X 64 version 1.2 20180228/86  from git b301f92
  3.  
  4. '2018-07-28 translated from
  5. 'bomb.bas for SmallBASIC 0.12.2 [B+=MGA] 2016-05-09
  6. 'from explosion study
  7.  
  8. CONST xmax = 800
  9. CONST ymax = 600
  10. SCREEN _NEWIMAGE(xmax, ymax, 32)
  11. _SCREENMOVE 360, 60
  12. CONST max_particles = 1000
  13. CONST gravity = .25
  14. CONST air_resistance = .95
  15. TYPE particle
  16.     x AS SINGLE
  17.     y AS SINGLE
  18.     dx AS SINGLE
  19.     dy AS SINGLE
  20.     size AS SINGLE
  21.     kolor AS LONG
  22.     tf AS INTEGER
  23. DIM SHARED dots(max_particles) AS particle
  24.  
  25. 'main
  26.     FOR i = 1 TO 100
  27.         NewDot i
  28.     NEXT
  29.     rounds = 100
  30.     FOR i = 12 TO 0 STEP -1
  31.         IF _KEYDOWN(27) THEN END
  32.         CLS
  33.         DrawSky
  34.         DrawGround
  35.         DrawBomb
  36.         DrawFuse i
  37.         _DISPLAY
  38.         IF i = 0 THEN _DELAY RND * 3 ELSE _DELAY .100
  39.     NEXT
  40.     LINE (0, 0)-(xmax, ymax), _RGB32(255, 255, 255), BF
  41.     _DISPLAY
  42.     _DELAY .02
  43.     FOR loop_count = 0 TO 150
  44.         IF _KEYDOWN(27) THEN END
  45.         DrawSky
  46.         DrawGround
  47.         IF loop_count < 4 THEN
  48.             COLOR _RGB(64 - 8 * loop_count, 40 - 4 * loop_count, 32 - 4 * loop_count)
  49.             IF loop_count < 8 THEN fcirc xmax / 2, ymax / 2, 30 * (1 - loop_count * .25)
  50.         END IF
  51.         FOR i = 1 TO rounds
  52.             dots(i).x = dots(i).x + dots(i).dx
  53.             dots(i).y = dots(i).y + dots(i).dy
  54.             IF RND < .2 AND rounds > 10 AND dots(i).y > ymax / 2 THEN dots(i).dx = 0: dots(i).dy = 0
  55.             dots(i).dx = dots(i).dx * air_resistance
  56.             IF dots(i).dy <> 0 THEN dots(i).dy = air_resistance * dots(i).dy + .4 'air resistance and gravity
  57.             IF dots(i).tf THEN
  58.                 LINE (dots(i).x, dots(i).y)-STEP(dots(i).size, dots(i).size), dots(i).kolor, BF
  59.             ELSE
  60.                 COLOR dots(i).kolor
  61.                 fcirc dots(i).x, dots(i).y, dots(i).size / 2
  62.             END IF
  63.         NEXT
  64.         IF rounds < max_particles THEN
  65.             FOR i = 1 TO 100
  66.                 NewDot (rounds + i)
  67.             NEXT
  68.             rounds = rounds + 100
  69.         END IF
  70.         COLOR _RGB32(255, 255, 255), _RGB32(0, 0, 255)
  71.         LOCATE 1, 1: PRINT loop_count
  72.         _DISPLAY
  73.         _LIMIT 60
  74.     NEXT
  75.  
  76. SUB NewDot (i)
  77.     angle = _PI(RND * 2)
  78.     dots(i).x = xmax / 2 + RND * 30 * COS(angle)
  79.     dots(i).y = ymax / 2 + RND * 30 * SIN(angle)
  80.     r = RND 'STxAxTIC recommended for rounder spreads
  81.     dots(i).dx = r * 45 * COS(angle)
  82.     dots(i).dy = r * 45 * SIN(angle)
  83.     dots(i).size = RND * 7
  84.     dots(i).kolor = _RGB32(10 + RND * 100, 5 + RND * 50, 3 + RND * 25)
  85.     dots(i).tf = (RND * 2) \ 1
  86.  
  87. SUB DrawSky
  88.     FOR i = 0 TO ymax / 2
  89.         LINE (0, i)-STEP(xmax, 0), _RGB32(0, 0, 95 * i \ (ymax / 2) + 160)
  90.     NEXT
  91.  
  92. SUB DrawBomb
  93.     cx = xmax / 2: cy = ymax / 2 - 70: radius = 10
  94.     FOR i = 60 TO 0 STEP -1 'main body
  95.         COLOR _RGB32(240 - 4 * i, 180 - 3 * i, 120 - 2 * i)
  96.         fcirc cx, ymax / 2, i
  97.     NEXT
  98.  
  99.     FOR angle = 0 TO 180 'fuse shaft
  100.         rad_angle = _D2R(angle)
  101.         x1 = cx + radius * COS(rad_angle)
  102.         y1 = cy + radius * .25 * SIN(rad_angle)
  103.         LINE (x1, y1)-STEP(0, 20), _RGB32(127 + 127 * COS(rad_angle), 127 + 127 * COS(rad_angle), 127 + 127 * COS(rad_angle))
  104.     NEXT
  105.     COLOR _RGB32(0, 0, 0)
  106.     fEllipse cx, cy, radius, .25 * radius
  107.  
  108. SUB DrawFuse (length)
  109.     cx = xmax / 2: cy = ymax / 2 - 70
  110.     IF length <= 0 THEN EXIT SUB
  111.     COLOR _RGB32(255, 255, 0)
  112.     LINE (cx, cy - (5 + 2 * length))-STEP(2, 5), , BF
  113.     fcirc cx, cy - (1 + 2 * length), 2
  114.     rn = (RND * 5) \ 1 + 3
  115.     FOR i = 1 TO rn
  116.         rad_angle = _PI(RND) + _PI
  117.         x1 = cx + 7 * COS(rad_angle): x2 = cx + 14 * COS(rad_angle)
  118.         y1 = cy - (1 + 2 * length) + 9 * SIN(rad_angle): y2 = cy - (1 + 2 * length) + (RND * 13 + 9) * SIN(rad_angle)
  119.         LINE (x1, y1)-(x2, y2), _RGB32(255, 255, 255)
  120.     NEXT
  121.     FOR i = 1 TO length
  122.         rad_angle = _PI(RND * 2)
  123.         x1 = 3 * COS(rad_angle)
  124.         y1 = 3 * .25 * SIN(rad_angle)
  125.         LINE (cx, cy - 2 * i)-STEP(x1, y1), _RGB32(RND * 65 + 190, RND * 65 + 190, RND * 20 + 235), BF
  126.     NEXT
  127.  
  128. SUB DrawGround
  129.     FOR i = ymax / 2 TO ymax
  130.         LINE (0, i)-STEP(xmax, 0), _RGB32(0, 160 - 96 * (i - ymax / 2) \ (ymax / 2), 0)
  131.     NEXT
  132.  
  133. SUB fcirc (CX AS LONG, CY AS LONG, R AS LONG)
  134.     DIM subRadius AS LONG, RadiusError AS LONG
  135.     DIM X AS LONG, Y AS LONG
  136.  
  137.     subRadius = ABS(R)
  138.     RadiusError = -subRadius
  139.     X = subRadius
  140.     Y = 0
  141.  
  142.     IF subRadius = 0 THEN PSET (CX, CY): EXIT SUB
  143.  
  144.     ' Draw the middle span here so we don't draw it twice in the main loop,
  145.     ' which would be a problem with blending turned on.
  146.     LINE (CX - X, CY)-(CX + X, CY), , BF
  147.  
  148.     WHILE X > Y
  149.         RadiusError = RadiusError + Y * 2 + 1
  150.         IF RadiusError >= 0 THEN
  151.             IF X <> Y + 1 THEN
  152.                 LINE (CX - Y, CY - X)-(CX + Y, CY - X), , BF
  153.                 LINE (CX - Y, CY + X)-(CX + Y, CY + X), , BF
  154.             END IF
  155.             X = X - 1
  156.             RadiusError = RadiusError - X * 2
  157.         END IF
  158.         Y = Y + 1
  159.         LINE (CX - X, CY - Y)-(CX + X, CY - Y), , BF
  160.         LINE (CX - X, CY + Y)-(CX + X, CY + Y), , BF
  161.     WEND
  162.  
  163. SUB fEllipse (CX AS LONG, CY AS LONG, xRadius AS LONG, yRadius AS LONG)
  164.     DIM scale AS SINGLE, x AS LONG, y AS LONG
  165.     scale = yRadius / xRadius
  166.     LINE (CX, CY - yRadius)-(CX, CY + yRadius), , BF
  167.     FOR x = 1 TO xRadius
  168.         y = scale * SQR(xRadius * xRadius - x * x)
  169.         LINE (CX + x, CY - y)-(CX + x, CY + y), , BF
  170.         LINE (CX - x, CY - y)-(CX - x, CY + y), , BF
  171.     NEXT
  172.  
  173.  

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: eRATication Mark II
« Reply #4 on: August 01, 2018, 01:15:57 pm »
Build 15 of eRATication Mark II
 upgraded rat 'splats' (some monitors may look a bit purpleish in color???)
 upgraded player explosion!
 now play using the standard shooter or as a wedge of cheese!(hard code constant:CONST ShooterStyle)
 now contains credits screen!

code has been broken down into functions and stored as include files to shrink main file and for ease of modifying individual components. While this is not a problem on Windows machines, I'm not sure how Linux or Mac will respond due to the functions being stored in a separate directory. Final release will be reintegrated to a single file to avoid these possible issues.
* eRATication.rar (Filesize: 6.01 MB, Downloads: 305)
Granted after becoming radioactive I only have a half-life!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: eRATication Mark II
« Reply #5 on: August 01, 2018, 01:55:29 pm »
Hi Cobalt,

Coming along nicely! Nice explosion of shooter into hologram fragments of shooter!

I guess I could have quite doing cheese with first fix of holes but I made some mighty fine cheese this morning and considered having the rats race over a whole floor of it.

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: eRATication Mark II
« Reply #6 on: August 01, 2018, 06:25:31 pm »
Thanks Bplus,

I'll probably tweak it some at a later date. maybe make it a 2 layer deal, make the cheese with some black holes then putimage that over a triangle of the darker color so the holes can cut the side of the cheese too. need to find a way to add the 'rounded' back for the shooter, like it was cut from a cheese wheel. simply enough to use a circle but it has to be a bigger circle than the shooter which means you have to erase the unneeded part before drawing the shooter, at the angle of the shooter. probably with two triangles but just seems like a large amount of work for such a small change.

Once I load the cheese palette the explosion of the shooter should look even better. I really need to get the options menu worked out so the volume levels can be adjusted.
Though if Galleon doesn't bring the R\O copy of .net forum back up I'm not sure what I'll do about the high scores list. I could probably figure out a way but it would be simpler and faster just to find Steves code from his Double Up game there.
Granted after becoming radioactive I only have a half-life!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: eRATication Mark II
« Reply #7 on: August 02, 2018, 10:23:41 am »
A cheese wedge from a round cake, this can be done thanks to my planet sphere practice with [banned user]'s space thing.

Besides the 2nd shooter wedge I had designed wasn't going to work for detecting collisions, you need shooter's x, y in center of shooter.


Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: eRATication Mark II
« Reply #8 on: August 03, 2018, 09:57:37 am »
Hi Cobalt,

Cheese wedge ready when you are:
https://www.qb64.org/forum/index.php?topic=386.0
see 'fixed' reply

I also made it so shooterX, and shooterY is in center of wedge for easy collision detection as in original codes.

The drawShooter code is allot smaller without all the checking and extra drawing and the cheese drawing is self-contained sub just  need to DIM share a cheese& handle. It might also be used for explosion particles by cutting (_MAPTRIANGLE 's) from it.
« Last Edit: August 03, 2018, 10:06:51 am by bplus »

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: eRATication Mark II
« Reply #9 on: August 04, 2018, 05:34:47 pm »
Well here it is, the final beta release of eRATication Mark II. (until .NET comes back up or .ORG gets a copy of the forum anyway)
Everything is there to some extent, the high score list is the only thing that needs extensive finishing.
There is some tweaking to be done here and there and some cosmetic issues that really don't affect game play but I may still attack and destroy for the actual alpha release.

The Options screen now works and allows adjustment of the sound levels for the Background Music, Rat sound FX and shooter Sound FX. Also allows you to choose between the original shooter or the Cheesey shooter! The Option menu is controlled with the mouse, exit by clicking DONE or pressing enter. To abort changes press ESC.

The shot collision is still a bit glitchy and hitting the smaller rats can be a pain sometimes, this will be an ongoing adjustment but, the game is still playable.

High Score Names will only show 12 letters at the moment(though it says up to 16) this will be adjusted\fixed\up graded or what-not once I can get an online High Scores list running.

There is now a copy of the BAS that is 'in-line' and does not include the functions from a separate directory, for those OSs that don't have the same directory structure as Windows.

there may be various minor upgrades and\or changes as thing go along, but for now enjoy it, find bugs, have fun.
* eRATication.rar (Filesize: 5.95 MB, Downloads: 255)
Granted after becoming radioactive I only have a half-life!