Author Topic: eRATication  (Read 10800 times)

0 Members and 1 Guest are viewing this topic.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: eRATication
« Reply #15 on: July 17, 2018, 10:35:47 am »
Hi Cobalt,

I think we have the gun action fixed in eRATication #2, Erik was complaining of jerkiness and that was caused by the delay to display a rat burn but now that is done in the main looping display.

Bullets have been made inactive with rat hit, ba(i) = 0

See reply #6 for eRATication #2 code, and then new gun action in next reply.

Ha, you did Hamsters! Great minds think alike.

Thanks for your grade, B is for Best! :D

Offline _vince

  • Seasoned Forum Regular
  • Posts: 422
    • View Profile
Re: eRATication
« Reply #16 on: July 17, 2018, 10:37:41 am »
in the fcirc sub
Code: QB64: [Select]
  1. e = 0
should be
Code: QB64: [Select]
  1. e = -R

A mistake I made that got spread about. Otherwise, anyone's welcome to use the fcirc, simplest implementation of midpoint circle fill algo, no credit necessary.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: eRATication
« Reply #17 on: July 17, 2018, 10:44:03 am »
Hi v,

Thanks for correction. I did notice when playing with gradient code (see recent dithering thread) that Steve's fcirc did seem less bumpy around the edges. Maybe just my imagination, would the -R make a difference for that?

Offline _vince

  • Seasoned Forum Regular
  • Posts: 422
    • View Profile
Re: eRATication
« Reply #18 on: July 17, 2018, 11:04:21 am »
would the -R make a difference for that?

Yes it will make it just like Steve's

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: eRATication
« Reply #19 on: July 17, 2018, 10:51:13 pm »
If you want to have some good laughs change the following line in the NEWRAT routine,

rr(iRat) = RND * 60 / life + 10

to

rr(iRat) = RND * 60 / life + 1

and try shooting that little turd!

a possible scoring mod would be having a base score say 71 per rat and subtract the size of the rat from that
so a full size rat (60+10) would only give you 1 point(71-70) but a micro rat (0+1) would give 70, if you could hit the thing that is! you could multiply it by the rats speed too.
 
 
Granted after becoming radioactive I only have a half-life!

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: eRATication
« Reply #20 on: July 18, 2018, 12:40:59 am »
hope you dont mind Bplus but I've made some slight mods to your game, and now the player can move the shooter around the screen!
Code: QB64: [Select]
  1.  'use arrow keys to swing shooter, spacebar to fire
  2.  'left shift to speed up rotation, this frees up the UP arrow to allow for movement
  3.  'of the players craft.
  4.  IF _KEYDOWN(100304) THEN speed%% = 20 ELSE speed%% = 60
  5.  IF _KEYDOWN(19200) THEN P.Rot = P.Rot - _PI(1 / speed%%)
  6.  IF _KEYDOWN(19712) THEN P.Rot = P.Rot + _PI(1 / speed%%)
  7.  
  8.  IF _KEYDOWN(18432) THEN 'up arrow provides thrust!
  9.   P.Momentum = P.Momentum + .056
  10.   IF P.Momentum > 1.86 THEN P.Momentum = 1.86
  11.  ELSEIF P.Momentum THEN 'player is no longer thrusting and still has momentum
  12.   P.Momentum = P.Momentum - Drag
  13.   IF P.Momentum < 0 THEN P.Momentum = 0
  14.  
  15.  ' IF _KEYDOWN(20480) THEN P.Rot = P.Rot + _PI(1 / 30)
  16.  IF _KEYDOWN(32) THEN fire = 1 ELSE fire = 0
  17.  
  18.  'move player around if they have momentum
  19.  P.Xloc = P.Xloc + P.Momentum * COS(P.Rot)
  20.  P.Yloc = P.Yloc + P.Momentum * SIN(P.Rot)
  21.  'stop the player if they encroach upon the screen bounds
  22.  IF P.Xloc < 30 OR P.Yloc < 30 OR P.Xloc > ScrnX - 30 OR P.Yloc > ScrnY - 30 THEN P.Momentum = 0
  23.  'now that does allow player to move extreamly slow, like they are stuck in tar! but they
  24.  'can still leave screen, in that case they lose a life.
  25.  
  26.  IF P.Xloc <= 0 OR P.Xloc >= ScrnX OR P.Yloc <= 0 OR P.Yloc >= ScrnY THEN
  27.   P.Life = P.Life + 1 'player left screen by force! KILL EM'
  28.   P.Xloc = ScrnX \ 2: P.Yloc = ScrnY \ 2
  29.  drawshooter P.Xloc, P.Yloc, P.Rot
  30.  

