Final Dump
BIN
Assets/EndGraphi1.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
Assets/EndGraphic.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
Assets/Hyades.jpg
Normal file
|
After Width: | Height: | Size: 172 KiB |
BIN
Assets/Obstacles/1.jpg
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
Assets/Obstacles/obs.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
Assets/Obstacles/obs1.jpg
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
Assets/Obstacles/obs2.jpg
Normal file
|
After Width: | Height: | Size: 33 KiB |
BIN
Assets/Obstacles/obs3.jpg
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
Assets/Obstacles/obs4.jpg
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
Assets/Obstacles/obs5.jpg
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
Assets/Obstacles/obs6.jpg
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
Assets/Obstacles/obss.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
Assets/Obstacles/obss2.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
Assets/Obstacles/obss3.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
Assets/Obstacles/obss4.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
Assets/Obstacles/pipe-green.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
Assets/Player/player1.png
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
Assets/Player/player10.png
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
BIN
Assets/Player/player2.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
BIN
Assets/Player/player3.png
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
Assets/Player/player4.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
Assets/Player/player5.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
Assets/Player/player6.png
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
Assets/Player/player7.png
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
Assets/Player/player8.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
BIN
Assets/Player/player9.png
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
BIN
Assets/RETRO.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
Assets/RETRO1.png
Normal file
|
After Width: | Height: | Size: 86 KiB |
BIN
Assets/Run/Run_010.png
Normal file
|
After Width: | Height: | Size: 390 KiB |
BIN
Assets/Run/Run_011.png
Normal file
|
After Width: | Height: | Size: 434 KiB |
BIN
Assets/Run/player1.png
Normal file
|
After Width: | Height: | Size: 448 KiB |
BIN
Assets/Run/player10.png
Normal file
|
After Width: | Height: | Size: 410 KiB |
BIN
Assets/Run/player2.png
Normal file
|
After Width: | Height: | Size: 424 KiB |
BIN
Assets/Run/player3.png
Normal file
|
After Width: | Height: | Size: 391 KiB |
BIN
Assets/Run/player4.png
Normal file
|
After Width: | Height: | Size: 402 KiB |
BIN
Assets/Run/player5.png
Normal file
|
After Width: | Height: | Size: 448 KiB |
BIN
Assets/Run/player6.png
Normal file
|
After Width: | Height: | Size: 454 KiB |
BIN
Assets/Run/player7.png
Normal file
|
After Width: | Height: | Size: 475 KiB |
BIN
Assets/Run/player8.png
Normal file
|
After Width: | Height: | Size: 426 KiB |
BIN
Assets/Run/player9.png
Normal file
|
After Width: | Height: | Size: 412 KiB |
152
Assets/abcbkimg1.svg
Normal file
@@ -0,0 +1,152 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 1024 600" style="enable-background:new 0 0 1024 600;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:none;}
|
||||
.st1{fill:#FFFFFF;}
|
||||
.st2{fill:#FEF8D4;}
|
||||
.st3{fill:#1A1A1A;}
|
||||
.st4{fill:url(#SVGID_1_);}
|
||||
</style>
|
||||
<pattern width="150.07" height="173.83" patternUnits="userSpaceOnUse" id="New_Pattern_Swatch_7" viewBox="0 -173.83 150.07 173.83" style="overflow:visible;">
|
||||
<g>
|
||||
<rect y="-173.83" class="st0" width="150.07" height="173.83"/>
|
||||
<path class="st1" d="M116.1-114.8c1.36-0.13,2.96,0.74,3.02,2.23c0.06,1.47-0.76,2.98-2.29,3.28c-1.47,0.28-2.88-0.72-3.15-2.18
|
||||
c-0.28-1.51,0.83-3.15,2.38-3.32C116.08-114.8,116.09-114.8,116.1-114.8z M118.26-112.44c-0.01-0.95-0.79-1.51-1.7-1.45
|
||||
c-1.28,0.08-2.36,1.15-1.98,2.47c0.29,1.01,1.37,1.56,2.36,1.2C117.86-110.55,118.27-111.52,118.26-112.44z"/>
|
||||
<path class="st1" d="M115.7-122.82c-0.75,0.47-1.74,0.06-2.1-0.7c-0.59-1.25,1-2.39,2.09-1.71c0.18,0.11,0.33,0.25,0.44,0.41
|
||||
C116.58-124.18,116.42-123.28,115.7-122.82z M114.68-124.48c-0.76,0.33,0.02,1.28,0.58,0.91
|
||||
C115.95-124.01,115.44-124.81,114.68-124.48z"/>
|
||||
<path class="st1" d="M94.29-4.35c-0.75,0.47-1.74,0.06-2.1-0.7c-0.59-1.25,1-2.39,2.09-1.71c0.18,0.11,0.33,0.25,0.44,0.41
|
||||
C95.17-5.71,95.01-4.81,94.29-4.35z M93.27-6.01c-0.76,0.33,0.02,1.28,0.58,0.91C94.54-5.54,94.03-6.34,93.27-6.01z"/>
|
||||
<path class="st1" d="M47.62-75.27c-0.75,0.47-1.74,0.06-2.1-0.7c-0.59-1.25,1-2.39,2.09-1.71c0.18,0.11,0.33,0.25,0.44,0.41
|
||||
C48.51-76.63,48.35-75.72,47.62-75.27z M46.61-76.93c-0.76,0.33,0.02,1.28,0.58,0.91C47.88-76.46,47.36-77.25,46.61-76.93z"/>
|
||||
<path class="st1" d="M44.72-134.23c-0.75,0.47-1.74,0.06-2.1-0.7c-0.59-1.25,1-2.39,2.09-1.71c0.18,0.11,0.33,0.25,0.44,0.41
|
||||
C45.6-135.6,45.44-134.69,44.72-134.23z M43.7-135.89c-0.76,0.33,0.02,1.28,0.58,0.91C44.97-135.43,44.46-136.22,43.7-135.89z"/>
|
||||
<path class="st1" d="M55.93-165.8l2.29-1.2l2.29,1.2c0.1,0.05,0.22,0.04,0.32-0.02c0.09-0.07,0.14-0.18,0.12-0.3l-0.44-2.54
|
||||
l1.85-1.8c0.08-0.08,0.11-0.2,0.08-0.31c-0.04-0.11-0.13-0.19-0.24-0.21l-2.55-0.37l-1.14-2.32c-0.05-0.1-0.16-0.17-0.27-0.17l0,0
|
||||
c-0.11,0-0.22,0.07-0.27,0.17l-1.14,2.32l-2.56,0.37c-0.11,0.02-0.21,0.1-0.24,0.21c-0.04,0.11-0.01,0.23,0.08,0.31l1.85,1.8
|
||||
l-0.44,2.54c-0.02,0.11,0.03,0.23,0.12,0.3c0.05,0.04,0.11,0.06,0.18,0.06C55.84-165.76,55.89-165.77,55.93-165.8z M57.05-170.77
|
||||
c0.1-0.01,0.18-0.08,0.23-0.16l0.94-1.91l0.94,1.91c0.04,0.09,0.13,0.15,0.23,0.16l2.11,0.31l-1.52,1.49
|
||||
c-0.07,0.07-0.1,0.17-0.09,0.27l0.36,2.1l-1.88-0.99c-0.09-0.05-0.19-0.05-0.28,0l-1.88,0.99l0.36-2.1
|
||||
c0.02-0.1-0.02-0.2-0.09-0.27l-1.52-1.49L57.05-170.77z"/>
|
||||
<path class="st1" d="M65.71-111.21l2.29-1.2l2.29,1.2c0.1,0.05,0.22,0.04,0.32-0.02c0.09-0.07,0.14-0.18,0.12-0.3l-0.44-2.54
|
||||
l1.85-1.8c0.08-0.08,0.11-0.2,0.08-0.31c-0.04-0.11-0.13-0.19-0.24-0.21l-2.55-0.37l-1.14-2.32c-0.05-0.1-0.16-0.17-0.27-0.17l0,0
|
||||
c-0.11,0-0.22,0.07-0.27,0.17l-1.14,2.32l-2.55,0.37c-0.11,0.02-0.21,0.1-0.24,0.21c-0.04,0.11-0.01,0.23,0.08,0.31l1.85,1.8
|
||||
l-0.44,2.54c-0.02,0.11,0.03,0.23,0.12,0.3c0.05,0.04,0.11,0.06,0.18,0.06C65.62-111.17,65.67-111.18,65.71-111.21z M66.83-116.18
|
||||
c0.1-0.01,0.18-0.08,0.23-0.16l0.94-1.91l0.94,1.91c0.04,0.09,0.13,0.15,0.23,0.16l2.11,0.31l-1.52,1.49
|
||||
c-0.07,0.07-0.1,0.17-0.09,0.27l0.36,2.1l-1.88-0.99c-0.09-0.05-0.19-0.05-0.28,0l-1.88,0.99l0.36-2.1
|
||||
c0.02-0.1-0.02-0.2-0.09-0.27l-1.52-1.49L66.83-116.18z"/>
|
||||
<path class="st2" d="M76.27-45.1l2.29-1.2l2.29,1.2c0.1,0.05,0.22,0.04,0.32-0.02c0.09-0.07,0.14-0.18,0.12-0.3l-0.44-2.54
|
||||
l1.85-1.8c0.08-0.08,0.11-0.2,0.08-0.31c-0.04-0.11-0.13-0.19-0.24-0.21l-2.55-0.37l-1.14-2.32c-0.05-0.1-0.16-0.17-0.27-0.17l0,0
|
||||
c-0.11,0-0.22,0.07-0.27,0.17l-1.14,2.32l-2.55,0.37c-0.11,0.02-0.21,0.1-0.24,0.21s-0.01,0.23,0.08,0.31l1.85,1.8l-0.44,2.54
|
||||
c-0.02,0.11,0.03,0.23,0.12,0.3c0.05,0.04,0.11,0.06,0.18,0.06C76.18-45.07,76.23-45.08,76.27-45.1z M77.39-50.08
|
||||
c0.1-0.01,0.18-0.08,0.23-0.16l0.94-1.91l0.94,1.91c0.04,0.09,0.13,0.15,0.23,0.16l2.11,0.31l-1.52,1.49
|
||||
c-0.07,0.07-0.1,0.17-0.09,0.27l0.36,2.1l-1.88-0.99c-0.09-0.05-0.19-0.05-0.28,0l-1.88,0.99l0.36-2.1
|
||||
c0.02-0.1-0.02-0.2-0.09-0.27l-1.52-1.49L77.39-50.08z"/>
|
||||
<path class="st2" d="M143.56-105.65l2.29-1.2l2.29,1.2c0.1,0.05,0.22,0.04,0.32-0.02c0.09-0.07,0.14-0.18,0.12-0.29l-0.44-2.54
|
||||
l1.85-1.8c0.08-0.08,0.11-0.2,0.08-0.31c-0.04-0.11-0.13-0.19-0.24-0.21l-2.55-0.37l-1.14-2.32c-0.05-0.1-0.16-0.17-0.27-0.17l0,0
|
||||
c-0.11,0-0.22,0.07-0.27,0.17l-1.14,2.32l-2.55,0.37c-0.11,0.02-0.21,0.1-0.24,0.21c-0.04,0.11-0.01,0.23,0.08,0.31l1.85,1.8
|
||||
l-0.44,2.54c-0.02,0.11,0.03,0.23,0.12,0.29c0.05,0.04,0.11,0.06,0.18,0.06C143.47-105.62,143.51-105.63,143.56-105.65z
|
||||
M144.67-110.63c0.1-0.01,0.18-0.08,0.23-0.16l0.94-1.91l0.94,1.91c0.04,0.09,0.13,0.15,0.23,0.16l2.11,0.31l-1.52,1.49
|
||||
c-0.07,0.07-0.1,0.17-0.09,0.27l0.36,2.1l-1.88-0.99c-0.09-0.05-0.19-0.05-0.28,0l-1.88,0.99l0.36-2.1
|
||||
c0.02-0.1-0.02-0.2-0.09-0.27l-1.52-1.49L144.67-110.63z"/>
|
||||
<polygon class="st1" points="78.56,-150.2 81.82,-143.59 89.11,-142.53 83.83,-137.38 85.08,-130.12 78.56,-133.55 72.03,-130.12
|
||||
73.28,-137.38 68,-142.53 75.29,-143.59 "/>
|
||||
<polygon class="st1" points="10.56,-20.08 13.82,-13.47 21.11,-12.41 15.83,-7.26 17.08,0 10.56,-3.43 4.03,0 5.28,-7.26
|
||||
0,-12.41 7.29,-13.47 "/>
|
||||
<polygon class="st2" points="13.58,-98.39 15.3,-94.89 19.16,-94.33 16.37,-91.61 17.03,-87.76 13.58,-89.58 10.12,-87.76
|
||||
10.78,-91.61 7.99,-94.33 11.85,-94.89 "/>
|
||||
<polygon class="st2" points="109.34,-171.07 111.07,-167.58 114.93,-167.02 112.13,-164.29 112.79,-160.45 109.34,-162.26
|
||||
105.89,-160.45 106.55,-164.29 103.75,-167.02 107.61,-167.58 "/>
|
||||
<path class="st1" d="M35.09-37.31c-0.64,0-0.64,1,0,1C35.74-36.31,35.74-37.31,35.09-37.31z"/>
|
||||
<path class="st1" d="M33.68-51.78c-0.64,0-0.64,1,0,1C34.32-50.78,34.33-51.78,33.68-51.78z"/>
|
||||
<path class="st1" d="M69.33-64.48c-0.64,0-0.64,1,0,1C69.97-63.48,69.97-64.48,69.33-64.48z"/>
|
||||
<path class="st1" d="M108.5-80.72c-0.64,0-0.64,1,0,1C109.15-79.72,109.15-80.72,108.5-80.72z"/>
|
||||
<path class="st1" d="M137.09-40.13c-0.64,0-0.64,1,0,1C137.74-39.13,137.74-40.13,137.09-40.13z"/>
|
||||
<path class="st1" d="M119.8-24.25c-0.64,0-0.64,1,0,1C120.44-23.25,120.44-24.25,119.8-24.25z"/>
|
||||
<path class="st1" d="M119.8-36.6c-0.64,0-0.64,1,0,1C120.44-35.6,120.44-36.6,119.8-36.6z"/>
|
||||
<path class="st1" d="M129.33-77.54c-0.64,0-0.64,1,0,1C129.97-76.54,129.97-77.54,129.33-77.54z"/>
|
||||
<path class="st1" d="M29.45-110.01c-0.64,0-0.64,1,0,1C30.09-109.01,30.09-110.01,29.45-110.01z"/>
|
||||
<path class="st1" d="M34.03-111.42c-0.64,0-0.64,1,0,1C34.68-110.42,34.68-111.42,34.03-111.42z"/>
|
||||
<path class="st1" d="M36.5-104.01c-0.64,0-0.64,1,0,1C37.15-103.01,37.15-104.01,36.5-104.01z"/>
|
||||
<path class="st1" d="M53.45-106.48c-0.64,0-0.64,1,0,1C54.09-105.48,54.09-106.48,53.45-106.48z"/>
|
||||
<path class="st1" d="M73.92-84.6c-0.64,0-0.64,1,0,1C74.56-83.6,74.56-84.6,73.92-84.6z"/>
|
||||
<path class="st1" d="M11.09-44.37c-0.64,0-0.64,1,0,1C11.74-43.37,11.74-44.37,11.09-44.37z"/>
|
||||
<path class="st1" d="M21.33-28.84c-0.64,0-0.64,1,0,1C21.97-27.84,21.97-28.84,21.33-28.84z"/>
|
||||
<path class="st1" d="M31.92-23.54c-0.64,0-0.64,1,0,1C32.56-22.54,32.56-23.54,31.92-23.54z"/>
|
||||
<path class="st1" d="M49.92-14.72c-0.64,0-0.64,1,0,1C50.56-13.72,50.56-14.72,49.92-14.72z"/>
|
||||
<path class="st1" d="M70.74-23.54c-0.64,0-0.64,1,0,1C71.38-22.54,71.38-23.54,70.74-23.54z"/>
|
||||
<path class="st1" d="M131.09-137.54c-0.64,0-0.64,1,0,1C131.74-136.54,131.74-137.54,131.09-137.54z"/>
|
||||
<path class="st1" d="M137.8-157.31c-0.64,0-0.64,1,0,1C138.44-156.31,138.44-157.31,137.8-157.31z"/>
|
||||
<path class="st1" d="M145.92-161.54c-0.64,0-0.64,1,0,1C146.56-160.54,146.56-161.54,145.92-161.54z"/>
|
||||
<path class="st1" d="M31.92-156.6c-0.64,0-0.64,1,0,1C32.56-155.6,32.56-156.6,31.92-156.6z"/>
|
||||
<path class="st1" d="M29.45-165.78c-0.64,0-0.64,1,0,1C30.09-164.78,30.09-165.78,29.45-165.78z"/>
|
||||
<path class="st1" d="M13.56-161.89c-0.64,0-0.64,1,0,1C14.21-160.89,14.21-161.89,13.56-161.89z"/>
|
||||
<path class="st1" d="M16.74-136.48c-0.64,0-0.64,1,0,1C17.38-135.48,17.38-136.48,16.74-136.48z"/>
|
||||
<path class="st1" d="M52.74-149.89c-0.64,0-0.64,1,0,1C53.38-148.89,53.38-149.89,52.74-149.89z"/>
|
||||
<path class="st1" d="M62.98-154.13c-0.64,0-0.64,1,0,1C63.62-153.13,63.62-154.13,62.98-154.13z"/>
|
||||
<path class="st1" d="M76.39-161.19c-0.64,0-0.64,1,0,1C77.03-160.19,77.03-161.19,76.39-161.19z"/>
|
||||
<path class="st1" d="M81.68-168.6c-0.64,0-0.64,1,0,1C82.32-167.6,82.33-168.6,81.68-168.6z"/>
|
||||
<path class="st1" d="M102.5-146.72c-0.64,0-0.64,1,0,1C103.15-145.72,103.15-146.72,102.5-146.72z"/>
|
||||
<path class="st1" d="M99.68-134.37c-0.64,0-0.64,1,0,1C100.32-133.37,100.33-134.37,99.68-134.37z"/>
|
||||
<path class="st1" d="M95.09-126.25c-0.64,0-0.64,1,0,1C95.74-125.25,95.74-126.25,95.09-126.25z"/>
|
||||
<path class="st1" d="M95.09-92.01c-0.64,0-0.64,1,0,1C95.74-91.01,95.74-92.01,95.09-92.01z"/>
|
||||
<path class="st1" d="M140.27-53.19c-0.64,0-0.64,1,0,1C140.91-52.19,140.91-53.19,140.27-53.19z"/>
|
||||
<path class="st1" d="M144.86-63.78c-0.64,0-0.64,1,0,1C145.5-62.78,145.5-63.78,144.86-63.78z"/>
|
||||
<path class="st1" d="M138.86-75.42c-0.64,0-0.64,1,0,1C139.5-74.42,139.5-75.42,138.86-75.42z"/>
|
||||
<path class="st1" d="M102.5-54.6c-0.64,0-0.64,1,0,1C103.15-53.6,103.15-54.6,102.5-54.6z"/>
|
||||
<path class="st1" d="M25.21-72.6c-0.64,0-0.64,1,0,1C25.85-71.6,25.86-72.6,25.21-72.6z"/>
|
||||
<path class="st1" d="M94.03-28.13c-0.64,0-0.64,1,0,1C94.68-27.13,94.68-28.13,94.03-28.13z"/>
|
||||
<path class="st1" d="M118.74-9.07c-0.64,0-0.64,1,0,1C119.38-8.07,119.38-9.07,118.74-9.07z"/>
|
||||
<path class="st1" d="M133.92-2.72c-0.64,0-0.64,1,0,1C134.56-1.72,134.56-2.72,133.92-2.72z"/>
|
||||
<path class="st1" d="M145.21-92.37c-0.64,0-0.64,1,0,1C145.85-91.37,145.86-92.37,145.21-92.37z"/>
|
||||
<path class="st1" d="M148.39-129.42c-0.64,0-0.64,1,0,1C149.03-128.42,149.03-129.42,148.39-129.42z"/>
|
||||
<path class="st1" d="M55.92-44.01c-0.64,0-0.64,1,0,1C56.56-43.01,56.56-44.01,55.92-44.01z"/>
|
||||
<path class="st1" d="M39.33-34.48c-0.64,0-0.64,1,0,1C39.97-33.48,39.97-34.48,39.33-34.48z"/>
|
||||
<path class="st1" d="M45.33-28.13c-0.64,0-0.64,1,0,1C45.97-27.13,45.97-28.13,45.33-28.13z"/>
|
||||
<path class="st1" d="M36.86-15.07c-0.64,0-0.64,1,0,1C37.5-14.07,37.5-15.07,36.86-15.07z"/>
|
||||
<path class="st1" d="M42.86-2.01c-0.64,0-0.64,1,0,1C43.5-1.01,43.5-2.01,42.86-2.01z"/>
|
||||
<path class="st1" d="M25.21-39.78c-0.64,0-0.64,1,0,1C25.85-38.78,25.86-39.78,25.21-39.78z"/>
|
||||
<path class="st1" d="M82.39-95.19c-0.64,0-0.64,1,0,1C83.03-94.19,83.03-95.19,82.39-95.19z"/>
|
||||
<path class="st1" d="M93.33-83.89c-0.64,0-0.64,1,0,1C93.97-82.89,93.97-83.89,93.33-83.89z"/>
|
||||
<path class="st1" d="M108.15-94.48c-0.64,0-0.64,1,0,1C108.8-93.48,108.8-94.48,108.15-94.48z"/>
|
||||
<path class="st1" d="M115.21-72.95c-0.64,0-0.64,1,0,1C115.85-71.95,115.86-72.95,115.21-72.95z"/>
|
||||
<path class="st1" d="M88.74-105.42c-0.64,0-0.64,1,0,1C89.38-104.42,89.38-105.42,88.74-105.42z"/>
|
||||
<path class="st1" d="M107.45-136.13c-0.64,0-0.64,1,0,1C108.09-135.13,108.09-136.13,107.45-136.13z"/>
|
||||
<path class="st1" d="M114.5-153.42c-0.64,0-0.64,1,0,1C115.15-152.42,115.15-153.42,114.5-153.42z"/>
|
||||
<path class="st1" d="M122.62-153.78c-0.64,0-0.64,1,0,1C123.27-152.78,123.27-153.78,122.62-153.78z"/>
|
||||
<path class="st1" d="M118.39-144.25c-0.64,0-0.64,1,0,1C119.03-143.25,119.03-144.25,118.39-144.25z"/>
|
||||
<path class="st1" d="M22.74-156.95c-0.64,0-0.64,1,0,1C23.38-155.95,23.38-156.95,22.74-156.95z"/>
|
||||
<path class="st1" d="M31.56-147.07c-0.64,0-0.64,1,0,1C32.21-146.07,32.21-147.07,31.56-147.07z"/>
|
||||
<path class="st1" d="M7.56-148.84c-0.64,0-0.64,1,0,1C8.21-147.84,8.21-148.84,7.56-148.84z"/>
|
||||
<path class="st1" d="M7.56-119.89c-0.64,0-0.64,1,0,1C8.21-118.89,8.21-119.89,7.56-119.89z"/>
|
||||
<path class="st1" d="M9.68-67.31c-0.64,0-0.64,1,0,1C10.32-66.31,10.33-67.31,9.68-67.31z"/>
|
||||
<path class="st1" d="M109.56-45.78c-0.64,0-0.64,1,0,1C110.21-44.78,110.21-45.78,109.56-45.78z"/>
|
||||
<path class="st1" d="M116.62-37.66c-0.64,0-0.64,1,0,1C117.27-36.66,117.27-37.66,116.62-37.66z"/>
|
||||
<path class="st1" d="M128.27-29.89c-0.64,0-0.64,1,0,1C128.91-28.89,128.91-29.89,128.27-29.89z"/>
|
||||
<path class="st1" d="M36.39-43.69c-1.29,0-1.29,2,0,2C37.67-41.69,37.68-43.69,36.39-43.69z"/>
|
||||
<path class="st1" d="M125.8-68.63c-1.29,0-1.29,2,0,2C127.09-66.63,127.09-68.63,125.8-68.63z"/>
|
||||
<path class="st1" d="M59.21-149.1c-1.29,0-1.29,2,0,2C60.5-147.1,60.5-149.1,59.21-149.1z"/>
|
||||
<path class="st1" d="M112.86-147.22c-1.29,0-1.29,2,0,2C114.14-145.22,114.15-147.22,112.86-147.22z"/>
|
||||
<path class="st1" d="M20.33-167.87v0.24c0,1.29,2,1.29,2,0v-0.24C22.33-169.15,20.33-169.15,20.33-167.87z"/>
|
||||
<path class="st1" d="M83.45-84.39c-1.29,0-1.29,2,0,2C84.73-82.39,84.74-84.39,83.45-84.39z"/>
|
||||
<path class="st1" d="M93.09-78.07c-1.93,0-1.93,3,0,3C95.02-75.07,95.03-78.07,93.09-78.07z"/>
|
||||
<path class="st1" d="M26.03-151.48c-1.93,0-1.93,3,0,3C27.96-148.48,27.97-151.48,26.03-151.48z"/>
|
||||
<path class="st1" d="M126.98-146.31c-1.93,0-1.93,3,0,3C128.91-143.31,128.91-146.31,126.98-146.31z"/>
|
||||
<path class="st1" d="M39.21-25.6c-1.93,0-1.93,3,0,3C41.14-22.6,41.14-25.6,39.21-25.6z"/>
|
||||
<path class="st1" d="M111.92-31.48c-1.93,0-1.93,3,0,3C113.85-28.48,113.85-31.48,111.92-31.48z"/>
|
||||
<path class="st1" d="M127.68-21.6c-1.93,0-1.93,3,0,3C129.61-18.6,129.62-21.6,127.68-21.6z"/>
|
||||
<path class="st1" d="M10.5-132.66c-1.93,0-1.93,3,0,3C12.44-129.66,12.44-132.66,10.5-132.66z"/>
|
||||
<path class="st1" d="M123.92-111.95c-1.93,0-1.93,3,0,3C125.85-108.95,125.85-111.95,123.92-111.95z"/>
|
||||
<path class="st1" d="M74.5-7.25c-1.93,0-1.93,3,0,3C76.44-4.25,76.44-7.25,74.5-7.25z"/>
|
||||
<path class="st1" d="M40.39-131.25c-1.93,0-1.93,3,0,3C42.32-128.25,42.32-131.25,40.39-131.25z"/>
|
||||
<path class="st1" d="M81.09-126.78c-1.93,0-1.93,3,0,3C83.02-123.78,83.03-126.78,81.09-126.78z"/>
|
||||
</g>
|
||||
</pattern>
|
||||
<rect x="-8" transform="matrix(-1 -1.224647e-16 1.224647e-16 -1 1021 600)" class="st3" width="1037" height="600"/>
|
||||
<pattern id="SVGID_1_" xlink:href="#New_Pattern_Swatch_7" patternTransform="matrix(0.7006 0 0 0.7 -2137.3562 -2096.573)">
|
||||
</pattern>
|
||||
<rect x="-8" class="st4" width="1037" height="600"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 14 KiB |
BIN
Assets/bgimg.jpg
Normal file
|
After Width: | Height: | Size: 88 KiB |
BIN
Assets/bkimg1.png
Normal file
|
After Width: | Height: | Size: 194 KiB |
BIN
Assets/bkimg2.eps
Normal file
BIN
Assets/bkimg23.jpg
Normal file
|
After Width: | Height: | Size: 186 KiB |
BIN
Assets/deathstar.jpg
Normal file
|
After Width: | Height: | Size: 67 KiB |
BIN
Assets/deathstar1.jpg
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
Assets/deathstar4.jpg
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
Assets/fonts/BigShouldersStencilText-Black.ttf
Normal file
BIN
Assets/fonts/BigShouldersStencilText-Bold.ttf
Normal file
BIN
Assets/fonts/BigShouldersStencilText-ExtraBold.ttf
Normal file
BIN
Assets/fonts/BigShouldersStencilText-Light.ttf
Normal file
BIN
Assets/fonts/BigShouldersStencilText-Medium.ttf
Normal file
BIN
Assets/fonts/BigShouldersStencilText-Regular.ttf
Normal file
BIN
Assets/fonts/BigShouldersStencilText-SemiBold.ttf
Normal file
BIN
Assets/fonts/BigShouldersStencilText-Thin.ttf
Normal file
93
Assets/fonts/OFL.txt
Normal file
@@ -0,0 +1,93 @@
|
||||
Copyright 2019 The Big Shoulders Project Authors (https://github.com/xotypeco/big_shoulders)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
BIN
Assets/game_background_1.png
Normal file
|
After Width: | Height: | Size: 468 KiB |
BIN
Assets/game_background_2.png
Normal file
|
After Width: | Height: | Size: 326 KiB |
BIN
Assets/game_background_3.1.png
Normal file
|
After Width: | Height: | Size: 371 KiB |
BIN
Assets/game_background_4.png
Normal file
|
After Width: | Height: | Size: 467 KiB |
BIN
Assets/gameover.jpg
Normal file
|
After Width: | Height: | Size: 640 KiB |
BIN
Assets/landing2.png
Normal file
|
After Width: | Height: | Size: 106 KiB |
BIN
Assets/landing5.png
Normal file
|
After Width: | Height: | Size: 120 KiB |
BIN
Assets/moon-surface.jpg
Normal file
|
After Width: | Height: | Size: 124 KiB |
BIN
Assets/moon.jpeg
Normal file
|
After Width: | Height: | Size: 102 KiB |
BIN
Assets/sky.png
Normal file
|
After Width: | Height: | Size: 324 KiB |
BIN
Assets/sounds/sound_effects/Hit.ogg
Normal file
BIN
Assets/sounds/sound_effects/Point.ogg
Normal file
331
GraphicTrial.py
Normal file
@@ -0,0 +1,331 @@
|
||||
import pygame
|
||||
import sys
|
||||
import random
|
||||
|
||||
|
||||
def player_animation():
|
||||
new_player = player_frames[player_index]
|
||||
new_player_rect = new_player.get_rect(center=(250, player_rect.centery))
|
||||
return new_player, new_player_rect
|
||||
|
||||
|
||||
# Bullet class
|
||||
class bullets(object):
|
||||
def __init__(self, x, y, length, breadth, color):
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.length = length
|
||||
self.breadth = breadth
|
||||
self.color = color
|
||||
self.velocity = 10
|
||||
|
||||
def drawbullet(self, screen):
|
||||
pygame.draw.rect(screen, self.color, pygame.Rect(
|
||||
self.x, self.y, self.length, self.breadth))
|
||||
|
||||
# Obstacles
|
||||
|
||||
|
||||
def create_pipe():
|
||||
temp = int(random.random()*8)
|
||||
temp2 = int(random.random()*90)
|
||||
obstacle_list.append(temp)
|
||||
pipe_temp = pipe_surface_list[temp]
|
||||
new_pipe = pipe_temp.get_rect(midtop=(1020, 360 + temp2))
|
||||
return new_pipe
|
||||
|
||||
|
||||
def move_pipes(pipes):
|
||||
for pipe in pipes:
|
||||
pipe.centerx -= 15
|
||||
return pipes
|
||||
|
||||
|
||||
def draw_pipes(pipes):
|
||||
for i, pipe in enumerate(pipes):
|
||||
screen.blit(pipe_surface_list[obstacle_list[i]], pipe)
|
||||
|
||||
|
||||
# Detecting a Collision between Obstacle and Player
|
||||
def check_collision(pipes):
|
||||
for pipe in pipes:
|
||||
if player_rect.colliderect(pipe):
|
||||
hit_sound.play()
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
# For Moving and rendering the surface
|
||||
|
||||
def drawfloor():
|
||||
|
||||
screen.blit(landimg, (floor_x_pos, 550))
|
||||
screen.blit(landimg, (floor_x_pos+500, 550))
|
||||
screen.blit(landimg, (floor_x_pos+1000, 550))
|
||||
screen.blit(landimg, (floor_x_pos+1500, 550))
|
||||
screen.blit(landimg, (floor_x_pos+2000, 550))
|
||||
screen.blit(landimg, (floor_x_pos+2500, 550))
|
||||
|
||||
|
||||
# To update high score to local file if needed
|
||||
|
||||
def updateFile():
|
||||
f = open('scores.txt', 'r')
|
||||
file = f.readlines()
|
||||
last = int(file[0])
|
||||
|
||||
if last < int(score):
|
||||
f.close()
|
||||
file = open('scores.txt', 'w')
|
||||
file.write(str(score))
|
||||
file.close()
|
||||
|
||||
return score
|
||||
|
||||
return last
|
||||
|
||||
|
||||
# To render the scores both in game and once it has ended
|
||||
|
||||
def score_display(game_state):
|
||||
if game_state == 'main_game':
|
||||
score_surface = game_font.render(
|
||||
str(int(score)), True, (255, 255, 255))
|
||||
score_rect = score_surface.get_rect(center=(512, 100))
|
||||
screen.blit(score_surface, score_rect)
|
||||
if game_state == 'game_over':
|
||||
score_surface = game_font.render(str(score), True, (255, 255, 255))
|
||||
score_rect = score_surface.get_rect(center=(600, 300))
|
||||
screen.blit(score_surface, score_rect)
|
||||
|
||||
high_score_surface = game_font.render(
|
||||
str(bestscore), True, (255, 255, 255))
|
||||
high_score_rect = high_score_surface.get_rect(center=(620, 400))
|
||||
screen.blit(high_score_surface, high_score_rect)
|
||||
|
||||
score_Text = game_font.render('Score: ', True, (255, 255, 255))
|
||||
score_Text_rect = score_Text.get_rect(center=(488, 300))
|
||||
screen.blit(score_Text, score_Text_rect)
|
||||
|
||||
high_score_Text = game_font.render(
|
||||
'High Score: ', True, (255, 255, 255))
|
||||
high_score_Text_rect = high_score_Text.get_rect(center=(458, 400))
|
||||
screen.blit(high_score_Text, high_score_Text_rect)
|
||||
|
||||
# To check if the new score is better than the high score
|
||||
|
||||
|
||||
def update_score(score, high_score):
|
||||
if score > high_score:
|
||||
high_score = score
|
||||
return high_score
|
||||
|
||||
|
||||
pygame.mixer.pre_init(frequency=44100, size=16, channels=1, buffer=512)
|
||||
pygame.init()
|
||||
screen = pygame.display.set_mode((1024, 768))
|
||||
# screen = pygame.display.set_mode((1024, 768), pygame.FULLSCREEN)
|
||||
clock = pygame.time.Clock()
|
||||
|
||||
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
hertz = 100
|
||||
game_active = True
|
||||
score = 0
|
||||
|
||||
|
||||
BLACK = (0, 0, 0)
|
||||
|
||||
|
||||
# Loading the Assets
|
||||
|
||||
# bkgimg = pygame.image.load('Assets/bkimg23.jpg').convert() # Alternate Background
|
||||
bkgimg = pygame.image.load('Assets/sky.png').convert()
|
||||
bkgimg = pygame.transform.scale(bkgimg, (1024, 600))
|
||||
# landimg = pygame.image.load('Assets/moon.jpeg').convert() #Alternate Surface
|
||||
landimg = pygame.image.load('Assets/landing5.png').convert()
|
||||
# landimg = pygame.image.load('Assets/landing2.png').convert()
|
||||
landimg = pygame.transform.scale(landimg, (1024, 768))
|
||||
player1 = pygame.image.load('Assets/Player/player1.png').convert()
|
||||
player1.set_colorkey(BLACK)
|
||||
player2 = pygame.image.load('Assets/Player/player2.png').convert()
|
||||
player2.set_colorkey(BLACK)
|
||||
player3 = pygame.image.load('Assets/Player/player3.png').convert()
|
||||
player3.set_colorkey(BLACK)
|
||||
player4 = pygame.image.load('Assets/Player/player4.png').convert()
|
||||
player4.set_colorkey(BLACK)
|
||||
player5 = pygame.image.load('Assets/Player/player5.png').convert()
|
||||
player5.set_colorkey(BLACK)
|
||||
player6 = pygame.image.load('Assets/Player/player6.png').convert()
|
||||
player6.set_colorkey(BLACK)
|
||||
player7 = pygame.image.load('Assets/Player/player7.png').convert()
|
||||
player7.set_colorkey(BLACK)
|
||||
player8 = pygame.image.load('Assets/Player/player8.png').convert()
|
||||
player8.set_colorkey(BLACK)
|
||||
player9 = pygame.image.load('Assets/Player/player9.png').convert()
|
||||
player9.set_colorkey(BLACK)
|
||||
player10 = pygame.image.load('Assets/Player/player10.png').convert()
|
||||
player10.set_colorkey(BLACK)
|
||||
deathstar = pygame.image.load('Assets/deathstar1.jpg').convert()
|
||||
|
||||
|
||||
game_begin_surface = pygame.image.load('Assets/Retro1.png')
|
||||
game_begin_surface = pygame.transform.scale(game_begin_surface, (1024, 768))
|
||||
game_begin_surface_rect = game_begin_surface.get_rect(center=(512, 384))
|
||||
|
||||
game_over_surface = pygame.image.load('Assets/EndGraphi1.png')
|
||||
game_over_surface = pygame.transform.scale(game_over_surface, (1024, 768))
|
||||
game_over_surface_rect = game_over_surface.get_rect(center=(512, 384))
|
||||
game_font = pygame.font.Font(
|
||||
'assets/fonts/BigShouldersStencilText-Medium.ttf', 55)
|
||||
|
||||
# Pipes image.
|
||||
pipe_surface = pygame.image.load(
|
||||
'assets/Obstacles/pipe-green.png').convert() # 452
|
||||
pipe_surface1 = pygame.image.load(
|
||||
'Assets/Obstacles/obss.png').convert() # 370
|
||||
pipe_surface1 = pygame.transform.scale(pipe_surface1, (52, 320))
|
||||
pipe_surface1.set_colorkey(BLACK)
|
||||
pipe_surface2 = pygame.image.load('assets/Obstacles/obss2.png').convert()
|
||||
pipe_surface2 = pygame.transform.scale(pipe_surface2, (52, 320))
|
||||
pipe_surface2.set_colorkey(BLACK)
|
||||
pipe_surface4 = pygame.image.load('assets/Obstacles/obss3.png').convert()
|
||||
pipe_surface4 = pygame.transform.scale(pipe_surface4, (52, 320))
|
||||
pipe_surface4.set_colorkey(BLACK)
|
||||
pipe_surface3 = pygame.image.load('Assets/Obstacles/obss4.png').convert()
|
||||
pipe_surface3 = pygame.transform.scale(pipe_surface3, (52, 320))
|
||||
pipe_surface3.set_colorkey(BLACK)
|
||||
pipe_suface = pygame.transform.scale2x(pipe_surface)
|
||||
pipe_suface1 = pygame.transform.scale2x(pipe_surface1)
|
||||
pipe_suface2 = pygame.transform.scale2x(pipe_surface2)
|
||||
pipe_suface3 = pygame.transform.scale2x(pipe_surface3)
|
||||
pipe_suface4 = pygame.transform.scale2x(pipe_surface4)
|
||||
|
||||
pipe_surface_list = [pipe_suface, pipe_suface1,
|
||||
pipe_suface, pipe_suface3, pipe_suface2, pipe_suface3, pipe_suface, pipe_suface1]
|
||||
pipe_list = []
|
||||
SPAWNPIPE = pygame.USEREVENT
|
||||
pygame.time.set_timer(SPAWNPIPE, 2000)
|
||||
|
||||
|
||||
player_frames = [player1, player2, player3, player4,
|
||||
player5, player6, player7, player8, player9, player10]
|
||||
player_index = 0
|
||||
player_surface = player_frames[player_index]
|
||||
player_rect = player_surface.get_rect(center=(250, 492))
|
||||
|
||||
PLAYERRUN = pygame.USEREVENT + 1
|
||||
pygame.time.set_timer(PLAYERRUN, 100)
|
||||
|
||||
floor_x_pos = 0
|
||||
pno = 1
|
||||
|
||||
# sound effects
|
||||
hit_sound = pygame.mixer.Sound('assets/sounds/sound_effects/Hit.ogg')
|
||||
point_sound = pygame.mixer.Sound('assets/sounds/sound_effects/Point.ogg')
|
||||
point_sound_count = 100
|
||||
|
||||
bullet_list = []
|
||||
obstacle_list = []
|
||||
MainGame = False
|
||||
BeginGame = True
|
||||
|
||||
|
||||
while BeginGame:
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
pygame.quit()
|
||||
sys.exit()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_SPACE:
|
||||
point_sound.play()
|
||||
hertz = 99.8
|
||||
BeginGame = False
|
||||
MainGame = True
|
||||
|
||||
screen.blit(game_begin_surface, game_begin_surface_rect)
|
||||
|
||||
pygame.display.update()
|
||||
clock.tick(hertz)
|
||||
hertz += 0.02
|
||||
|
||||
|
||||
while MainGame:
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
pygame.quit()
|
||||
sys.exit()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_SPACE and game_active:
|
||||
point_sound.play()
|
||||
if player_rect.centery == 492:
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
while player_movement != -12:
|
||||
player_movement -= gravity
|
||||
elif (event.key == pygame.K_RETURN or event.key == pygame.K_KP_ENTER) and game_active == False:
|
||||
hertz = 99.6
|
||||
game_active = True
|
||||
|
||||
if event.type == PLAYERRUN:
|
||||
if player_index < 9:
|
||||
player_index += 1
|
||||
else:
|
||||
player_index = 0
|
||||
player_surface, player_rect = player_animation()
|
||||
|
||||
if event.type == SPAWNPIPE:
|
||||
pipe_list.append(create_pipe())
|
||||
|
||||
for bullet in bullet_list:
|
||||
if bullet.x < 1024 and bullet.x > 0:
|
||||
bullet.x += bullet.velocity
|
||||
else:
|
||||
bullet_list.pop(bullet_list.index(bullet))
|
||||
|
||||
screen.blit(bkgimg, (0, 0))
|
||||
|
||||
if game_active == True:
|
||||
if player_rect.centery == 492:
|
||||
gravity = 0
|
||||
elif player_rect.centery < 492:
|
||||
gravity = 0.25
|
||||
|
||||
else:
|
||||
gravity = 0
|
||||
player_rect.centery = 492
|
||||
player_movement = 0
|
||||
keys = pygame.key.get_pressed()
|
||||
if keys[pygame.K_END]:
|
||||
if(len(bullet_list) < 1):
|
||||
bullet_list.append(
|
||||
bullets(250, player_rect.centery, 15, 3, (255, 255, 153)))
|
||||
for bullet in bullet_list:
|
||||
bullet.drawbullet(screen)
|
||||
|
||||
player_movement += gravity
|
||||
player_rect.centery += player_movement
|
||||
screen.blit(player_surface, player_rect)
|
||||
game_active = check_collision(pipe_list)
|
||||
score_display('main_game')
|
||||
floor_x_pos -= 5
|
||||
|
||||
pipe_list = move_pipes(pipe_list)
|
||||
draw_pipes(pipe_list)
|
||||
drawfloor()
|
||||
if floor_x_pos <= -2000:
|
||||
floor_x_pos = 0
|
||||
score = int(hertz//0.1-999)
|
||||
largeFont = pygame.font.SysFont('comicsans', 30)
|
||||
text = largeFont.render('Score: ' + str(score), 1, (255, 255, 255))
|
||||
largeFont = pygame.font.SysFont('comicsans', 80)
|
||||
bestscore = updateFile()
|
||||
else:
|
||||
pipe_list.clear()
|
||||
screen.blit(game_over_surface, game_over_surface_rect)
|
||||
score_display('game_over')
|
||||
|
||||
pygame.display.update()
|
||||
clock.tick(hertz)
|
||||
hertz += 0.02
|
||||
212
Hello.py
Normal file
@@ -0,0 +1,212 @@
|
||||
import pygame
|
||||
import sys
|
||||
|
||||
|
||||
def player_animation():
|
||||
new_player = player_frames[player_index]
|
||||
new_player_rect = new_player.get_rect(center=(250, player_rect.centery))
|
||||
return new_player, new_player_rect
|
||||
|
||||
|
||||
class bullets(object):
|
||||
# Bullet class
|
||||
def __init__(self, x, y, length, breadth, color):
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.length = length
|
||||
self.breadth = breadth
|
||||
self.color = color
|
||||
self.velocity = 10
|
||||
|
||||
def drawbullet(self, screen):
|
||||
pygame.draw.rect(screen, self.color, pygame.Rect(
|
||||
self.x, self.y, self.length, self.breadth))
|
||||
|
||||
|
||||
# class obstacles(object):
|
||||
# # Obstacle class
|
||||
# def __init__(self, obstacle, x, y, height, width):
|
||||
# self.image = obstacle
|
||||
# self.x = x
|
||||
# self.y = y
|
||||
# self.height = height
|
||||
# self.width = width
|
||||
# self.box = (x, y, width, height)
|
||||
# self.velocity = 1
|
||||
|
||||
# def drawobstacle(self, screen):
|
||||
# self.box = (self.x, self.y, self.width-10, self.height)
|
||||
# screen.blit(pygame.transform.scale(
|
||||
# self.image, (64, 64)), (self.x, self.y))
|
||||
# pygame.draw.rect(screen, (255, 0, 0), self.box, 2)
|
||||
|
||||
|
||||
def create_pipe():
|
||||
new_pipe = pipe_suface.get_rect(midtop=(1020, 452))
|
||||
return new_pipe
|
||||
|
||||
|
||||
def move_pipes(pipes):
|
||||
for pipe in pipes:
|
||||
pipe.centerx -= 15
|
||||
return pipes
|
||||
|
||||
|
||||
def draw_pipes(pipes):
|
||||
for pipe in pipes:
|
||||
screen.blit(pipe_suface, pipe)
|
||||
|
||||
|
||||
def drawfloor():
|
||||
|
||||
screen.blit(landimg, (floor_x_pos, 550))
|
||||
screen.blit(landimg, (floor_x_pos+500, 550))
|
||||
screen.blit(landimg, (floor_x_pos+1000, 550))
|
||||
screen.blit(landimg, (floor_x_pos+1500, 550))
|
||||
screen.blit(landimg, (floor_x_pos+2000, 550))
|
||||
screen.blit(landimg, (floor_x_pos+2500, 550))
|
||||
|
||||
# if pno==1:
|
||||
# screen.blit(player1,(200,237))
|
||||
# elif pno==2:
|
||||
# screen.blit(player2,(200,237))
|
||||
# elif pno==3:
|
||||
# screen.blit(player3,(200,237))
|
||||
# elif pno==4:
|
||||
# screen.blit(player4,(200,237))
|
||||
# elif pno==5:
|
||||
# screen.blit(player5,(200,237))
|
||||
# elif pno==6:
|
||||
# screen.blit(player6,(200,237))
|
||||
# elif pno==7:
|
||||
# screen.blit(player7,(200,237))
|
||||
# elif pno==8:
|
||||
# screen.blit(player8,(200,237))
|
||||
# elif pno==9:
|
||||
# screen.blit(player9,(200,237))
|
||||
# elif pno==10:
|
||||
# screen.blit(player10,(200,237))
|
||||
|
||||
|
||||
pygame.init()
|
||||
screen = pygame.display.set_mode((1024, 768))
|
||||
clock = pygame.time.Clock()
|
||||
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
game_active = True
|
||||
|
||||
bkgimg = pygame.image.load('Assets\game_background_1.png').convert()
|
||||
bkgimg = pygame.transform.scale(bkgimg, (1024, 600))
|
||||
landimg = pygame.image.load('Assets/moon.jpeg').convert()
|
||||
player1 = pygame.image.load('Assets/Player/player1.png').convert()
|
||||
player2 = pygame.image.load('Assets/Player/player2.png').convert()
|
||||
player3 = pygame.image.load('Assets/Player/player3.png').convert()
|
||||
player4 = pygame.image.load('Assets/Player/player4.png').convert()
|
||||
player5 = pygame.image.load('Assets/Player/player5.png').convert()
|
||||
player6 = pygame.image.load('Assets/Player/player6.png').convert()
|
||||
player7 = pygame.image.load('Assets/Player/player7.png').convert()
|
||||
player8 = pygame.image.load('Assets/Player/player8.png').convert()
|
||||
player9 = pygame.image.load('Assets/Player/player9.png').convert()
|
||||
player10 = pygame.image.load('Assets/Player/player10.png').convert()
|
||||
deathstar = pygame.image.load('Assets/deathstar1.jpg').convert()
|
||||
# obstacle = pygame.image.load('Assets/Obstacles/1.jpg').convert()
|
||||
|
||||
|
||||
# Pipes image.
|
||||
pipe_surface = pygame.image.load('assets/Obstacles/pipe-green.png').convert()
|
||||
pipe_suface = pygame.transform.scale2x(pipe_surface)
|
||||
pipe_list = []
|
||||
SPAWNPIPE = pygame.USEREVENT
|
||||
pygame.time.set_timer(SPAWNPIPE, 3000)
|
||||
|
||||
|
||||
player_frames = [player1, player2, player3, player4,
|
||||
player5, player6, player7, player8, player9, player10]
|
||||
player_index = 0
|
||||
player_surface = player_frames[player_index]
|
||||
player_rect = player_surface.get_rect(center=(250, 492))
|
||||
|
||||
PLAYERRUN = pygame.USEREVENT + 1
|
||||
pygame.time.set_timer(PLAYERRUN, 100)
|
||||
|
||||
floor_x_pos = 0
|
||||
pno = 1
|
||||
|
||||
bullet_list = []
|
||||
obstacle_list = []
|
||||
# obstacle_list.append(obstacles(obstacle, 1000, 200, 64, 64))
|
||||
|
||||
while True:
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
pygame.quit()
|
||||
sys.exit()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_SPACE and game_active:
|
||||
if player_rect.centery == 492:
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
while player_movement != -12:
|
||||
player_movement -= gravity
|
||||
|
||||
if event.type == PLAYERRUN:
|
||||
if player_index < 9:
|
||||
player_index += 1
|
||||
else:
|
||||
player_index = 0
|
||||
player_surface, player_rect = player_animation()
|
||||
|
||||
if event.type == SPAWNPIPE:
|
||||
pipe_list.append(create_pipe())
|
||||
|
||||
for bullet in bullet_list:
|
||||
if bullet.x < 1024 and bullet.x > 0:
|
||||
bullet.x += bullet.velocity
|
||||
else:
|
||||
bullet_list.pop(bullet_list.index(bullet))
|
||||
# obstacle_list.append(obstacles(obstacle, 1000, 200, 64, 64))
|
||||
|
||||
screen.blit(bkgimg, (0, 0))
|
||||
|
||||
if game_active == True:
|
||||
if player_rect.centery == 492:
|
||||
gravity = 0
|
||||
elif player_rect.centery < 492:
|
||||
gravity = 0.25
|
||||
|
||||
else:
|
||||
gravity = 0
|
||||
player_rect.centery = 492
|
||||
player_movement = 0
|
||||
keys = pygame.key.get_pressed()
|
||||
if keys[pygame.K_END]:
|
||||
if(len(bullet_list) < 1):
|
||||
bullet_list.append(
|
||||
bullets(250, player_rect.centery, 15, 3, (255, 255, 153)))
|
||||
for bullet in bullet_list:
|
||||
bullet.drawbullet(screen)
|
||||
# for obs in obstacle_list:
|
||||
# obs.drawobstacle(screen)
|
||||
|
||||
player_movement += gravity
|
||||
player_rect.centery += player_movement
|
||||
screen.blit(player_surface, player_rect)
|
||||
|
||||
floor_x_pos -= 5
|
||||
|
||||
pipe_list = move_pipes(pipe_list)
|
||||
draw_pipes(pipe_list)
|
||||
drawfloor()
|
||||
if floor_x_pos <= -2000:
|
||||
floor_x_pos = 0
|
||||
# for ob in obstacle_list:
|
||||
# if ob.x > 0:
|
||||
# obstacle_list.append(
|
||||
# obstacles(obstacle, ob.x-ob.velocity, 200, 64, 64))
|
||||
# obstacle_list.pop(obstacle_list.index(ob))
|
||||
# else:
|
||||
# obstacle_list.pop(obstacle_list.index(ob))
|
||||
|
||||
pygame.display.update()
|
||||
clock.tick(120)
|
||||
221
Hello1.py
Normal file
@@ -0,0 +1,221 @@
|
||||
import pygame
|
||||
import sys
|
||||
|
||||
|
||||
def player_animation():
|
||||
new_player = player_frames[player_index]
|
||||
new_player_rect = new_player.get_rect(center=(250, player_rect.centery))
|
||||
return new_player, new_player_rect
|
||||
|
||||
|
||||
class bullets(object):
|
||||
# Bullet class
|
||||
def __init__(self, x, y, length, breadth, color):
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.length = length
|
||||
self.breadth = breadth
|
||||
self.color = color
|
||||
self.velocity = 10
|
||||
|
||||
def drawbullet(self, screen):
|
||||
pygame.draw.rect(screen, self.color, pygame.Rect(
|
||||
self.x, self.y, self.length, self.breadth))
|
||||
|
||||
|
||||
# class obstacles(object):
|
||||
# # Obstacle class
|
||||
# def __init__(self, obstacle, x, y, height, width):
|
||||
# self.image = obstacle
|
||||
# self.x = x
|
||||
# self.y = y
|
||||
# self.height = height
|
||||
# self.width = width
|
||||
# self.box = (x, y, width, height)
|
||||
# self.velocity = 1
|
||||
|
||||
# def drawobstacle(self, screen):
|
||||
# self.box = (self.x, self.y, self.width-10, self.height)
|
||||
# screen.blit(pygame.transform.scale(
|
||||
# self.image, (64, 64)), (self.x, self.y))
|
||||
# pygame.draw.rect(screen, (255, 0, 0), self.box, 2)
|
||||
|
||||
|
||||
def create_pipe():
|
||||
new_pipe = pipe_suface.get_rect(midtop=(1020, 452))
|
||||
return new_pipe
|
||||
|
||||
|
||||
def move_pipes(pipes):
|
||||
for pipe in pipes:
|
||||
pipe.centerx -= 15
|
||||
return pipes
|
||||
|
||||
|
||||
def draw_pipes(pipes):
|
||||
for pipe in pipes:
|
||||
screen.blit(pipe_suface, pipe)
|
||||
|
||||
|
||||
def check_collision(pipes):
|
||||
for pipe in pipes:
|
||||
if player_rect.colliderect(pipe):
|
||||
hit_sound.play()
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def drawfloor():
|
||||
|
||||
screen.blit(landimg, (floor_x_pos, 550))
|
||||
screen.blit(landimg, (floor_x_pos+500, 550))
|
||||
screen.blit(landimg, (floor_x_pos+1000, 550))
|
||||
screen.blit(landimg, (floor_x_pos+1500, 550))
|
||||
screen.blit(landimg, (floor_x_pos+2000, 550))
|
||||
screen.blit(landimg, (floor_x_pos+2500, 550))
|
||||
|
||||
# if pno==1:
|
||||
# screen.blit(player1,(200,237))
|
||||
# elif pno==2:
|
||||
# screen.blit(player2,(200,237))
|
||||
# elif pno==3:
|
||||
# screen.blit(player3,(200,237))
|
||||
# elif pno==4:
|
||||
# screen.blit(player4,(200,237))
|
||||
# elif pno==5:
|
||||
# screen.blit(player5,(200,237))
|
||||
# elif pno==6:
|
||||
# screen.blit(player6,(200,237))
|
||||
# elif pno==7:
|
||||
# screen.blit(player7,(200,237))
|
||||
# elif pno==8:
|
||||
# screen.blit(player8,(200,237))
|
||||
# elif pno==9:
|
||||
# screen.blit(player9,(200,237))
|
||||
# elif pno==10:
|
||||
# screen.blit(player10,(200,237))
|
||||
|
||||
|
||||
pygame.init()
|
||||
screen = pygame.display.set_mode((1024, 768))
|
||||
clock = pygame.time.Clock()
|
||||
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
game_active = True
|
||||
|
||||
bkgimg = pygame.image.load('Assets\game_background_1.png').convert()
|
||||
bkgimg = pygame.transform.scale(bkgimg, (1024, 600))
|
||||
landimg = pygame.image.load('Assets/moon.jpeg').convert()
|
||||
player1 = pygame.image.load('Assets/Player/player1.png').convert()
|
||||
player2 = pygame.image.load('Assets/Player/player2.png').convert()
|
||||
player3 = pygame.image.load('Assets/Player/player3.png').convert()
|
||||
player4 = pygame.image.load('Assets/Player/player4.png').convert()
|
||||
player5 = pygame.image.load('Assets/Player/player5.png').convert()
|
||||
player6 = pygame.image.load('Assets/Player/player6.png').convert()
|
||||
player7 = pygame.image.load('Assets/Player/player7.png').convert()
|
||||
player8 = pygame.image.load('Assets/Player/player8.png').convert()
|
||||
player9 = pygame.image.load('Assets/Player/player9.png').convert()
|
||||
player10 = pygame.image.load('Assets/Player/player10.png').convert()
|
||||
deathstar = pygame.image.load('Assets/deathstar1.jpg').convert()
|
||||
# obstacle = pygame.image.load('Assets/Obstacles/1.jpg').convert()
|
||||
|
||||
|
||||
# Pipes image.
|
||||
pipe_surface = pygame.image.load('assets/Obstacles/pipe-green.png').convert()
|
||||
pipe_suface = pygame.transform.scale2x(pipe_surface)
|
||||
pipe_list = []
|
||||
SPAWNPIPE = pygame.USEREVENT
|
||||
pygame.time.set_timer(SPAWNPIPE, 2500)
|
||||
|
||||
|
||||
player_frames = [player1, player2, player3, player4,
|
||||
player5, player6, player7, player8, player9, player10]
|
||||
player_index = 0
|
||||
player_surface = player_frames[player_index]
|
||||
player_rect = player_surface.get_rect(center=(250, 492))
|
||||
|
||||
PLAYERRUN = pygame.USEREVENT + 1
|
||||
pygame.time.set_timer(PLAYERRUN, 100)
|
||||
|
||||
floor_x_pos = 0
|
||||
pno = 1
|
||||
|
||||
bullet_list = []
|
||||
obstacle_list = []
|
||||
# obstacle_list.append(obstacles(obstacle, 1000, 200, 64, 64))
|
||||
|
||||
while True:
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
pygame.quit()
|
||||
sys.exit()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_SPACE and game_active:
|
||||
if player_rect.centery == 492:
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
while player_movement != -12:
|
||||
player_movement -= gravity
|
||||
|
||||
if event.type == PLAYERRUN:
|
||||
if player_index < 9:
|
||||
player_index += 1
|
||||
else:
|
||||
player_index = 0
|
||||
player_surface, player_rect = player_animation()
|
||||
|
||||
if event.type == SPAWNPIPE:
|
||||
pipe_list.append(create_pipe())
|
||||
|
||||
for bullet in bullet_list:
|
||||
if bullet.x < 1024 and bullet.x > 0:
|
||||
bullet.x += bullet.velocity
|
||||
else:
|
||||
bullet_list.pop(bullet_list.index(bullet))
|
||||
# obstacle_list.append(obstacles(obstacle, 1000, 200, 64, 64))
|
||||
|
||||
screen.blit(bkgimg, (0, 0))
|
||||
|
||||
if game_active == True:
|
||||
if player_rect.centery == 492:
|
||||
gravity = 0
|
||||
elif player_rect.centery < 492:
|
||||
gravity = 0.25
|
||||
|
||||
else:
|
||||
gravity = 0
|
||||
player_rect.centery = 492
|
||||
player_movement = 0
|
||||
keys = pygame.key.get_pressed()
|
||||
if keys[pygame.K_END]:
|
||||
if(len(bullet_list) < 1):
|
||||
bullet_list.append(
|
||||
bullets(250, player_rect.centery, 15, 3, (255, 255, 153)))
|
||||
for bullet in bullet_list:
|
||||
bullet.drawbullet(screen)
|
||||
# for obs in obstacle_list:
|
||||
# obs.drawobstacle(screen)
|
||||
|
||||
player_movement += gravity
|
||||
player_rect.centery += player_movement
|
||||
screen.blit(player_surface, player_rect)
|
||||
game_active = check_collision(pipe_list)
|
||||
|
||||
floor_x_pos -= 5
|
||||
|
||||
pipe_list = move_pipes(pipe_list)
|
||||
draw_pipes(pipe_list)
|
||||
drawfloor()
|
||||
if floor_x_pos <= -2000:
|
||||
floor_x_pos = 0
|
||||
# for ob in obstacle_list:
|
||||
# if ob.x > 0:
|
||||
# obstacle_list.append(
|
||||
# obstacles(obstacle, ob.x-ob.velocity, 200, 64, 64))
|
||||
# obstacle_list.pop(obstacle_list.index(ob))
|
||||
# else:
|
||||
# obstacle_list.pop(obstacle_list.index(ob))
|
||||
|
||||
pygame.display.update()
|
||||
clock.tick(120)
|
||||
225
Hello2.py
Normal file
@@ -0,0 +1,225 @@
|
||||
import pygame
|
||||
import sys
|
||||
|
||||
|
||||
def player_animation():
|
||||
new_player = player_frames[player_index]
|
||||
new_player_rect = new_player.get_rect(center=(250, player_rect.centery))
|
||||
return new_player, new_player_rect
|
||||
|
||||
|
||||
class bullets(object):
|
||||
# Bullet class
|
||||
def __init__(self, x, y, length, breadth, color):
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.length = length
|
||||
self.breadth = breadth
|
||||
self.color = color
|
||||
self.velocity = 10
|
||||
|
||||
def drawbullet(self, screen):
|
||||
pygame.draw.rect(screen, self.color, pygame.Rect(
|
||||
self.x, self.y, self.length, self.breadth))
|
||||
|
||||
|
||||
# class obstacles(object):
|
||||
# # Obstacle class
|
||||
# def __init__(self, obstacle, x, y, height, width):
|
||||
# self.image = obstacle
|
||||
# self.x = x
|
||||
# self.y = y
|
||||
# self.height = height
|
||||
# self.width = width
|
||||
# self.box = (x, y, width, height)
|
||||
# self.velocity = 1
|
||||
|
||||
# def drawobstacle(self, screen):
|
||||
# self.box = (self.x, self.y, self.width-10, self.height)
|
||||
# screen.blit(pygame.transform.scale(
|
||||
# self.image, (64, 64)), (self.x, self.y))
|
||||
# pygame.draw.rect(screen, (255, 0, 0), self.box, 2)
|
||||
|
||||
|
||||
def create_pipe():
|
||||
new_pipe = pipe_suface.get_rect(midtop=(1020, 452))
|
||||
return new_pipe
|
||||
|
||||
|
||||
def move_pipes(pipes):
|
||||
for pipe in pipes:
|
||||
pipe.centerx -= 15
|
||||
return pipes
|
||||
|
||||
|
||||
def draw_pipes(pipes):
|
||||
for pipe in pipes:
|
||||
screen.blit(pipe_suface, pipe)
|
||||
|
||||
def check_collision(pipes):
|
||||
for pipe in pipes:
|
||||
if player_rect.colliderect(pipe):
|
||||
hit_sound.play()
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def drawfloor():
|
||||
|
||||
screen.blit(landimg, (floor_x_pos, 550))
|
||||
screen.blit(landimg, (floor_x_pos+500, 550))
|
||||
screen.blit(landimg, (floor_x_pos+1000, 550))
|
||||
screen.blit(landimg, (floor_x_pos+1500, 550))
|
||||
screen.blit(landimg, (floor_x_pos+2000, 550))
|
||||
screen.blit(landimg, (floor_x_pos+2500, 550))
|
||||
|
||||
# if pno==1:
|
||||
# screen.blit(player1,(200,237))
|
||||
# elif pno==2:
|
||||
# screen.blit(player2,(200,237))
|
||||
# elif pno==3:
|
||||
# screen.blit(player3,(200,237))
|
||||
# elif pno==4:
|
||||
# screen.blit(player4,(200,237))
|
||||
# elif pno==5:
|
||||
# screen.blit(player5,(200,237))
|
||||
# elif pno==6:
|
||||
# screen.blit(player6,(200,237))
|
||||
# elif pno==7:
|
||||
# screen.blit(player7,(200,237))
|
||||
# elif pno==8:
|
||||
# screen.blit(player8,(200,237))
|
||||
# elif pno==9:
|
||||
# screen.blit(player9,(200,237))
|
||||
# elif pno==10:
|
||||
# screen.blit(player10,(200,237))
|
||||
|
||||
|
||||
pygame.init()
|
||||
screen = pygame.display.set_mode((1024, 768))
|
||||
clock = pygame.time.Clock()
|
||||
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
game_active = True
|
||||
|
||||
bkgimg = pygame.image.load('Assets\game_background_1.png').convert()
|
||||
bkgimg = pygame.transform.scale(bkgimg, (1024, 600))
|
||||
landimg = pygame.image.load('Assets/moon.jpeg').convert()
|
||||
player1 = pygame.image.load('Assets/Player/player1.png').convert()
|
||||
player2 = pygame.image.load('Assets/Player/player2.png').convert()
|
||||
player3 = pygame.image.load('Assets/Player/player3.png').convert()
|
||||
player4 = pygame.image.load('Assets/Player/player4.png').convert()
|
||||
player5 = pygame.image.load('Assets/Player/player5.png').convert()
|
||||
player6 = pygame.image.load('Assets/Player/player6.png').convert()
|
||||
player7 = pygame.image.load('Assets/Player/player7.png').convert()
|
||||
player8 = pygame.image.load('Assets/Player/player8.png').convert()
|
||||
player9 = pygame.image.load('Assets/Player/player9.png').convert()
|
||||
player10 = pygame.image.load('Assets/Player/player10.png').convert()
|
||||
deathstar = pygame.image.load('Assets/deathstar1.jpg').convert()
|
||||
# obstacle = pygame.image.load('Assets/Obstacles/1.jpg').convert()
|
||||
|
||||
|
||||
# Pipes image.
|
||||
pipe_surface = pygame.image.load('assets/Obstacles/pipe-green.png').convert()
|
||||
pipe_suface = pygame.transform.scale2x(pipe_surface)
|
||||
pipe_list = []
|
||||
SPAWNPIPE = pygame.USEREVENT
|
||||
pygame.time.set_timer(SPAWNPIPE, 3000)
|
||||
|
||||
|
||||
player_frames = [player1, player2, player3, player4,
|
||||
player5, player6, player7, player8, player9, player10]
|
||||
player_index = 0
|
||||
player_surface = player_frames[player_index]
|
||||
player_rect = player_surface.get_rect(center=(250, 492))
|
||||
|
||||
PLAYERRUN = pygame.USEREVENT + 1
|
||||
pygame.time.set_timer(PLAYERRUN, 100)
|
||||
|
||||
floor_x_pos = 0
|
||||
pno = 1
|
||||
|
||||
#sound effects
|
||||
hit_sound = pygame.mixer.Sound('assets/sounds/sound_effects/Hit.ogg')
|
||||
point_sound = pygame.mixer.Sound('assets/sounds/sound_effects/Point.ogg')
|
||||
point_sound_count = 100
|
||||
|
||||
bullet_list = []
|
||||
obstacle_list = []
|
||||
# obstacle_list.append(obstacles(obstacle, 1000, 200, 64, 64))
|
||||
|
||||
while True:
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
pygame.quit()
|
||||
sys.exit()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_SPACE and game_active:
|
||||
if player_rect.centery == 492:
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
while player_movement != -12:
|
||||
player_movement -= gravity
|
||||
|
||||
if event.type == PLAYERRUN:
|
||||
if player_index < 9:
|
||||
player_index += 1
|
||||
else:
|
||||
player_index = 0
|
||||
player_surface, player_rect = player_animation()
|
||||
|
||||
if event.type == SPAWNPIPE:
|
||||
pipe_list.append(create_pipe())
|
||||
|
||||
for bullet in bullet_list:
|
||||
if bullet.x < 1024 and bullet.x > 0:
|
||||
bullet.x += bullet.velocity
|
||||
else:
|
||||
bullet_list.pop(bullet_list.index(bullet))
|
||||
# obstacle_list.append(obstacles(obstacle, 1000, 200, 64, 64))
|
||||
|
||||
screen.blit(bkgimg, (0, 0))
|
||||
|
||||
if game_active == True:
|
||||
if player_rect.centery == 492:
|
||||
gravity = 0
|
||||
elif player_rect.centery < 492:
|
||||
gravity = 0.25
|
||||
|
||||
else:
|
||||
gravity = 0
|
||||
player_rect.centery = 492
|
||||
player_movement = 0
|
||||
keys = pygame.key.get_pressed()
|
||||
if keys[pygame.K_END]:
|
||||
if(len(bullet_list) < 1):
|
||||
bullet_list.append(
|
||||
bullets(250, player_rect.centery, 15, 3, (255, 255, 153)))
|
||||
for bullet in bullet_list:
|
||||
bullet.drawbullet(screen)
|
||||
# for obs in obstacle_list:
|
||||
# obs.drawobstacle(screen)
|
||||
|
||||
player_movement += gravity
|
||||
player_rect.centery += player_movement
|
||||
screen.blit(player_surface, player_rect)
|
||||
game_active = check_collision(pipe_list)
|
||||
|
||||
floor_x_pos -= 5
|
||||
|
||||
pipe_list = move_pipes(pipe_list)
|
||||
draw_pipes(pipe_list)
|
||||
drawfloor()
|
||||
if floor_x_pos <= -2000:
|
||||
floor_x_pos = 0
|
||||
# for ob in obstacle_list:
|
||||
# if ob.x > 0:
|
||||
# obstacle_list.append(
|
||||
# obstacles(obstacle, ob.x-ob.velocity, 200, 64, 64))
|
||||
# obstacle_list.pop(obstacle_list.index(ob))
|
||||
# else:
|
||||
# obstacle_list.pop(obstacle_list.index(ob))
|
||||
|
||||
pygame.display.update()
|
||||
clock.tick(120)
|
||||
243
Hello3.py
Normal file
@@ -0,0 +1,243 @@
|
||||
import pygame
|
||||
import sys
|
||||
|
||||
|
||||
def player_animation():
|
||||
new_player = player_frames[player_index]
|
||||
new_player_rect = new_player.get_rect(center=(250, player_rect.centery))
|
||||
return new_player, new_player_rect
|
||||
|
||||
|
||||
class bullets(object):
|
||||
# Bullet class
|
||||
def __init__(self, x, y, length, breadth, color):
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.length = length
|
||||
self.breadth = breadth
|
||||
self.color = color
|
||||
self.velocity = 10
|
||||
|
||||
def drawbullet(self, screen):
|
||||
pygame.draw.rect(screen, self.color, pygame.Rect(
|
||||
self.x, self.y, self.length, self.breadth))
|
||||
|
||||
|
||||
# class obstacles(object):
|
||||
# # Obstacle class
|
||||
# def __init__(self, obstacle, x, y, height, width):
|
||||
# self.image = obstacle
|
||||
# self.x = x
|
||||
# self.y = y
|
||||
# self.height = height
|
||||
# self.width = width
|
||||
# self.box = (x, y, width, height)
|
||||
# self.velocity = 1
|
||||
|
||||
# def drawobstacle(self, screen):
|
||||
# self.box = (self.x, self.y, self.width-10, self.height)
|
||||
# screen.blit(pygame.transform.scale(
|
||||
# self.image, (64, 64)), (self.x, self.y))
|
||||
# pygame.draw.rect(screen, (255, 0, 0), self.box, 2)
|
||||
|
||||
|
||||
def create_pipe():
|
||||
new_pipe = pipe_suface.get_rect(midtop=(1020, 452))
|
||||
return new_pipe
|
||||
|
||||
|
||||
def move_pipes(pipes):
|
||||
for pipe in pipes:
|
||||
pipe.centerx -= 15
|
||||
return pipes
|
||||
|
||||
|
||||
def draw_pipes(pipes):
|
||||
for pipe in pipes:
|
||||
screen.blit(pipe_suface, pipe)
|
||||
|
||||
|
||||
def check_collision(pipes):
|
||||
for pipe in pipes:
|
||||
if player_rect.colliderect(pipe):
|
||||
hit_sound.play()
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def drawfloor():
|
||||
|
||||
screen.blit(landimg, (floor_x_pos, 550))
|
||||
screen.blit(landimg, (floor_x_pos+500, 550))
|
||||
screen.blit(landimg, (floor_x_pos+1000, 550))
|
||||
screen.blit(landimg, (floor_x_pos+1500, 550))
|
||||
screen.blit(landimg, (floor_x_pos+2000, 550))
|
||||
screen.blit(landimg, (floor_x_pos+2500, 550))
|
||||
|
||||
# if pno==1:
|
||||
# screen.blit(player1,(200,237))
|
||||
# elif pno==2:
|
||||
# screen.blit(player2,(200,237))
|
||||
# elif pno==3:
|
||||
# screen.blit(player3,(200,237))
|
||||
# elif pno==4:
|
||||
# screen.blit(player4,(200,237))
|
||||
# elif pno==5:
|
||||
# screen.blit(player5,(200,237))
|
||||
# elif pno==6:
|
||||
# screen.blit(player6,(200,237))
|
||||
# elif pno==7:
|
||||
# screen.blit(player7,(200,237))
|
||||
# elif pno==8:
|
||||
# screen.blit(player8,(200,237))
|
||||
# elif pno==9:
|
||||
# screen.blit(player9,(200,237))
|
||||
# elif pno==10:
|
||||
# screen.blit(player10,(200,237))
|
||||
|
||||
|
||||
pygame.mixer.pre_init(frequency=44100, size=16, channels=1, buffer=512)
|
||||
pygame.init()
|
||||
screen = pygame.display.set_mode((1024, 768))
|
||||
clock = pygame.time.Clock()
|
||||
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
game_active = True
|
||||
|
||||
BLACK = (0, 0, 0)
|
||||
|
||||
bkgimg = pygame.image.load('Assets/bkimg23.jpg').convert()
|
||||
# bkgimg = pygame.image.load('Assets/sky.png').convert()
|
||||
bkgimg = pygame.transform.scale(bkgimg, (1024, 600))
|
||||
# landimg = pygame.image.load('Assets/moon.jpeg').convert()
|
||||
landimg = pygame.image.load('Assets/landing2.png').convert()
|
||||
landimg = pygame.transform.scale(landimg, (1024, 768))
|
||||
player1 = pygame.image.load('Assets/Player/player1.png').convert()
|
||||
player1.set_colorkey(BLACK)
|
||||
player2 = pygame.image.load('Assets/Player/player2.png').convert()
|
||||
player2.set_colorkey(BLACK)
|
||||
player3 = pygame.image.load('Assets/Player/player3.png').convert()
|
||||
player3.set_colorkey(BLACK)
|
||||
player4 = pygame.image.load('Assets/Player/player4.png').convert()
|
||||
player4.set_colorkey(BLACK)
|
||||
player5 = pygame.image.load('Assets/Player/player5.png').convert()
|
||||
player5.set_colorkey(BLACK)
|
||||
player6 = pygame.image.load('Assets/Player/player6.png').convert()
|
||||
player6.set_colorkey(BLACK)
|
||||
player7 = pygame.image.load('Assets/Player/player7.png').convert()
|
||||
player7.set_colorkey(BLACK)
|
||||
player8 = pygame.image.load('Assets/Player/player8.png').convert()
|
||||
player8.set_colorkey(BLACK)
|
||||
player9 = pygame.image.load('Assets/Player/player9.png').convert()
|
||||
player9.set_colorkey(BLACK)
|
||||
player10 = pygame.image.load('Assets/Player/player10.png').convert()
|
||||
player10.set_colorkey(BLACK)
|
||||
deathstar = pygame.image.load('Assets/deathstar1.jpg').convert()
|
||||
# obstacle = pygame.image.load('Assets/Obstacles/1.jpg').convert()
|
||||
|
||||
|
||||
# Pipes image.
|
||||
pipe_surface = pygame.image.load('assets/Obstacles/pipe-green.png').convert()
|
||||
pipe_suface = pygame.transform.scale2x(pipe_surface)
|
||||
pipe_list = []
|
||||
SPAWNPIPE = pygame.USEREVENT
|
||||
pygame.time.set_timer(SPAWNPIPE, 2000)
|
||||
|
||||
|
||||
player_frames = [player1, player2, player3, player4,
|
||||
player5, player6, player7, player8, player9, player10]
|
||||
player_index = 0
|
||||
player_surface = player_frames[player_index]
|
||||
player_rect = player_surface.get_rect(center=(250, 492))
|
||||
|
||||
PLAYERRUN = pygame.USEREVENT + 1
|
||||
pygame.time.set_timer(PLAYERRUN, 100)
|
||||
|
||||
floor_x_pos = 0
|
||||
pno = 1
|
||||
|
||||
# sound effects
|
||||
hit_sound = pygame.mixer.Sound('assets/sounds/sound_effects/Hit.ogg')
|
||||
point_sound = pygame.mixer.Sound('assets/sounds/sound_effects/Point.ogg')
|
||||
point_sound_count = 100
|
||||
|
||||
bullet_list = []
|
||||
obstacle_list = []
|
||||
# obstacle_list.append(obstacles(obstacle, 1000, 200, 64, 64))
|
||||
|
||||
while True:
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
pygame.quit()
|
||||
sys.exit()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_SPACE and game_active:
|
||||
point_sound.play()
|
||||
if player_rect.centery == 492:
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
while player_movement != -12:
|
||||
player_movement -= gravity
|
||||
|
||||
if event.type == PLAYERRUN:
|
||||
if player_index < 9:
|
||||
player_index += 1
|
||||
else:
|
||||
player_index = 0
|
||||
player_surface, player_rect = player_animation()
|
||||
|
||||
if event.type == SPAWNPIPE:
|
||||
pipe_list.append(create_pipe())
|
||||
|
||||
for bullet in bullet_list:
|
||||
if bullet.x < 1024 and bullet.x > 0:
|
||||
bullet.x += bullet.velocity
|
||||
else:
|
||||
bullet_list.pop(bullet_list.index(bullet))
|
||||
# obstacle_list.append(obstacles(obstacle, 1000, 200, 64, 64))
|
||||
|
||||
screen.blit(bkgimg, (0, 0))
|
||||
|
||||
if game_active == True:
|
||||
if player_rect.centery == 492:
|
||||
gravity = 0
|
||||
elif player_rect.centery < 492:
|
||||
gravity = 0.25
|
||||
|
||||
else:
|
||||
gravity = 0
|
||||
player_rect.centery = 492
|
||||
player_movement = 0
|
||||
keys = pygame.key.get_pressed()
|
||||
if keys[pygame.K_END]:
|
||||
if(len(bullet_list) < 1):
|
||||
bullet_list.append(
|
||||
bullets(250, player_rect.centery, 15, 3, (255, 255, 153)))
|
||||
for bullet in bullet_list:
|
||||
bullet.drawbullet(screen)
|
||||
# for obs in obstacle_list:
|
||||
# obs.drawobstacle(screen)
|
||||
|
||||
player_movement += gravity
|
||||
player_rect.centery += player_movement
|
||||
screen.blit(player_surface, player_rect)
|
||||
game_active = check_collision(pipe_list)
|
||||
|
||||
floor_x_pos -= 5
|
||||
|
||||
pipe_list = move_pipes(pipe_list)
|
||||
draw_pipes(pipe_list)
|
||||
drawfloor()
|
||||
if floor_x_pos <= -2000:
|
||||
floor_x_pos = 0
|
||||
# for ob in obstacle_list:
|
||||
# if ob.x > 0:
|
||||
# obstacle_list.append(
|
||||
# obstacles(obstacle, ob.x-ob.velocity, 200, 64, 64))
|
||||
# obstacle_list.pop(obstacle_list.index(ob))
|
||||
# else:
|
||||
# obstacle_list.pop(obstacle_list.index(ob))
|
||||
|
||||
pygame.display.update()
|
||||
clock.tick(120)
|
||||
229
Hello4.py
Normal file
@@ -0,0 +1,229 @@
|
||||
import pygame
|
||||
import sys
|
||||
|
||||
|
||||
def player_animation():
|
||||
new_player = player_frames[player_index]
|
||||
new_player_rect = new_player.get_rect(center=(250, player_rect.centery))
|
||||
return new_player, new_player_rect
|
||||
|
||||
|
||||
class bullets(object):
|
||||
# Bullet class
|
||||
def __init__(self, x, y, length, breadth, color):
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.length = length
|
||||
self.breadth = breadth
|
||||
self.color = color
|
||||
self.velocity = 10
|
||||
|
||||
def drawbullet(self, screen):
|
||||
pygame.draw.rect(screen, self.color, pygame.Rect(
|
||||
self.x, self.y, self.length, self.breadth))
|
||||
|
||||
|
||||
# class obstacles(object):
|
||||
# # Obstacle class
|
||||
# def __init__(self, obstacle, x, y, height, width):
|
||||
# self.image = obstacle
|
||||
# self.x = x
|
||||
# self.y = y
|
||||
# self.height = height
|
||||
# self.width = width
|
||||
# self.box = (x, y, width, height)
|
||||
# self.velocity = 1
|
||||
|
||||
# def drawobstacle(self, screen):
|
||||
# self.box = (self.x, self.y, self.width-10, self.height)
|
||||
# screen.blit(pygame.transform.scale(
|
||||
# self.image, (64, 64)), (self.x, self.y))
|
||||
# pygame.draw.rect(screen, (255, 0, 0), self.box, 2)
|
||||
|
||||
|
||||
def create_pipe():
|
||||
new_pipe = pipe_suface.get_rect(midtop=(1020, 452))
|
||||
return new_pipe
|
||||
|
||||
|
||||
def move_pipes(pipes):
|
||||
for pipe in pipes:
|
||||
pipe.centerx -= 15
|
||||
return pipes
|
||||
|
||||
|
||||
def draw_pipes(pipes):
|
||||
for pipe in pipes:
|
||||
screen.blit(pipe_suface, pipe)
|
||||
|
||||
|
||||
def check_collision(pipes):
|
||||
for pipe in pipes:
|
||||
if player_rect.colliderect(pipe):
|
||||
hit_sound.play()
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def drawfloor():
|
||||
|
||||
screen.blit(landimg, (floor_x_pos, 550))
|
||||
screen.blit(landimg, (floor_x_pos+500, 550))
|
||||
screen.blit(landimg, (floor_x_pos+1000, 550))
|
||||
screen.blit(landimg, (floor_x_pos+1500, 550))
|
||||
screen.blit(landimg, (floor_x_pos+2000, 550))
|
||||
screen.blit(landimg, (floor_x_pos+2500, 550))
|
||||
|
||||
# if pno==1:
|
||||
# screen.blit(player1,(200,237))
|
||||
# elif pno==2:
|
||||
# screen.blit(player2,(200,237))
|
||||
# elif pno==3:
|
||||
# screen.blit(player3,(200,237))
|
||||
# elif pno==4:
|
||||
# screen.blit(player4,(200,237))
|
||||
# elif pno==5:
|
||||
# screen.blit(player5,(200,237))
|
||||
# elif pno==6:
|
||||
# screen.blit(player6,(200,237))
|
||||
# elif pno==7:
|
||||
# screen.blit(player7,(200,237))
|
||||
# elif pno==8:
|
||||
# screen.blit(player8,(200,237))
|
||||
# elif pno==9:
|
||||
# screen.blit(player9,(200,237))
|
||||
# elif pno==10:
|
||||
# screen.blit(player10,(200,237))
|
||||
|
||||
|
||||
pygame.mixer.pre_init(frequency=44100, size=16, channels=1, buffer=512)
|
||||
pygame.init()
|
||||
screen = pygame.display.set_mode((1024, 768))
|
||||
clock = pygame.time.Clock()
|
||||
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
game_active = True
|
||||
game_on = True
|
||||
|
||||
bkgimg = pygame.image.load('Assets\game_background_1.png').convert()
|
||||
bkgimg = pygame.transform.scale(bkgimg, (1024, 600))
|
||||
landimg = pygame.image.load('Assets/moon.jpeg').convert()
|
||||
player1 = pygame.image.load('Assets/Player/player1.png').convert()
|
||||
player2 = pygame.image.load('Assets/Player/player2.png').convert()
|
||||
player3 = pygame.image.load('Assets/Player/player3.png').convert()
|
||||
player4 = pygame.image.load('Assets/Player/player4.png').convert()
|
||||
player5 = pygame.image.load('Assets/Player/player5.png').convert()
|
||||
player6 = pygame.image.load('Assets/Player/player6.png').convert()
|
||||
player7 = pygame.image.load('Assets/Player/player7.png').convert()
|
||||
player8 = pygame.image.load('Assets/Player/player8.png').convert()
|
||||
player9 = pygame.image.load('Assets/Player/player9.png').convert()
|
||||
player10 = pygame.image.load('Assets/Player/player10.png').convert()
|
||||
deathstar = pygame.image.load('Assets/deathstar1.jpg').convert()
|
||||
# obstacle = pygame.image.load('Assets/Obstacles/1.jpg').convert()
|
||||
|
||||
|
||||
# Pipes image.
|
||||
pipe_surface = pygame.image.load('assets/Obstacles/pipe-green.png').convert()
|
||||
pipe_suface = pygame.transform.scale2x(pipe_surface)
|
||||
pipe_list = []
|
||||
SPAWNPIPE = pygame.USEREVENT
|
||||
pygame.time.set_timer(SPAWNPIPE, 3000)
|
||||
|
||||
|
||||
player_frames = [player1, player2, player3, player4,
|
||||
player5, player6, player7, player8, player9, player10]
|
||||
player_index = 0
|
||||
player_surface = player_frames[player_index]
|
||||
player_rect = player_surface.get_rect(center=(250, 492))
|
||||
|
||||
PLAYERRUN = pygame.USEREVENT + 1
|
||||
pygame.time.set_timer(PLAYERRUN, 100)
|
||||
|
||||
floor_x_pos = 0
|
||||
pno = 1
|
||||
|
||||
# sound effects
|
||||
hit_sound = pygame.mixer.Sound('assets/sounds/sound_effects/Hit.ogg')
|
||||
point_sound = pygame.mixer.Sound('assets/sounds/sound_effects/Point.ogg')
|
||||
point_sound_count = 100
|
||||
|
||||
bullet_list = []
|
||||
obstacle_list = []
|
||||
# obstacle_list.append(obstacles(obstacle, 1000, 200, 64, 64))
|
||||
|
||||
while game_on:
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
pygame.quit()
|
||||
sys.exit()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_SPACE and game_active:
|
||||
point_sound.play()
|
||||
if player_rect.centery == 492:
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
while player_movement != -12:
|
||||
player_movement -= gravity
|
||||
|
||||
if event.type == PLAYERRUN:
|
||||
if player_index < 9:
|
||||
player_index += 1
|
||||
else:
|
||||
player_index = 0
|
||||
player_surface, player_rect = player_animation()
|
||||
|
||||
if event.type == SPAWNPIPE:
|
||||
pipe_list.append(create_pipe())
|
||||
|
||||
for bullet in bullet_list:
|
||||
if bullet.x < 1024 and bullet.x > 0:
|
||||
bullet.x += bullet.velocity
|
||||
else:
|
||||
bullet_list.pop(bullet_list.index(bullet))
|
||||
# obstacle_list.append(obstacles(obstacle, 1000, 200, 64, 64))
|
||||
|
||||
screen.blit(bkgimg, (0, 0))
|
||||
|
||||
if game_active == True:
|
||||
if player_rect.centery == 492:
|
||||
gravity = 0
|
||||
elif player_rect.centery < 492:
|
||||
gravity = 0.25
|
||||
|
||||
else:
|
||||
gravity = 0
|
||||
player_rect.centery = 492
|
||||
player_movement = 0
|
||||
keys = pygame.key.get_pressed()
|
||||
if keys[pygame.K_END]:
|
||||
if(len(bullet_list) < 1):
|
||||
bullet_list.append(
|
||||
bullets(250, player_rect.centery, 15, 3, (255, 255, 153)))
|
||||
for bullet in bullet_list:
|
||||
bullet.drawbullet(screen)
|
||||
# for obs in obstacle_list:
|
||||
# obs.drawobstacle(screen)
|
||||
|
||||
player_movement += gravity
|
||||
player_rect.centery += player_movement
|
||||
screen.blit(player_surface, player_rect)
|
||||
game_on = check_collision(pipe_list)
|
||||
|
||||
floor_x_pos -= 5
|
||||
|
||||
pipe_list = move_pipes(pipe_list)
|
||||
draw_pipes(pipe_list)
|
||||
drawfloor()
|
||||
if floor_x_pos <= -2000:
|
||||
floor_x_pos = 0
|
||||
# for ob in obstacle_list:
|
||||
# if ob.x > 0:
|
||||
# obstacle_list.append(
|
||||
# obstacles(obstacle, ob.x-ob.velocity, 200, 64, 64))
|
||||
# obstacle_list.pop(obstacle_list.index(ob))
|
||||
# else:
|
||||
# obstacle_list.pop(obstacle_list.index(ob))
|
||||
|
||||
pygame.display.update()
|
||||
clock.tick(120)
|
||||
267
Hello5.py
Normal file
@@ -0,0 +1,267 @@
|
||||
import pygame
|
||||
import sys
|
||||
|
||||
|
||||
def player_animation():
|
||||
new_player = player_frames[player_index]
|
||||
new_player_rect = new_player.get_rect(center=(250, player_rect.centery))
|
||||
return new_player, new_player_rect
|
||||
|
||||
|
||||
class bullets(object):
|
||||
# Bullet class
|
||||
def __init__(self, x, y, length, breadth, color):
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.length = length
|
||||
self.breadth = breadth
|
||||
self.color = color
|
||||
self.velocity = 10
|
||||
|
||||
def drawbullet(self, screen):
|
||||
pygame.draw.rect(screen, self.color, pygame.Rect(
|
||||
self.x, self.y, self.length, self.breadth))
|
||||
|
||||
|
||||
# class obstacles(object):
|
||||
# # Obstacle class
|
||||
# def __init__(self, obstacle, x, y, height, width):
|
||||
# self.image = obstacle
|
||||
# self.x = x
|
||||
# self.y = y
|
||||
# self.height = height
|
||||
# self.width = width
|
||||
# self.box = (x, y, width, height)
|
||||
# self.velocity = 1
|
||||
|
||||
# def drawobstacle(self, screen):
|
||||
# self.box = (self.x, self.y, self.width-10, self.height)
|
||||
# screen.blit(pygame.transform.scale(
|
||||
# self.image, (64, 64)), (self.x, self.y))
|
||||
# pygame.draw.rect(screen, (255, 0, 0), self.box, 2)
|
||||
|
||||
|
||||
def create_pipe():
|
||||
new_pipe = pipe_suface.get_rect(midtop=(1020, 452))
|
||||
return new_pipe
|
||||
|
||||
|
||||
def move_pipes(pipes):
|
||||
for pipe in pipes:
|
||||
pipe.centerx -= 15
|
||||
return pipes
|
||||
|
||||
|
||||
def draw_pipes(pipes):
|
||||
for pipe in pipes:
|
||||
screen.blit(pipe_suface, pipe)
|
||||
|
||||
|
||||
def check_collision(pipes):
|
||||
for pipe in pipes:
|
||||
if player_rect.colliderect(pipe):
|
||||
hit_sound.play()
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def drawfloor():
|
||||
|
||||
screen.blit(landimg, (floor_x_pos, 550))
|
||||
screen.blit(landimg, (floor_x_pos+500, 550))
|
||||
screen.blit(landimg, (floor_x_pos+1000, 550))
|
||||
screen.blit(landimg, (floor_x_pos+1500, 550))
|
||||
screen.blit(landimg, (floor_x_pos+2000, 550))
|
||||
screen.blit(landimg, (floor_x_pos+2500, 550))
|
||||
|
||||
# if pno==1:
|
||||
# screen.blit(player1,(200,237))
|
||||
# elif pno==2:
|
||||
# screen.blit(player2,(200,237))
|
||||
# elif pno==3:
|
||||
# screen.blit(player3,(200,237))
|
||||
# elif pno==4:
|
||||
# screen.blit(player4,(200,237))
|
||||
# elif pno==5:
|
||||
# screen.blit(player5,(200,237))
|
||||
# elif pno==6:
|
||||
# screen.blit(player6,(200,237))
|
||||
# elif pno==7:
|
||||
# screen.blit(player7,(200,237))
|
||||
# elif pno==8:
|
||||
# screen.blit(player8,(200,237))
|
||||
# elif pno==9:
|
||||
# screen.blit(player9,(200,237))
|
||||
# elif pno==10:
|
||||
# screen.blit(player10,(200,237))
|
||||
|
||||
def updateFile():
|
||||
f = open('scores.txt','r')
|
||||
file = f.readlines()
|
||||
last = int(file[0])
|
||||
|
||||
if last < int(score):
|
||||
f.close()
|
||||
file = open('scores.txt', 'w')
|
||||
file.write(str(score))
|
||||
file.close()
|
||||
|
||||
return score
|
||||
|
||||
return last
|
||||
|
||||
|
||||
pygame.mixer.pre_init(frequency=44100, size=16, channels=1, buffer=512)
|
||||
pygame.init()
|
||||
screen = pygame.display.set_mode((1024, 768))
|
||||
clock = pygame.time.Clock()
|
||||
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
hertz=100
|
||||
game_active = True
|
||||
|
||||
BLACK = (0, 0, 0)
|
||||
|
||||
# bkgimg = pygame.image.load('Assets/bkimg23.jpg').convert()
|
||||
bkgimg = pygame.image.load('Assets/sky.png').convert()
|
||||
bkgimg = pygame.transform.scale(bkgimg, (1024, 600))
|
||||
# landimg = pygame.image.load('Assets/moon.jpeg').convert()
|
||||
landimg = pygame.image.load('Assets/landing5.png').convert()
|
||||
landimg = pygame.transform.scale(landimg, (1024, 768))
|
||||
player1 = pygame.image.load('Assets/Player/player1.png').convert()
|
||||
player1.set_colorkey(BLACK)
|
||||
player2 = pygame.image.load('Assets/Player/player2.png').convert()
|
||||
player2.set_colorkey(BLACK)
|
||||
player3 = pygame.image.load('Assets/Player/player3.png').convert()
|
||||
player3.set_colorkey(BLACK)
|
||||
player4 = pygame.image.load('Assets/Player/player4.png').convert()
|
||||
player4.set_colorkey(BLACK)
|
||||
player5 = pygame.image.load('Assets/Player/player5.png').convert()
|
||||
player5.set_colorkey(BLACK)
|
||||
player6 = pygame.image.load('Assets/Player/player6.png').convert()
|
||||
player6.set_colorkey(BLACK)
|
||||
player7 = pygame.image.load('Assets/Player/player7.png').convert()
|
||||
player7.set_colorkey(BLACK)
|
||||
player8 = pygame.image.load('Assets/Player/player8.png').convert()
|
||||
player8.set_colorkey(BLACK)
|
||||
player9 = pygame.image.load('Assets/Player/player9.png').convert()
|
||||
player9.set_colorkey(BLACK)
|
||||
player10 = pygame.image.load('Assets/Player/player10.png').convert()
|
||||
player10.set_colorkey(BLACK)
|
||||
deathstar = pygame.image.load('Assets/deathstar1.jpg').convert()
|
||||
# obstacle = pygame.image.load('Assets/Obstacles/1.jpg').convert()
|
||||
|
||||
|
||||
# Pipes image.
|
||||
pipe_surface = pygame.image.load('assets/Obstacles/pipe-green.png').convert()
|
||||
pipe_suface = pygame.transform.scale2x(pipe_surface)
|
||||
pipe_list = []
|
||||
SPAWNPIPE = pygame.USEREVENT
|
||||
pygame.time.set_timer(SPAWNPIPE, 2000)
|
||||
|
||||
|
||||
player_frames = [player1, player2, player3, player4,
|
||||
player5, player6, player7, player8, player9, player10]
|
||||
player_index = 0
|
||||
player_surface = player_frames[player_index]
|
||||
player_rect = player_surface.get_rect(center=(250, 492))
|
||||
|
||||
PLAYERRUN = pygame.USEREVENT + 1
|
||||
pygame.time.set_timer(PLAYERRUN, 100)
|
||||
|
||||
floor_x_pos = 0
|
||||
pno = 1
|
||||
|
||||
# sound effects
|
||||
hit_sound = pygame.mixer.Sound('assets/sounds/sound_effects/Hit.ogg')
|
||||
point_sound = pygame.mixer.Sound('assets/sounds/sound_effects/Point.ogg')
|
||||
point_sound_count = 100
|
||||
|
||||
bullet_list = []
|
||||
obstacle_list = []
|
||||
# obstacle_list.append(obstacles(obstacle, 1000, 200, 64, 64))
|
||||
|
||||
while True:
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
pygame.quit()
|
||||
sys.exit()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_SPACE and game_active:
|
||||
point_sound.play()
|
||||
if player_rect.centery == 492:
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
while player_movement != -12:
|
||||
player_movement -= gravity
|
||||
|
||||
if event.type == PLAYERRUN:
|
||||
if player_index < 9:
|
||||
player_index += 1
|
||||
else:
|
||||
player_index = 0
|
||||
player_surface, player_rect = player_animation()
|
||||
|
||||
if event.type == SPAWNPIPE:
|
||||
pipe_list.append(create_pipe())
|
||||
|
||||
for bullet in bullet_list:
|
||||
if bullet.x < 1024 and bullet.x > 0:
|
||||
bullet.x += bullet.velocity
|
||||
else:
|
||||
bullet_list.pop(bullet_list.index(bullet))
|
||||
# obstacle_list.append(obstacles(obstacle, 1000, 200, 64, 64))
|
||||
|
||||
screen.blit(bkgimg, (0, 0))
|
||||
|
||||
if game_active == True:
|
||||
if player_rect.centery == 492:
|
||||
gravity = 0
|
||||
elif player_rect.centery < 492:
|
||||
gravity = 0.25
|
||||
|
||||
else:
|
||||
gravity = 0
|
||||
player_rect.centery = 492
|
||||
player_movement = 0
|
||||
keys = pygame.key.get_pressed()
|
||||
if keys[pygame.K_END]:
|
||||
if(len(bullet_list) < 1):
|
||||
bullet_list.append(
|
||||
bullets(250, player_rect.centery, 15, 3, (255, 255, 153)))
|
||||
for bullet in bullet_list:
|
||||
bullet.drawbullet(screen)
|
||||
# for obs in obstacle_list:
|
||||
# obs.drawobstacle(screen)
|
||||
|
||||
player_movement += gravity
|
||||
player_rect.centery += player_movement
|
||||
screen.blit(player_surface, player_rect)
|
||||
game_active = check_collision(pipe_list)
|
||||
|
||||
floor_x_pos -= 5
|
||||
|
||||
pipe_list = move_pipes(pipe_list)
|
||||
draw_pipes(pipe_list)
|
||||
drawfloor()
|
||||
if floor_x_pos <= -2000:
|
||||
floor_x_pos = 0
|
||||
# for ob in obstacle_list:
|
||||
# if ob.x > 0:
|
||||
# obstacle_list.append(
|
||||
# obstacles(obstacle, ob.x-ob.velocity, 200, 64, 64))
|
||||
# obstacle_list.pop(obstacle_list.index(ob))
|
||||
# else:
|
||||
# obstacle_list.pop(obstacle_list.index(ob))
|
||||
score = int(hertz//0.1-999)
|
||||
largeFont = pygame.font.SysFont('comicsans', 30)
|
||||
text = largeFont.render('Score: ' + str(score), 1, (255,255,255))
|
||||
#largeFont = pygame.font.SysFont('comicsans', 80)
|
||||
#Best = largeFont.render('Best Score: ' + str(updateFile()),1,(255,255,255))
|
||||
screen.blit(text, (800, 10))
|
||||
#screen.blit(Best, (600,10))
|
||||
|
||||
pygame.display.update()
|
||||
clock.tick(hertz)
|
||||
hertz+=0.02
|
||||
291
Hello5final.py
Normal file
@@ -0,0 +1,291 @@
|
||||
import pygame
|
||||
import sys
|
||||
|
||||
|
||||
def player_animation():
|
||||
new_player = player_frames[player_index]
|
||||
new_player_rect = new_player.get_rect(center=(250, player_rect.centery))
|
||||
return new_player, new_player_rect
|
||||
|
||||
|
||||
# Bullet class
|
||||
class bullets(object):
|
||||
def __init__(self, x, y, length, breadth, color):
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.length = length
|
||||
self.breadth = breadth
|
||||
self.color = color
|
||||
self.velocity = 10
|
||||
|
||||
def drawbullet(self, screen):
|
||||
pygame.draw.rect(screen, self.color, pygame.Rect(
|
||||
self.x, self.y, self.length, self.breadth))
|
||||
|
||||
|
||||
def create_pipe():
|
||||
new_pipe = pipe_suface.get_rect(midtop=(1020, 452))
|
||||
return new_pipe
|
||||
|
||||
|
||||
def move_pipes(pipes):
|
||||
for pipe in pipes:
|
||||
pipe.centerx -= 15
|
||||
return pipes
|
||||
|
||||
|
||||
def draw_pipes(pipes):
|
||||
for pipe in pipes:
|
||||
screen.blit(pipe_suface, pipe)
|
||||
|
||||
|
||||
def check_collision(pipes):
|
||||
for pipe in pipes:
|
||||
if player_rect.colliderect(pipe):
|
||||
hit_sound.play()
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def drawfloor():
|
||||
|
||||
screen.blit(landimg, (floor_x_pos, 550))
|
||||
screen.blit(landimg, (floor_x_pos+500, 550))
|
||||
screen.blit(landimg, (floor_x_pos+1000, 550))
|
||||
screen.blit(landimg, (floor_x_pos+1500, 550))
|
||||
screen.blit(landimg, (floor_x_pos+2000, 550))
|
||||
screen.blit(landimg, (floor_x_pos+2500, 550))
|
||||
|
||||
|
||||
def updateFile():
|
||||
f = open('scores.txt', 'r')
|
||||
file = f.readlines()
|
||||
last = int(file[0])
|
||||
|
||||
if last < int(score):
|
||||
f.close()
|
||||
file = open('scores.txt', 'w')
|
||||
file.write(str(score))
|
||||
file.close()
|
||||
|
||||
return score
|
||||
|
||||
return last
|
||||
|
||||
|
||||
def score_display(game_state):
|
||||
if game_state == 'main_game':
|
||||
score_surface = game_font.render(
|
||||
str(int(score)), True, (255, 255, 255))
|
||||
score_rect = score_surface.get_rect(center=(512, 100))
|
||||
screen.blit(score_surface, score_rect)
|
||||
if game_state == 'game_over':
|
||||
score_surface = game_font.render(str(score), True, (255, 255, 255))
|
||||
score_rect = score_surface.get_rect(center=(580, 300))
|
||||
screen.blit(score_surface, score_rect)
|
||||
|
||||
high_score_surface = game_font.render(
|
||||
str(bestscore), True, (255, 255, 255))
|
||||
high_score_rect = high_score_surface.get_rect(center=(600, 400))
|
||||
screen.blit(high_score_surface, high_score_rect)
|
||||
|
||||
score_Text = game_font.render('Score: ', True, (255, 255, 255))
|
||||
score_Text_rect = score_Text.get_rect(center=(508, 300))
|
||||
screen.blit(score_Text, score_Text_rect)
|
||||
|
||||
high_score_Text = game_font.render(
|
||||
'High Score: ', True, (255, 255, 255))
|
||||
high_score_Text_rect = high_score_Text.get_rect(center=(478, 400))
|
||||
screen.blit(high_score_Text, high_score_Text_rect)
|
||||
|
||||
|
||||
def update_score(score, high_score):
|
||||
if score > high_score:
|
||||
high_score = score
|
||||
return high_score
|
||||
|
||||
|
||||
pygame.mixer.pre_init(frequency=44100, size=16, channels=1, buffer=512)
|
||||
pygame.init()
|
||||
screen = pygame.display.set_mode((1024, 768))
|
||||
# screen = pygame.display.set_mode((1024, 768), pygame.FULLSCREEN)
|
||||
clock = pygame.time.Clock()
|
||||
|
||||
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
hertz = 100
|
||||
game_active = True
|
||||
score = 0
|
||||
|
||||
|
||||
BLACK = (0, 0, 0)
|
||||
|
||||
# bkgimg = pygame.image.load('Assets/bkimg23.jpg').convert() # Alternate Background
|
||||
bkgimg = pygame.image.load('Assets/sky.png').convert()
|
||||
bkgimg = pygame.transform.scale(bkgimg, (1024, 600))
|
||||
# landimg = pygame.image.load('Assets/moon.jpeg').convert() #Alternate Surface
|
||||
landimg = pygame.image.load('Assets/landing5.png').convert()
|
||||
# landimg = pygame.image.load('Assets/landing2.png').convert()
|
||||
landimg = pygame.transform.scale(landimg, (1024, 768))
|
||||
player1 = pygame.image.load('Assets/Player/player1.png').convert()
|
||||
player1.set_colorkey(BLACK)
|
||||
player2 = pygame.image.load('Assets/Player/player2.png').convert()
|
||||
player2.set_colorkey(BLACK)
|
||||
player3 = pygame.image.load('Assets/Player/player3.png').convert()
|
||||
player3.set_colorkey(BLACK)
|
||||
player4 = pygame.image.load('Assets/Player/player4.png').convert()
|
||||
player4.set_colorkey(BLACK)
|
||||
player5 = pygame.image.load('Assets/Player/player5.png').convert()
|
||||
player5.set_colorkey(BLACK)
|
||||
player6 = pygame.image.load('Assets/Player/player6.png').convert()
|
||||
player6.set_colorkey(BLACK)
|
||||
player7 = pygame.image.load('Assets/Player/player7.png').convert()
|
||||
player7.set_colorkey(BLACK)
|
||||
player8 = pygame.image.load('Assets/Player/player8.png').convert()
|
||||
player8.set_colorkey(BLACK)
|
||||
player9 = pygame.image.load('Assets/Player/player9.png').convert()
|
||||
player9.set_colorkey(BLACK)
|
||||
player10 = pygame.image.load('Assets/Player/player10.png').convert()
|
||||
player10.set_colorkey(BLACK)
|
||||
deathstar = pygame.image.load('Assets/deathstar1.jpg').convert()
|
||||
|
||||
|
||||
game_begin_surface = pygame.image.load('Assets/Retro1.png')
|
||||
game_begin_surface = pygame.transform.scale(game_begin_surface, (1024, 768))
|
||||
game_begin_surface_rect = game_begin_surface.get_rect(center=(512, 384))
|
||||
|
||||
game_over_surface = pygame.image.load('Assets/EndGraphi1.png')
|
||||
game_over_surface = pygame.transform.scale(game_over_surface, (1024, 768))
|
||||
game_over_surface_rect = game_over_surface.get_rect(center=(512, 384))
|
||||
game_font = pygame.font.Font(
|
||||
'assets/fonts/BigShouldersStencilText-Medium.ttf', 55)
|
||||
|
||||
# Pipes image.
|
||||
pipe_surface = pygame.image.load('assets/Obstacles/pipe-green.png').convert()
|
||||
pipe_suface = pygame.transform.scale2x(pipe_surface)
|
||||
pipe_list = []
|
||||
SPAWNPIPE = pygame.USEREVENT
|
||||
pygame.time.set_timer(SPAWNPIPE, 2000)
|
||||
|
||||
|
||||
player_frames = [player1, player2, player3, player4,
|
||||
player5, player6, player7, player8, player9, player10]
|
||||
player_index = 0
|
||||
player_surface = player_frames[player_index]
|
||||
player_rect = player_surface.get_rect(center=(250, 492))
|
||||
|
||||
PLAYERRUN = pygame.USEREVENT + 1
|
||||
pygame.time.set_timer(PLAYERRUN, 100)
|
||||
|
||||
floor_x_pos = 0
|
||||
pno = 1
|
||||
|
||||
# sound effects
|
||||
hit_sound = pygame.mixer.Sound('assets/sounds/sound_effects/Hit.ogg')
|
||||
point_sound = pygame.mixer.Sound('assets/sounds/sound_effects/Point.ogg')
|
||||
point_sound_count = 100
|
||||
|
||||
bullet_list = []
|
||||
obstacle_list = []
|
||||
MainGame = False
|
||||
BeginGame = True
|
||||
|
||||
|
||||
while BeginGame:
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
pygame.quit()
|
||||
sys.exit()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_SPACE:
|
||||
point_sound.play()
|
||||
hertz = 99.8
|
||||
BeginGame = False
|
||||
MainGame = True
|
||||
|
||||
screen.blit(game_begin_surface, game_begin_surface_rect)
|
||||
|
||||
pygame.display.update()
|
||||
clock.tick(hertz)
|
||||
hertz += 0.02
|
||||
|
||||
|
||||
while MainGame:
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
pygame.quit()
|
||||
sys.exit()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_SPACE and game_active:
|
||||
point_sound.play()
|
||||
if player_rect.centery == 492:
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
while player_movement != -12:
|
||||
player_movement -= gravity
|
||||
elif (event.key == pygame.K_RETURN or event.key == pygame.K_KP_ENTER) and game_active == False:
|
||||
hertz = 99.6
|
||||
game_active = True
|
||||
|
||||
if event.type == PLAYERRUN:
|
||||
if player_index < 9:
|
||||
player_index += 1
|
||||
else:
|
||||
player_index = 0
|
||||
player_surface, player_rect = player_animation()
|
||||
|
||||
if event.type == SPAWNPIPE:
|
||||
pipe_list.append(create_pipe())
|
||||
|
||||
for bullet in bullet_list:
|
||||
if bullet.x < 1024 and bullet.x > 0:
|
||||
bullet.x += bullet.velocity
|
||||
else:
|
||||
bullet_list.pop(bullet_list.index(bullet))
|
||||
|
||||
screen.blit(bkgimg, (0, 0))
|
||||
|
||||
if game_active == True:
|
||||
if player_rect.centery == 492:
|
||||
gravity = 0
|
||||
elif player_rect.centery < 492:
|
||||
gravity = 0.25
|
||||
|
||||
else:
|
||||
gravity = 0
|
||||
player_rect.centery = 492
|
||||
player_movement = 0
|
||||
keys = pygame.key.get_pressed()
|
||||
if keys[pygame.K_END]:
|
||||
if(len(bullet_list) < 1):
|
||||
bullet_list.append(
|
||||
bullets(250, player_rect.centery, 15, 3, (255, 255, 153)))
|
||||
for bullet in bullet_list:
|
||||
bullet.drawbullet(screen)
|
||||
|
||||
player_movement += gravity
|
||||
player_rect.centery += player_movement
|
||||
screen.blit(player_surface, player_rect)
|
||||
game_active = check_collision(pipe_list)
|
||||
score_display('main_game')
|
||||
floor_x_pos -= 5
|
||||
|
||||
pipe_list = move_pipes(pipe_list)
|
||||
draw_pipes(pipe_list)
|
||||
drawfloor()
|
||||
if floor_x_pos <= -2000:
|
||||
floor_x_pos = 0
|
||||
score = int(hertz//0.1-999)
|
||||
largeFont = pygame.font.SysFont('comicsans', 30)
|
||||
text = largeFont.render('Score: ' + str(score), 1, (255, 255, 255))
|
||||
largeFont = pygame.font.SysFont('comicsans', 80)
|
||||
bestscore = updateFile()
|
||||
else:
|
||||
pipe_list.clear()
|
||||
screen.blit(game_over_surface, game_over_surface_rect)
|
||||
score_display('game_over')
|
||||
|
||||
pygame.display.update()
|
||||
clock.tick(hertz)
|
||||
hertz += 0.02
|
||||
BIN
RETRO1.png
Normal file
|
After Width: | Height: | Size: 85 KiB |
277
VideoTrial.py
Normal file
@@ -0,0 +1,277 @@
|
||||
import pygame
|
||||
import sys
|
||||
|
||||
|
||||
def player_animation():
|
||||
new_player = player_frames[player_index]
|
||||
new_player_rect = new_player.get_rect(center=(250, player_rect.centery))
|
||||
return new_player, new_player_rect
|
||||
|
||||
|
||||
# Bullet class
|
||||
class bullets(object):
|
||||
def __init__(self, x, y, length, breadth, color):
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.length = length
|
||||
self.breadth = breadth
|
||||
self.color = color
|
||||
self.velocity = 10
|
||||
|
||||
def drawbullet(self, screen):
|
||||
pygame.draw.rect(screen, self.color, pygame.Rect(
|
||||
self.x, self.y, self.length, self.breadth))
|
||||
|
||||
|
||||
def create_pipe():
|
||||
new_pipe = pipe_suface.get_rect(midtop=(1020, 452))
|
||||
return new_pipe
|
||||
|
||||
|
||||
def move_pipes(pipes):
|
||||
for pipe in pipes:
|
||||
pipe.centerx -= 15
|
||||
return pipes
|
||||
|
||||
|
||||
def draw_pipes(pipes):
|
||||
for pipe in pipes:
|
||||
screen.blit(pipe_suface, pipe)
|
||||
|
||||
|
||||
def check_collision(pipes):
|
||||
for pipe in pipes:
|
||||
if player_rect.colliderect(pipe):
|
||||
hit_sound.play()
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def drawfloor():
|
||||
|
||||
screen.blit(landimg, (floor_x_pos, 550))
|
||||
screen.blit(landimg, (floor_x_pos+500, 550))
|
||||
screen.blit(landimg, (floor_x_pos+1000, 550))
|
||||
screen.blit(landimg, (floor_x_pos+1500, 550))
|
||||
screen.blit(landimg, (floor_x_pos+2000, 550))
|
||||
screen.blit(landimg, (floor_x_pos+2500, 550))
|
||||
|
||||
|
||||
def updateFile():
|
||||
f = open('scores.txt', 'r')
|
||||
file = f.readlines()
|
||||
last = int(file[0])
|
||||
|
||||
if last < int(score):
|
||||
f.close()
|
||||
file = open('scores.txt', 'w')
|
||||
file.write(str(score))
|
||||
file.close()
|
||||
|
||||
return score
|
||||
|
||||
return last
|
||||
|
||||
|
||||
def score_display(game_state):
|
||||
if game_state == 'main_game':
|
||||
score_surface = game_font.render(
|
||||
str(int(score)), True, (255, 255, 255))
|
||||
score_rect = score_surface.get_rect(center=(512, 100))
|
||||
screen.blit(score_surface, score_rect)
|
||||
if game_state == 'game_over':
|
||||
score_surface = game_font.render(str(score), True, (255, 255, 255))
|
||||
score_rect = score_surface.get_rect(center=(512, 100))
|
||||
screen.blit(score_surface, score_rect)
|
||||
|
||||
high_score_surface = game_font.render(
|
||||
str(bestscore), True, (255, 255, 255))
|
||||
high_score_rect = high_score_surface.get_rect(center=(512, 500))
|
||||
screen.blit(high_score_surface, high_score_rect)
|
||||
|
||||
|
||||
def update_score(score, high_score):
|
||||
if score > high_score:
|
||||
high_score = score
|
||||
return high_score
|
||||
|
||||
|
||||
pygame.mixer.pre_init(frequency=44100, size=16, channels=1, buffer=512)
|
||||
pygame.init()
|
||||
screen = pygame.display.set_mode((1024, 768))
|
||||
clock = pygame.time.Clock()
|
||||
|
||||
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
hertz = 100
|
||||
game_active = True
|
||||
score = 0
|
||||
|
||||
|
||||
BLACK = (0, 0, 0)
|
||||
|
||||
# bkgimg = pygame.image.load('Assets/bkimg23.jpg').convert() # Alternate Background
|
||||
bkgimg = pygame.image.load('Assets/sky.png').convert()
|
||||
bkgimg = pygame.transform.scale(bkgimg, (1024, 600))
|
||||
# landimg = pygame.image.load('Assets/moon.jpeg').convert() #Alternate Surface
|
||||
landimg = pygame.image.load('Assets/landing5.png').convert()
|
||||
# landimg = pygame.image.load('Assets/landing2.png').convert()
|
||||
landimg = pygame.transform.scale(landimg, (1024, 768))
|
||||
player1 = pygame.image.load('Assets/Player/player1.png').convert()
|
||||
player1.set_colorkey(BLACK)
|
||||
player2 = pygame.image.load('Assets/Player/player2.png').convert()
|
||||
player2.set_colorkey(BLACK)
|
||||
player3 = pygame.image.load('Assets/Player/player3.png').convert()
|
||||
player3.set_colorkey(BLACK)
|
||||
player4 = pygame.image.load('Assets/Player/player4.png').convert()
|
||||
player4.set_colorkey(BLACK)
|
||||
player5 = pygame.image.load('Assets/Player/player5.png').convert()
|
||||
player5.set_colorkey(BLACK)
|
||||
player6 = pygame.image.load('Assets/Player/player6.png').convert()
|
||||
player6.set_colorkey(BLACK)
|
||||
player7 = pygame.image.load('Assets/Player/player7.png').convert()
|
||||
player7.set_colorkey(BLACK)
|
||||
player8 = pygame.image.load('Assets/Player/player8.png').convert()
|
||||
player8.set_colorkey(BLACK)
|
||||
player9 = pygame.image.load('Assets/Player/player9.png').convert()
|
||||
player9.set_colorkey(BLACK)
|
||||
player10 = pygame.image.load('Assets/Player/player10.png').convert()
|
||||
player10.set_colorkey(BLACK)
|
||||
deathstar = pygame.image.load('Assets/deathstar1.jpg').convert()
|
||||
|
||||
|
||||
game_begin_surface = pygame.image.load('Retro.png')
|
||||
game_begin_surface = pygame.transform.scale(game_begin_surface, (1024, 768))
|
||||
game_begin_surface_rect = game_begin_surface.get_rect(center=(512, 384))
|
||||
|
||||
game_over_surface = pygame.image.load('Assets/gameover.jpg')
|
||||
game_over_surface = pygame.transform.scale(game_over_surface, (1024, 768))
|
||||
game_over_surface_rect = game_over_surface.get_rect(center=(512, 384))
|
||||
game_font = pygame.font.Font(
|
||||
'assets/fonts/BigShouldersStencilText-Medium.ttf', 40)
|
||||
|
||||
# Pipes image.
|
||||
pipe_surface = pygame.image.load('assets/Obstacles/pipe-green.png').convert()
|
||||
pipe_suface = pygame.transform.scale2x(pipe_surface)
|
||||
pipe_list = []
|
||||
SPAWNPIPE = pygame.USEREVENT
|
||||
pygame.time.set_timer(SPAWNPIPE, 2000)
|
||||
|
||||
|
||||
player_frames = [player1, player2, player3, player4,
|
||||
player5, player6, player7, player8, player9, player10]
|
||||
player_index = 0
|
||||
player_surface = player_frames[player_index]
|
||||
player_rect = player_surface.get_rect(center=(250, 492))
|
||||
|
||||
PLAYERRUN = pygame.USEREVENT + 1
|
||||
pygame.time.set_timer(PLAYERRUN, 100)
|
||||
|
||||
floor_x_pos = 0
|
||||
pno = 1
|
||||
|
||||
# sound effects
|
||||
hit_sound = pygame.mixer.Sound('assets/sounds/sound_effects/Hit.ogg')
|
||||
point_sound = pygame.mixer.Sound('assets/sounds/sound_effects/Point.ogg')
|
||||
point_sound_count = 100
|
||||
|
||||
bullet_list = []
|
||||
obstacle_list = []
|
||||
MainGame = False
|
||||
BeginGame = True
|
||||
|
||||
|
||||
while BeginGame:
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
pygame.quit()
|
||||
sys.exit()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_SPACE:
|
||||
point_sound.play()
|
||||
BeginGame = False
|
||||
MainGame = True
|
||||
|
||||
screen.blit(game_begin_surface, game_begin_surface_rect)
|
||||
|
||||
pygame.display.update()
|
||||
clock.tick(hertz)
|
||||
hertz += 0.02
|
||||
|
||||
|
||||
while MainGame:
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
pygame.quit()
|
||||
sys.exit()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_SPACE and game_active:
|
||||
point_sound.play()
|
||||
if player_rect.centery == 492:
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
while player_movement != -12:
|
||||
player_movement -= gravity
|
||||
|
||||
if event.type == PLAYERRUN:
|
||||
if player_index < 9:
|
||||
player_index += 1
|
||||
else:
|
||||
player_index = 0
|
||||
player_surface, player_rect = player_animation()
|
||||
|
||||
if event.type == SPAWNPIPE:
|
||||
pipe_list.append(create_pipe())
|
||||
|
||||
for bullet in bullet_list:
|
||||
if bullet.x < 1024 and bullet.x > 0:
|
||||
bullet.x += bullet.velocity
|
||||
else:
|
||||
bullet_list.pop(bullet_list.index(bullet))
|
||||
|
||||
screen.blit(bkgimg, (0, 0))
|
||||
|
||||
if game_active == True:
|
||||
if player_rect.centery == 492:
|
||||
gravity = 0
|
||||
elif player_rect.centery < 492:
|
||||
gravity = 0.25
|
||||
|
||||
else:
|
||||
gravity = 0
|
||||
player_rect.centery = 492
|
||||
player_movement = 0
|
||||
keys = pygame.key.get_pressed()
|
||||
if keys[pygame.K_END]:
|
||||
if(len(bullet_list) < 1):
|
||||
bullet_list.append(
|
||||
bullets(250, player_rect.centery, 15, 3, (255, 255, 153)))
|
||||
for bullet in bullet_list:
|
||||
bullet.drawbullet(screen)
|
||||
|
||||
player_movement += gravity
|
||||
player_rect.centery += player_movement
|
||||
screen.blit(player_surface, player_rect)
|
||||
game_active = check_collision(pipe_list)
|
||||
score_display('main_game')
|
||||
floor_x_pos -= 5
|
||||
|
||||
pipe_list = move_pipes(pipe_list)
|
||||
draw_pipes(pipe_list)
|
||||
drawfloor()
|
||||
if floor_x_pos <= -2000:
|
||||
floor_x_pos = 0
|
||||
score = int(hertz//0.1-999)
|
||||
largeFont = pygame.font.SysFont('comicsans', 30)
|
||||
text = largeFont.render('Score: ' + str(score), 1, (255, 255, 255))
|
||||
largeFont = pygame.font.SysFont('comicsans', 80)
|
||||
bestscore = updateFile()
|
||||
else:
|
||||
pipe_list.clear()
|
||||
screen.blit(game_over_surface, game_over_surface_rect)
|
||||
score_display('game_over')
|
||||
|
||||
pygame.display.update()
|
||||
clock.tick(hertz)
|
||||
hertz += 0.02
|
||||
120
mygame.py
Normal file
@@ -0,0 +1,120 @@
|
||||
import sys
|
||||
import pygame
|
||||
|
||||
|
||||
def player_animation():
|
||||
new_player = player_frames[player_index]
|
||||
new_player_rect = new_player.get_rect(center=(375, player_rect.centery))
|
||||
return new_player, new_player_rect
|
||||
|
||||
|
||||
def drawfloor():
|
||||
|
||||
screen.blit(landimg, (floor_x_pos, 475))
|
||||
screen.blit(landimg, (floor_x_pos + 500, 475))
|
||||
screen.blit(landimg, (floor_x_pos + 1000, 475))
|
||||
screen.blit(landimg, (floor_x_pos + 1500, 475))
|
||||
screen.blit(landimg, (floor_x_pos + 2000, 475))
|
||||
screen.blit(landimg, (floor_x_pos + 2500, 475))
|
||||
|
||||
# if pno==1:
|
||||
# screen.blit(player1,(200,237))
|
||||
# elif pno==2:
|
||||
# screen.blit(player2,(200,237))
|
||||
# elif pno==3:
|
||||
# screen.blit(player3,(200,237))
|
||||
# elif pno==4:
|
||||
# screen.blit(player4,(200,237))
|
||||
# elif pno==5:
|
||||
# screen.blit(player5,(200,237))
|
||||
# elif pno==6:
|
||||
# screen.blit(player6,(200,237))
|
||||
# elif pno==7:
|
||||
# screen.blit(player7,(200,237))
|
||||
# elif pno==8:
|
||||
# screen.blit(player8,(200,237))
|
||||
# elif pno==9:
|
||||
# screen.blit(player9,(200,237))
|
||||
# elif pno==10:
|
||||
# screen.blit(player10,(200,237))
|
||||
|
||||
|
||||
pygame.init()
|
||||
screen = pygame.display.set_mode((1366, 768))
|
||||
clock = pygame.time.Clock()
|
||||
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
game_active = True
|
||||
|
||||
bkgimg = pygame.image.load('Assets/Hyades.jpg').convert()
|
||||
bkgimg = pygame.transform.scale2x(bkgimg)
|
||||
landimg = pygame.image.load('Assets/moon.jpeg').convert()
|
||||
player1 = pygame.image.load('Assets/Player/player1.png').convert()
|
||||
player2 = pygame.image.load('Assets/Player/player2.png').convert()
|
||||
player3 = pygame.image.load('Assets/Player/player3.png').convert()
|
||||
player4 = pygame.image.load('Assets/Player/player4.png').convert()
|
||||
player5 = pygame.image.load('Assets/Player/player5.png').convert()
|
||||
player6 = pygame.image.load('Assets/Player/player6.png').convert()
|
||||
player7 = pygame.image.load('Assets/Player/player7.png').convert()
|
||||
player8 = pygame.image.load('Assets/Player/player8.png').convert()
|
||||
player9 = pygame.image.load('Assets/Player/player9.png').convert()
|
||||
player10 = pygame.image.load('Assets/Player/player10.png').convert()
|
||||
deathstar = pygame.image.load('Assets/deathstar1.jpg').convert()
|
||||
|
||||
player_frames = [player1, player2, player3, player4,
|
||||
player5, player6, player7, player8, player9, player10]
|
||||
player_index = 0
|
||||
player_surface = player_frames[player_index]
|
||||
player_rect = player_surface.get_rect(center=(375, 417))
|
||||
|
||||
PLAYERRUN = pygame.USEREVENT + 1
|
||||
pygame.time.set_timer(PLAYERRUN, 100)
|
||||
|
||||
floor_x_pos = 0
|
||||
pno = 1
|
||||
|
||||
while True:
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
pygame.quit()
|
||||
sys.exit()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_SPACE and game_active:
|
||||
if player_rect.centery == 417:
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
while player_movement != -10:
|
||||
player_movement -= gravity
|
||||
|
||||
if event.type == PLAYERRUN:
|
||||
if player_index < 9:
|
||||
player_index += 1
|
||||
else:
|
||||
player_index = 0
|
||||
player_surface, player_rect = player_animation()
|
||||
|
||||
screen.blit(bkgimg, (0, 0))
|
||||
|
||||
screen.blit(bkgimg, (0, 0))
|
||||
|
||||
if game_active == True:
|
||||
if player_rect.centery == 417:
|
||||
gravity = 0
|
||||
elif player_rect.centery < 417:
|
||||
gravity = 0.25
|
||||
else:
|
||||
gravity = 0
|
||||
player_rect.centery = 417
|
||||
player_movement = 0
|
||||
player_movement += gravity
|
||||
player_rect.centery += player_movement
|
||||
screen.blit(player_surface, player_rect)
|
||||
|
||||
floor_x_pos -= 1
|
||||
|
||||
drawfloor()
|
||||
if floor_x_pos <= -2000:
|
||||
floor_x_pos = 0
|
||||
pygame.display.update()
|
||||
clock.tick(500)
|
||||
215
mygame1.py
Normal file
@@ -0,0 +1,215 @@
|
||||
import sys
|
||||
import pygame
|
||||
import random
|
||||
|
||||
|
||||
def player_animation():
|
||||
new_player = player_frames[player_index]
|
||||
new_player_rect = new_player.get_rect(center=(375, player_rect.centery))
|
||||
return new_player, new_player_rect
|
||||
|
||||
|
||||
def drawfloor():
|
||||
|
||||
screen.blit(landimg, (floor_x_pos, 475))
|
||||
screen.blit(landimg, (floor_x_pos + 500, 475))
|
||||
screen.blit(landimg, (floor_x_pos + 1000, 475))
|
||||
screen.blit(landimg, (floor_x_pos + 1500, 475))
|
||||
screen.blit(landimg, (floor_x_pos + 2000, 475))
|
||||
screen.blit(landimg, (floor_x_pos + 2500, 475))
|
||||
|
||||
# if pno==1:
|
||||
# screen.blit(player1,(200,237))
|
||||
# elif pno==2:
|
||||
# screen.blit(player2,(200,237))
|
||||
# elif pno==3:
|
||||
# screen.blit(player3,(200,237))
|
||||
# elif pno==4:
|
||||
# screen.blit(player4,(200,237))
|
||||
# elif pno==5:
|
||||
# screen.blit(player5,(200,237))
|
||||
# elif pno==6:
|
||||
# screen.blit(player6,(200,237))
|
||||
# elif pno==7:
|
||||
# screen.blit(player7,(200,237))
|
||||
# elif pno==8:
|
||||
# screen.blit(player8,(200,237))
|
||||
# elif pno==9:
|
||||
# screen.blit(player9,(200,237))
|
||||
# elif pno==10:
|
||||
# screen.blit(player10,(200,237))
|
||||
|
||||
|
||||
class bullets(object):
|
||||
# Bullet class
|
||||
def __init__(self, x, y, length, breadth, color):
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.length = length
|
||||
self.breadth = breadth
|
||||
self.color = color
|
||||
self.velocity = 7
|
||||
|
||||
def drawbullet(self, screen):
|
||||
pygame.draw.rect(screen, self.color, pygame.Rect(
|
||||
self.x, self.y, self.length, self.breadth))
|
||||
|
||||
|
||||
# class obstacles(object):
|
||||
# # Obstacle class
|
||||
# def __init__(self, obstacle, x, y, height, width):
|
||||
# self.image = obstacle
|
||||
# self.x = x
|
||||
# self.y = y
|
||||
# self.height = height
|
||||
# self.width = width
|
||||
# self.box = (x, y, width, height)
|
||||
# self.velocity = 1
|
||||
|
||||
# def drawobstacle(self, screen):
|
||||
# self.box = (self.x, self.y, self.width-10, self.height)
|
||||
# screen.blit(pygame.transform.scale(
|
||||
# self.image, (64, 64)), (self.x, self.y))
|
||||
# pygame.draw.rect(screen, (255, 0, 0), self.box, 2)
|
||||
|
||||
|
||||
def create_pipe():
|
||||
random_pipe_pos = random.choice(pipe_height)
|
||||
new_pipe = pipe_suface.get_rect(midtop=(1500, random_pipe_pos))
|
||||
return new_pipe
|
||||
|
||||
|
||||
def move_pipes(pipes):
|
||||
for pipe in pipes:
|
||||
pipe.centerx -= 5
|
||||
return pipes
|
||||
|
||||
|
||||
def draw_pipes(pipes):
|
||||
for pipe in pipes:
|
||||
screen.blit(pipe_suface, pipe)
|
||||
|
||||
# def check_collision(pipes):
|
||||
# for pipe in pipes:
|
||||
# for bullet in bullet_list:
|
||||
# if bullet.colliderect(pipe):
|
||||
# point_sound.play()
|
||||
|
||||
|
||||
pygame.init()
|
||||
screen = pygame.display.set_mode((1366, 768))
|
||||
clock = pygame.time.Clock()
|
||||
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
game_active = True
|
||||
|
||||
bkgimg = pygame.image.load('Assets/Hyades.jpg').convert()
|
||||
bkgimg = pygame.transform.scale2x(bkgimg)
|
||||
landimg = pygame.image.load('Assets/moon.jpeg').convert()
|
||||
player1 = pygame.image.load('Assets/Player/player1.png').convert()
|
||||
player2 = pygame.image.load('Assets/Player/player2.png').convert()
|
||||
player3 = pygame.image.load('Assets/Player/player3.png').convert()
|
||||
player4 = pygame.image.load('Assets/Player/player4.png').convert()
|
||||
player5 = pygame.image.load('Assets/Player/player5.png').convert()
|
||||
player6 = pygame.image.load('Assets/Player/player6.png').convert()
|
||||
player7 = pygame.image.load('Assets/Player/player7.png').convert()
|
||||
player8 = pygame.image.load('Assets/Player/player8.png').convert()
|
||||
player9 = pygame.image.load('Assets/Player/player9.png').convert()
|
||||
player10 = pygame.image.load('Assets/Player/player10.png').convert()
|
||||
deathstar = pygame.image.load('Assets/deathstar1.jpg').convert()
|
||||
# obstacle = pygame.image.load('Assets/Obstacles/1.jpg').convert()
|
||||
|
||||
# Pipes image.
|
||||
pipe_surface = pygame.image.load('assets/Obstacles/1.jpg').convert()
|
||||
pipe_suface = pygame.transform.scale2x(pipe_surface)
|
||||
pipe_list = []
|
||||
SPAWNPIPE = pygame.USEREVENT
|
||||
pygame.time.set_timer(SPAWNPIPE, 1200)
|
||||
|
||||
bullet_list = []
|
||||
obstacle_list = []
|
||||
# obstacle_list.append(obstacles(obstacle, 1000, 200, 64, 64))
|
||||
|
||||
player_frames = [player1, player2, player3, player4,
|
||||
player5, player6, player7, player8, player9, player10]
|
||||
for i in range(len(player_frames)):
|
||||
player_frames[i] = pygame.transform.scale(player_frames[i], (100, 113))
|
||||
|
||||
player_index = 0
|
||||
player_surface = player_frames[player_index]
|
||||
player_rect = player_surface.get_rect(center=(375, 417))
|
||||
|
||||
PLAYERRUN = pygame.USEREVENT + 1
|
||||
pygame.time.set_timer(PLAYERRUN, 100)
|
||||
|
||||
floor_x_pos = 0
|
||||
pno = 1
|
||||
|
||||
# point_sound = pygame.mixer.Sound('assets/sounds/sound_effects/Point.ogg')
|
||||
# point_sound_count = 100
|
||||
|
||||
while True:
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
pygame.quit()
|
||||
sys.exit()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_SPACE and game_active:
|
||||
if player_rect.centery == 417:
|
||||
player_movement = 0
|
||||
gravity = 0.25
|
||||
while player_movement != -12:
|
||||
player_movement -= gravity
|
||||
|
||||
if event.type == PLAYERRUN:
|
||||
if player_index < 9:
|
||||
player_index += 1
|
||||
else:
|
||||
player_index = 0
|
||||
player_surface, player_rect = player_animation()
|
||||
if event.type == SPAWNPIPE:
|
||||
pipe_list.append(create_pipe())
|
||||
|
||||
for bullet in bullet_list:
|
||||
if bullet.x < 1366 and bullet.x > 0:
|
||||
bullet.x += bullet.velocity
|
||||
else:
|
||||
bullet_list.pop(bullet_list.index(bullet))
|
||||
|
||||
screen.blit(bkgimg, (0, 0))
|
||||
|
||||
if game_active == True:
|
||||
if player_rect.centery == 417:
|
||||
gravity = 0
|
||||
elif player_rect.centery < 417:
|
||||
gravity = 0.25
|
||||
else:
|
||||
gravity = 0
|
||||
player_rect.centery = 417
|
||||
player_movement = 0
|
||||
pipe_list = move_pipes(pipe_list)
|
||||
pipe_height = [300, 350, 400, 450, 500, 550]
|
||||
draw_pipes(pipe_list)
|
||||
|
||||
keys = pygame.key.get_pressed()
|
||||
if keys[pygame.K_END]:
|
||||
if(len(bullet_list) < 1):
|
||||
bullet_list.append(
|
||||
bullets(375, player_rect.centery, 15, 3, (255, 255, 153)))
|
||||
for bullet in bullet_list:
|
||||
bullet.drawbullet(screen)
|
||||
player_movement += gravity
|
||||
player_rect.centery += player_movement
|
||||
screen.blit(player_surface, player_rect)
|
||||
|
||||
floor_x_pos -= 1
|
||||
|
||||
drawfloor()
|
||||
if floor_x_pos <= -2000:
|
||||
floor_x_pos = 0
|
||||
|
||||
pipe_list = move_pipes(pipe_list)
|
||||
draw_pipes(pipe_list)
|
||||
pygame.display.update()
|
||||
clock.tick(500)
|
||||
1
scores.txt
Normal file
@@ -0,0 +1 @@
|
||||
2450
|
||||