Author Topic: Fairground Duck Shoot Simulation Game in Preparation  (Read 3760 times)

0 Members and 1 Guest are viewing this topic.

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Fairground Duck Shoot Simulation Game in Preparation
« on: June 19, 2019, 08:06:12 am »
This is a simulation of a Duck Shoot booth.  A game of skill where you have to aim at the moving targets (pigeons in this game) and fire a projectile to knock them over.

The simulation of the firing apparatus ('rifle') in this game is effected by having two aiming images which have to be correctly aligned.  The larger circle-with-cross is imagined to be the cross-hairs in the aiming sight closest to your eye, and the smaller circle-with-cross represents the far end of the 'rifle'.  When the two are aligned on top of each other, the 'rifle' fires directly into the screen.  If the projectile lands within the circular target of one of the moving objects, it is knocked over.

The aiming sights are moved as follows: Near-sight keys w, a,d,z to move Up, Left, Right and Down respectively; Far-sight keys p, l, . , and ' to move Up, Left, Right and Down respectively.  To fire the 'rifle', use key s.  The near-sight keys and fire key are for your left hand, and the far-sight keys are for your right hand.

The direction with which the projectile moves depends upon the alignment of the two sights and the velocity of the far sight.

The game at present is in preparation only with many factors to be completed.  Eventually there will be a number of levels with increasing skill required.  This demo is effectively at the lowest skill level where all factors are made easy.  The eventual program will be produced with InForm.

If you would like to try this demo and provide any feedback, I shall be very grateful.

Use the URL to download the zip file and export the Folder into your QB64 folder.  Open the .bas program in the IDE.

https://www.dropbox.com/s/f08ixezx5wk94xc/Duck%20Shoot.zip?dl=1
screenshot.png
* screenshot.png (Filesize: 1.19 MB, Dimensions: 1255x836, Views: 248)

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Fairground Duck Shoot Simulation Game in Preparation
« Reply #1 on: June 19, 2019, 08:37:02 am »
Um... I am not an Ornithologist, but your 'ducks', are actually pigeons... But looks like fun... They are NOT going to shoot back are they? lol
Logic is the beginning of wisdom.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Fairground Duck Shoot Simulation Game in Preparation
« Reply #2 on: June 21, 2019, 01:57:40 am »
Hi Qwerkey,

Oh hey! I just found this in my downloads folder.

Very elaborate production, great start!

Maybe if the spiral were spinning? :)

Code: QB64: [Select]
  1. _TITLE "Psychedelic Star Swirl bplus 2018-03-04"
  2. ' translated from
  3. ' Psychedelic Star Swirl.bas SmallBASIC 0.12.8 [B+=MGA] 2017-03-03
  4. ' Spiral Pearl Swirl 4 SB.bas  SmallBASIC 0.12.8 [B+=MGA] 2017-03-01
  5. ' from Spiral Pearl Swirl.bas for FreeBASIC [B+=MGA] 2017-02-28
  6. ' from SdlBasic 3d version 2017-02-28
  7. ' inspired by spiral Bang
  8. CONST xmax = 1280
  9. CONST ymax = 760
  10. SCREEN _NEWIMAGE(xmax, ymax, 32)
  11.  
  12. DIM SHARED r, g, b, clr
  13. 'whatever screen size your device here is middle
  14. cx = xmax / 2: cy = ymax / 2: r = RND: g = RND: b = RND: k$ = " "
  15.     size = 1
  16.     radius = .06
  17.     angle = sangle
  18.     CLS
  19.     WHILE radius < 800
  20.         x = COS(angle) * radius
  21.         y = SIN(angle) * radius
  22.         r2 = (x ^ 2 + y ^ 2) ^ .5
  23.         size = 4 * r2 ^ .25
  24.         FOR r = size TO 1 STEP -4
  25.             'cc = 160 + 95 * radius/400 - r/size*120
  26.             chColor
  27.             star cx + x, cy + y, r / 3, r * 1.6, 5, RND * 360
  28.         NEXT
  29.         angle = angle - .4
  30.         radius = radius + 1
  31.     WEND
  32.     _DISPLAY ' update screen with new image
  33.     _LIMIT 15 '<<<<<<<<<<<<<<<<<<<<<<<<<< adjust to higher speeds if you dare
  34.     sangle = sangle + _PI(1 / 18)
  35.  
  36. SUB star (x, y, rInner, rOuter, nPoints, angleOffset)
  37.     ' x, y are same as for circle,
  38.     ' rInner is center circle radius
  39.     ' rOuter is the outer most point of star
  40.     ' nPoints is the number of points,
  41.     ' angleOffset = angle offset IN DEGREES, it will be converted to radians in sub
  42.     ' this is to allow us to spin the polygon of n sides
  43.     pAngle = RAD(360 / nPoints): radAngleOffset = RAD(angleOffset)
  44.     x1 = x + rInner * COS(radAngleOffset)
  45.     y1 = y + rInner * SIN(radAngleOffset)
  46.     FOR i = 0 TO nPoints - 1
  47.         x2 = x + rOuter * COS(i * pAngle + radAngleOffset + .5 * pAngle)
  48.         y2 = y + rOuter * SIN(i * pAngle + radAngleOffset + .5 * pAngle)
  49.         x3 = x + rInner * COS((i + 1) * pAngle + radAngleOffset)
  50.         y3 = y + rInner * SIN((i + 1) * pAngle + radAngleOffset)
  51.         LINE (x1, y1)-(x2, y2)
  52.         LINE (x2, y2)-(x3, y3)
  53.         x1 = x3: y1 = y3
  54.     NEXT
  55.  
  56. SUB chColor ()
  57.     clr = clr + 1
  58.     COLOR _RGB32(127 + 127 * SIN(r * clr), 127 + 127 * SIN(g * clr), 127 + 127 * SIN(b * clr))
  59.     IF clr > 40000 THEN r = RND: g = RND: b = RND: clr = 0
  60. FUNCTION RAD (dA)
  61.     RAD = _PI(dA / 180)
  62.  
  63.  
« Last Edit: June 21, 2019, 02:07:39 am by bplus »

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: Fairground Duck Shoot Simulation Game in Preparation
« Reply #3 on: June 21, 2019, 04:13:51 am »
bplus, your spiral really is psychedelic!  In my duck shoot game, when the spiral spins it makes the hand-eye co-ordination more difficult:  it will spin at higher levels.

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: Fairground Duck Shoot Simulation Game in Preparation
« Reply #4 on: June 21, 2019, 07:32:33 am »
[banned user] thanks.  I'm using pigeon images as it's my personal opinion that pigeons are a much more apt shooting target than ducks (NB this program is not a shoot-em-up game, of course).  Perhaps you'd be good enough to explain when exactly a download from the Web is Public Domain.  I'm assuming that if the website does not specifically say it's copyrighted or for sale then by default it's Public Domain, though I'm never quite sure.

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Fairground Duck Shoot Simulation Game in Preparation
« Reply #5 on: June 21, 2019, 08:56:33 am »
I use OpenGameArt.org for most of my "retro" stuff... All of their assets are free to use for either private, public or commercial use...
Logic is the beginning of wisdom.

Offline Ashish

  • Forum Resident
  • Posts: 630
  • Never Give Up!
    • View Profile
Re: Fairground Duck Shoot Simulation Game in Preparation
« Reply #6 on: June 21, 2019, 08:58:28 am »
Nice game Qwerky. Looking forward to your final version. :)
if (Me.success) {Me.improve()} else {Me.tryAgain()}


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