'drag' is a CONST set to .01 and slows the player rather quickly not that 1.86 moves the player that fast anyway.
I've taken the liberty and setup my own variables as TYPEs just cause that is easier for me to work with.
it still needs some work cause I'd like the craft to keep moving in the direction the player was traveling when they
let go of the UP key regaurdless of whether they rotate. but not quite sure how to do that one. maybe a variable
for thrust Rotation (p.Thrstrot) that stores the rotation of the craft at the time the key was held. and just use that
variable instead of p.rot in the movement lines.
« Last Edit: July 18, 2018, 12:45:39 am by Cobalt »
Granted after becoming radioactive I only have a half-life!

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: eRATication
« Reply #21 on: July 18, 2018, 01:29:24 am »
not sure what i did but every so often one of my rats has lost his arse! this shot shows one of the smaller rats but they do get even smaller than that when you change that +10 to a +1!
rattingit.jpg
* rattingit.jpg (Filesize: 107.96 KB, Dimensions: 1024x640, Views: 425)
Granted after becoming radioactive I only have a half-life!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: eRATication
« Reply #22 on: July 18, 2018, 08:57:19 am »
Hi Cobalt,

Mod all you want, that is the beauty of sharing code. It's fun to see what other people are doing with it. I myself was inspired by SirCrow's efforts. Besides, it's not like this idea is original. :)

I have thought about moving the shooter like Asteroids but there seem to be too many buttons needed for one comfortable control. So it becomes a 2 handed job, but my left hand is not very smart when my right hand is busy. ha! just got an idea, use mouse to move shooter and left and right mouse buttons to spin the shooter. That leaves the simple task of pounding the spacebar to the left hand (or vice versa for Lefties).

Speaking of spacebars, do you think they serve coffee there?




Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: eRATication
« Reply #23 on: July 19, 2018, 01:36:44 pm »
so here is a preview release of the MODed version of Bplus's eRATication game.
Still some work to do but, it gives you an idea of the feel I'm going for.
probably start new thread when Its completed.

Code: QB64: [Select]
  1. 'eRATication by Bplus 2018-07-15
  2. 'Ultra Mod version by Cobalt 2018-07-19 13:25 Build 0001 Ver 1.0beta
  3.  
  4. 'known things to fix/complete:
  5. '   re-add rat collision with player
  6. '    À-Currently in GOD mode. :)
  7. '   add Title screen and Title Bar text
  8. '   fix bullet collision with rat so Mini rats are hit correctly
  9. '    À-add more points of detection shots tend to pass right by :(
  10. '   add highscore list
  11. '   re-add hit explosions
  12. '    À-rats simply vanish at the moment :(
  13.  
  14. TYPE RatData
  15.  Xloc AS SINGLE 'X location
  16.  Yloc AS SINGLE 'Y location
  17.  Siz AS INTEGER 'Size(radius)
  18.  Rot AS SINGLE 'Rotation(heading)
  19.  Spd AS SINGLE 'Speed
  20.  Colr AS _UNSIGNED LONG 'color of rat
  21.  Val AS _UNSIGNED _BYTE 'score value of rat
  22.  
  23. TYPE Bulletdata
  24.  Xloc AS SINGLE 'locations
  25.  Yloc AS SINGLE
  26.  DXval AS SINGLE 'movement values
  27.  DYval AS SINGLE
  28.  RemFlag AS _BYTE 'if the shot has hit a rat or gone offscreen flag for removal
  29.  
  30. TYPE PlayerData
  31.  Rot AS SINGLE
  32.  Xloc AS SINGLE
  33.  Yloc AS SINGLE
  34.  Life AS _BYTE
  35.  Points AS _UNSIGNED LONG
  36.  walk AS SINGLE '???
  37.  Momentum AS SINGLE 'players movement speed
  38.  ThrstRot AS SINGLE 'the rotation of players craft when thrust was stopped
  39.  
  40. 'constants
  41. CONST ScrnX = 800
  42. CONST ScrnY = 600
  43.  
  44. CONST MaxRats = 100
  45. CONST MaxBullets = 25
  46. CONST MaxShots = 3 'only 3 shots at a time on screen
  47. CONST BulletSpeed = 20
  48. CONST RatScore = 71 'how much the base score of each rat is
  49. CONST Drag = .015 'how much the players movement slows over time
  50. CONST Rate = .25 'delay between shots fired
  51. CONST RatCount = 5 'base rat count
  52. CONST TRUE = -1, FALSE = NOT TRUE
  53.  
  54. 'Make screen and set timer
  55. SCREEN _NEWIMAGE(ScrnX, ScrnY, 32)
  56.  
  57. 'set up arrays
  58. DIM SHARED P AS PlayerData
  59. DIM SHARED Rats(MaxRats) AS RatData
  60. DIM SHARED Shot(MaxBullets) AS Bulletdata
  61.  
  62. 'set up layers, an idea for haveing everything on its own layer then
  63. 'combining them on to the display
  64. 'DIM SHARED shiplayer&, ratlayer&
  65. 'shiplayer& = _NEWIMAGE(ScrnX, ScrnY, 32)
  66. 'ratlayer& = _NEWIMAGE(ScrnX, ScrnY, 32)
  67.  
  68. 'initilize starting Values
  69. ShotsFired%% = 0 'number of shots fired
  70. P.Life = 1 'player on life #1
  71. P.Points = 0
  72. P.Rot = 0
  73. P.Xloc = ScrnX \ 2
  74. P.Yloc = ScrnY \ 2
  75.  
  76. 'make some Rats
  77. FOR i%% = 0 TO RatCount - 1
  78.  newRat i%%
  79. 'OPEN "debug.txt" FOR OUTPUT AS #1
  80.  CLS
  81.  walk = (walk + 1) MOD 2
  82.  FOR i = 1 TO P.Life * RatCount 'the rats
  83.   drawRat i
  84.  
  85.  'use arrow keys to swing shooter, spacebar to fire
  86.  'left shift to speed up rotation, this frees up the UP arrow to allow for movement
  87.  'of the players craft.
  88.  IF _KEYDOWN(100304) THEN speed%% = 20 ELSE speed%% = 60
  89.  IF _KEYDOWN(19200) THEN P.Rot = P.Rot - _PI(1 / speed%%)
  90.  IF _KEYDOWN(19712) THEN P.Rot = P.Rot + _PI(1 / speed%%)
  91.  
  92.  IF _KEYDOWN(18432) THEN 'up arrow provides thrust!
  93.   P.Momentum = P.Momentum + .056
  94.   IF P.Momentum > 2.86 THEN P.Momentum = 2.86
  95.   P.ThrstRot = P.Rot 'get current rotation
  96.  ELSEIF P.Momentum THEN 'player is no longer thrusting and still has momentum
  97.   P.Momentum = P.Momentum - Drag
  98.   IF P.Momentum < 0 THEN P.Momentum = 0
  99.  
  100.  ' IF _KEYDOWN(20480) THEN P.Rot = P.Rot + _PI(1 / 30)
  101.  'added cooldown to shooting so you can't auto gun 'normally' maybe add specails
  102.  'or bonuses to allow that later
  103.  IF _KEYDOWN(32) AND ShotsFired%% < MaxShots AND cooldown! + Rate < TIMER THEN
  104.   ShotsFired%% = NewShot(ShotsFired%%): cooldown! = TIMER
  105.  
  106.  IF ShotsFired%% THEN ShotsFired%% = shotprocess(ShotsFired%%)
  107.  PlayerMovement
  108.  drawshooter P.Xloc, P.Yloc, P.Rot
  109.  
  110.  IF P.Life > 3 THEN ExitFlag%% = TRUE
  111.  IF INKEY$ = CHR$(27) THEN ExitFlag%% = TRUE
  112.  
  113.  LOCATE 1, 1: PRINT "Life:"; P.Life; TAB(10); "Points:";
  114.  PRINT USING "#,###,###"; P.Points
  115.  
  116.  _DELAY .05
  117. LOOP UNTIL ExitFlag%%
  118.  
  119.  
  120. SUB newRat (iRat)
  121.  'bring rock in from one side, need to set heading according to side
  122.  'RANDOMIZE TIMER + RND
  123.  side%% = INT(RND * 4) + 1
  124.  SELECT CASE side%%
  125.   CASE 1: Rats(iRat).Xloc = 0: Rats(iRat).Yloc = RND * ScrnY: Rats(iRat).Rot = 3 * _PI / 2 + RND * _PI
  126.   CASE 2: Rats(iRat).Xloc = ScrnX: Rats(iRat).Yloc = RND * ScrnY: Rats(iRat).Rot = _PI / 2 + RND * _PI
  127.   CASE 3: Rats(iRat).Xloc = RND * ScrnX: Rats(iRat).Yloc = 0: Rats(iRat).Rot = RND * _PI
  128.   CASE 4: Rats(iRat).Xloc = RND * ScrnX: Rats(iRat).Yloc = ScrnY: Rats(iRat).Rot = _PI + RND * _PI
  129.  
  130.  'speed, angle, radius, gray coloring, spin, seed
  131.  Rats(iRat).Spd = RND * 5 * P.Life + 1
  132.  Rats(iRat).Siz = RND * 60 / P.Life + 3
  133.  Rats(iRat).Colr = ratKolor~&
  134.  
  135. SUB drawRat (i)
  136.  'move the rat
  137.  Rats(i).Xloc = Rats(i).Xloc + Rats(i).Spd * COS(Rats(i).Rot) + rand(-.1 * Rats(i).Siz, .1 * Rats(i).Siz)
  138.  Rats(i).Yloc = Rats(i).Yloc + Rats(i).Spd * SIN(Rats(i).Rot) + rand(-.1 * Rats(i).Siz, .1 * Rats(i).Siz)
  139.  
  140.  IF Rats(i).Xloc > 0 AND Rats(i).Xloc < ScrnX AND Rats(i).Yloc > 0 AND Rats(i).Yloc < ScrnY THEN 'inbounds
  141.   noseX = Rats(i).Xloc + 2 * Rats(i).Siz * COS(Rats(i).Rot)
  142.   noseY = Rats(i).Yloc + 2 * Rats(i).Siz * SIN(Rats(i).Rot)
  143.   neckX = Rats(i).Xloc + .75 * Rats(i).Siz * COS(Rats(i).Rot)
  144.   neckY = Rats(i).Yloc + .75 * Rats(i).Siz * SIN(Rats(i).Rot)
  145.   tailX = Rats(i).Xloc + 2 * Rats(i).Siz * COS(Rats(i).Rot + _PI)
  146.   tailY = Rats(i).Yloc + 2 * Rats(i).Siz * SIN(Rats(i).Rot + _PI)
  147.   earLX = Rats(i).Xloc + Rats(i).Siz * COS(Rats(i).Rot - _PI(1 / 12))
  148.   earLY = Rats(i).Yloc + Rats(i).Siz * SIN(Rats(i).Rot - _PI(1 / 12))
  149.   earats.sizats.xloc = Rats(i).Xloc + Rats(i).Siz * COS(Rats(i).Rot + _PI(1 / 12))
  150.   earats.sizats.yloc = Rats(i).Yloc + Rats(i).Siz * SIN(Rats(i).Rot + _PI(1 / 12))
  151.   fcirc Rats(i).Xloc, Rats(i).Yloc, .65 * Rats(i).Siz, Rats(i).Colr
  152.   fcirc neckX, neckY, Rats(i).Siz * .3, Rats(i).Colr
  153.   fTri noseX, noseY, earLX, earLY, earats.sizats.xloc, earats.sizats.yloc, Rats(i).Colr
  154.   fcirc earLX, earLY, Rats(i).Siz * .3, Rats(i).Colr
  155.   fcirc earats.sizats.xloc, earats.sizats.yloc, Rats(i).Siz * .3, Rats(i).Colr
  156.   wX = .5 * Rats(i).Siz * COS(Rats(i).Rot - _PI(11 / 18))
  157.   wY = .5 * Rats(i).Siz * SIN(Rats(i).Rot - _PI(11 / 18))
  158.   LINE (noseX + wX, noseY + wY)-(noseX - wX, noseY - wY), Rats(i).Colr
  159.   wX = .5 * Rats(i).Siz * COS(Rats(i).Rot - _PI(7 / 18))
  160.   wY = .5 * Rats(i).Siz * SIN(Rats(i).Rot - _PI(7 / 18))
  161.   LINE (noseX + wX, noseY + wY)-(noseX - wX, noseY - wY), Rats(i).Colr
  162.   LINE (Rats(i).Xloc, Rats(i).Yloc)-(tailX, tailY), Rats(i).Colr
  163.  ELSE 'out of bounds
  164.   newRat i
  165.  
  166. SUB fTri (x1, y1, x2, y2, x3, y3, K AS _UNSIGNED LONG)
  167.  a& = _NEWIMAGE(1, 1, 32)
  168.  _DEST a&
  169.  PSET (0, 0), K
  170.  _DEST 0
  171.  _MAPTRIANGLE _SEAMLESS(0, 0)-(0, 0)-(0, 0), a& TO(x1, y1)-(x2, y2)-(x3, y3)
  172.  _FREEIMAGE a& '<<< this is important!
  173.  
  174. 'vince version
  175. SUB fcirc (x AS LONG, y AS LONG, R AS LONG, C AS _UNSIGNED LONG)
  176.  x0 = R
  177.  y0 = 0
  178.  e = 0
  179.  DO WHILE y0 < x0
  180.   IF e <= 0 THEN
  181.    y0 = y0 + 1
  182.    LINE (x - x0, y + y0)-(x + x0, y + y0), C, BF
  183.    LINE (x - x0, y - y0)-(x + x0, y - y0), C, BF
  184.    e = e + 2 * y0
  185.   ELSE
  186.    LINE (x - y0, y - x0)-(x + y0, y - x0), C, BF
  187.    LINE (x - y0, y + x0)-(x + y0, y + x0), C, BF
  188.    x0 = x0 - 1
  189.    e = e - 2 * x0
  190.   END IF
  191.  LINE (x - R, y)-(x + R, y), C, BF
  192.  
  193. FUNCTION ratKolor~& ()
  194.  r% = INT(RND * 70) + 70
  195.  g% = INT(RND * (.5 * r%)) + .2 * r%
  196.  b% = INT(RND * (.4 * g%)) + .1 * g%
  197.  ' r% = 165: g% = 95: b% = 25
  198.  ratKolor~& = _RGB32(r%, g%, b%)
  199.  
  200. FUNCTION rand% (lo%, hi%)
  201.  rand% = INT(RND * (hi% - lo% + 1)) + lo%
  202.  
  203. SUB drawshooter (x, y, radianAngle) 'simple red iso triangle pointed towards radianAngle
  204.  'calculate 3 points of triangle shooter
  205.  x1 = x + 60 * COS(radianAngle) 'main point of shooter according to heading
  206.  y1 = y + 60 * SIN(radianAngle)
  207.  x2 = x + 30 * COS(radianAngle + _PI(2 / 3)) 'next two points are 120 degrees off main point in direction
  208.  y2 = y + 30 * SIN(radianAngle + _PI(2 / 3))
  209.  x3 = x + 30 * COS(radianAngle - _PI(2 / 3))
  210.  y3 = y + 30 * SIN(radianAngle - _PI(2 / 3))
  211.  fTri x, y, x1, y1, x2, y2, _RGB(255, 0, 0)
  212.  fTri x, y, x1, y1, x3, y3, _RGB(255, 0, 0)
  213.  LINE (x1, y1)-(x2, y2), _RGB32(255, 255, 128)
  214.  LINE (x1, y1)-(x3, y3), _RGB32(255, 255, 128)
  215.  LINE (x1, y1)-(x, y), _RGB32(255, 255, 128)
  216.  
  217. FUNCTION shotprocess (Count%%)
  218.  IF Count%% THEN 'are there active shots to move
  219.   FOR i%% = 0 TO Count%% - 1
  220.    Shot(i%%).Xloc = Shot(i%%).Xloc + Shot(i%%).DXval
  221.    Shot(i%%).Yloc = Shot(i%%).Yloc + Shot(i%%).DYval
  222.  
  223.    'check for shot hitting rat
  224.    IF RatCollision(i%%) THEN behappy = yes
  225.  
  226.    IF Shot(i%%).Xloc > 0 AND Shot(i%%).Xloc < ScrnX AND Shot(i%%).Yloc > 0 AND Shot(i%%).Yloc < ScrnY THEN 'in bounds draw it
  227.     fcirc Shot(i%%).Xloc, Shot(i%%).Yloc, 2, _RGB32(170, 130, 10)
  228.    ELSE 'shot is off screen
  229.     Shot(i%%).RemFlag = TRUE
  230.    END IF
  231.   NEXT i%%
  232.   'check for offscreen shots
  233.   FOR j%% = 0 TO Count%%
  234.    IF Shot(j%%).RemFlag THEN 'shot is flaged for removal from rathit or offscreen
  235.     FOR i%% = j%% TO Count%% + 1
  236.      Shot(i%%).Xloc = Shot(i%% + 1).Xloc
  237.      Shot(i%%).Yloc = Shot(i%% + 1).Yloc
  238.      Shot(i%%).DXval = Shot(i%% + 1).DXval
  239.      Shot(i%%).DYval = Shot(i%% + 1).DYval
  240.      Shot(i%%).RemFlag = Shot(i%% + 1).RemFlag
  241.     NEXT i%%
  242.     Count%% = Count%% - 1
  243.    END IF
  244.   NEXT j%%
  245.  shotprocess = Count%%
  246.  
  247. FUNCTION NewShot (id%%)
  248.  'fire a bullet
  249.  Shot(id%%).Xloc = P.Xloc + 3 * BulletSpeed * COS(P.Rot)
  250.  Shot(id%%).Yloc = P.Yloc + 3 * BulletSpeed * SIN(P.Rot)
  251.  Shot(id%%).DXval = BulletSpeed * COS(P.Rot)
  252.  Shot(id%%).DYval = BulletSpeed * SIN(P.Rot)
  253.  Shot(id%%).RemFlag = FALSE
  254.  id%% = id%% + 1
  255.  NewShot = id%%
  256.  
  257. SUB PlayerMovement
  258.  'move player around if they have momentum
  259.  P.Xloc = P.Xloc + P.Momentum * COS(P.ThrstRot)
  260.  P.Yloc = P.Yloc + P.Momentum * SIN(P.ThrstRot)
  261.  'stop the player if they encroach upon the screen bounds
  262.  IF P.Xloc < 30 OR P.Yloc < 30 OR P.Xloc > ScrnX - 30 OR P.Yloc > ScrnY - 30 THEN P.Momentum = 0
  263.  'now that does allow player to move extreamly slow, like they are stuck in tar! but they
  264.  'can still leave screen, in that case they lose a life.
  265.  
  266.  IF P.Xloc <= 0 OR P.Xloc >= ScrnX OR P.Yloc <= 0 OR P.Yloc >= ScrnY THEN
  267.   P.Life = P.Life + 1 'player left screen by force! KILL EM'
  268.   P.Xloc = ScrnX \ 2: P.Yloc = ScrnY \ 2
  269.  
  270. FUNCTION RatCollision (id%%)
  271.  FOR j%% = 0 TO RatCount * P.Life
  272.   check~& = POINT(Shot(id%%).Xloc, Shot(id%%).Yloc)
  273.   IF check~& <> 0 THEN 'if bullet finds a nother color
  274.    FOR i%% = 0 TO RatCount * P.Life 'which rat was hit.
  275.     IF Rats(i%%).Colr = check~& THEN 'found dead rat
  276.      'give player points
  277.      P.Points = P.Points + (RatScore - Rats(i%%).Siz)
  278.      'kill that rat
  279.      newRat i%%
  280.      'kill the shot
  281.      Shot(id%%).RemFlag = TRUE
  282.      'exit the for next loop
  283.      i%% = RatCount * P.Life + 2
  284.     END IF
  285.    NEXT i%%
  286.    results%% = TRUE
  287.   ELSE
  288.    results%% = FALSE
  289.   END IF
  290.  NEXT j%%
  291.  RatCollision = results%%
  292.  
Granted after becoming radioactive I only have a half-life!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: eRATication
« Reply #24 on: July 20, 2018, 12:25:26 pm »
Hi Cobalt,

To me, it seems like you are a little stingy with the bullets. ;-))

But it appears you are moving the shooter like I did with Lander, which is cool, specially now that I have practiced. :)

Oh I also meant to report I have tried the idea I mentioned above and love the control!!

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: eRATication
« Reply #25 on: July 20, 2018, 05:09:18 pm »
To me, it seems like you are a little stingy with the bullets. ;-))
It does add a bit of difficulty doesn't it! It may become part of the difficulty setting if I go that far with this.

But it appears you are moving the shooter like I did with Lander, which is cool, specially now that I have practiced. :)

not totally happy with it, as if your drifting and thrust again you instantly start moving in the new direction instead of slowing down\stopping first, but fixing that is beyond my skill.

but I have the Title screen done and have added sounds with background music! Check it out!
Haven't converted the wav to mp3 yet cause I'm still tweaking them, rest assured when I decide I'm happy with them they will be compressed down to mp3 files. The BGM came that way thats why it already is. The sounds are from 'FreeSound.org' and the BGM is from 'dig.ccmixter.org' , a credits screen is in the works but not there yet.
* RatGame.rar (Filesize: 3.03 MB, Downloads: 245)
Granted after becoming radioactive I only have a half-life!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: eRATication
« Reply #26 on: July 20, 2018, 07:18:13 pm »
Quote

' 2018-07-20 eRATication 3
' Shooter: location controlled by mouse
'          mouse left and right button works like left and right arrow keys.
' Code: use type for objects, simplify math where possible
'       complete makeover of code.
'       Fixed problem of running into burning rat.
' Display: Life # and Points on screen as Fellippe suggested.
' Points: should be directly proportional to rat's speed and indirectly
'          proportional to size, so speed\size!
'          but compare that to number of shots taken!


'================================ Instructions ==========================
' Up and down arrows for fast rotation of shooter.
' Left and right arrows for more fine tuned rotation of shooter.
' Shooter is connected to mouse, moving mouse moves shooter.
' Left mouse button down for counter-clock wise rotation and
' Right mouse button down for clock- wise rotation.
' Spacebar fires bullets.
'========================================================================

DEFINT A-Z
* eRATication no 3.zip (Filesize: 3.43 KB, Downloads: 202)