Skip to content
Browse files

added possibility to easily enable/disable particle explosions

  • Loading branch information...
1 parent 70f0ae3 commit ca7524f4dff34a0e2e02e08c9544d9e674f1632c michael committed
View
9 .idea/MICshooter.iml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+ <component name="NewModuleRootManager">
+ <content url="file://$MODULE_DIR$" />
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ </component>
+</module>
+
View
19 .idea/codeStyleSettings.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectCodeStyleSettingsManager">
+ <option name="PER_PROJECT_SETTINGS">
+ <value>
+ <option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
+ <codeStyleSettings language="JavaScript">
+ <option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
+ <option name="PARENT_SETTINGS_INSTALLED" value="true" />
+ </codeStyleSettings>
+ <codeStyleSettings language="Python">
+ <option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
+ <option name="PARENT_SETTINGS_INSTALLED" value="true" />
+ </codeStyleSettings>
+ </value>
+ </option>
+ </component>
+</project>
+
View
5 .idea/encodings.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
+</project>
+
View
7 .idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,7 @@
+<component name="InspectionProjectProfileManager">
+ <settings>
+ <option name="PROJECT_PROFILE" />
+ <option name="USE_PROJECT_PROFILE" value="false" />
+ <version value="1.0" />
+ </settings>
+</component>
View
8 .idea/misc.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectResources">
+ <default-html-doctype>$APPLICATION_HOME_DIR$/lib/pycharm.jar!/resources/html5-schema/html5.rnc</default-html-doctype>
+ </component>
+ <component name="ProjectRootManager" version="2" project-jdk-name="Python 2.7.3 (/usr/bin/python2.7)" project-jdk-type="Python SDK" />
+</project>
+
View
9 .idea/modules.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectModuleManager">
+ <modules>
+ <module fileurl="file://$PROJECT_DIR$/.idea/MICshooter.iml" filepath="$PROJECT_DIR$/.idea/MICshooter.iml" />
+ </modules>
+ </component>
+</project>
+
View
5 .idea/scopes/scope_settings.xml
@@ -0,0 +1,5 @@
+<component name="DependencyValidationManager">
+ <state>
+ <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+ </state>
+</component>
View
7 .idea/vcs.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="VcsDirectoryMappings">
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
+ </component>
+</project>
+
View
2 sources/common_pygame.py
@@ -13,3 +13,5 @@
screenwidth=screen.get_width()
screenheight=screen.get_height()
+explosions=0
+
View
15 sources/enemy.py
@@ -158,10 +158,12 @@ def processHit(self,laserlist, ship):
if self.life<=0:
self.dying=True
if self.typeofship==0:
- #particles.addExplosion(self.x, self.y, 2)
+ if common_pygame.explosions ==1:
+ particles.addExplosion(self.x, self.y, 2)
self.menu.play_sound(self.sounds['explosion.wav'])
else:
- #particles.addExplosion(self.x, self.y, 1)
+ if common_pygame.explosions ==1:
+ particles.addExplosion(self.x, self.y, 1)
self.menu.play_sound(self.sounds['explosion2.wav'])
Enemy.nbAsteroids=Enemy.nbAsteroids-1
print("dying")
@@ -195,7 +197,8 @@ def processHit(self,laserlist, ship):
if self.life<=0:
self.dying=True
ship.score=ship.score+10
- #particles.addExplosion(self.x, self.y, 2)
+ if common_pygame.explosions==1:
+ particles.addExplosion(self.x, self.y, 2)
self.menu.play_sound(self.sounds['explosion.wav'])
else:
self.shot=30
@@ -204,7 +207,8 @@ def processHit(self,laserlist, ship):
elif self.typeofship==1:
self.dying = True
ship.score=ship.score+10
- #particles.addExplosion(self.x, self.y, 1)
+ if common_pygame.explosions==1:
+ particles.addExplosion(self.x, self.y, 1)
self.menu.play_sound(self.sounds['explosion2.wav'])
#print("dying")
Enemy.nbAsteroids=Enemy.nbAsteroids-1
@@ -214,7 +218,8 @@ def processHit(self,laserlist, ship):
if self.life<=0:
self.dying=True
ship.score=ship.score+10
- #particles.addExplosion(self.x, self.y, 3)
+ if common_pygame.explosions==1:
+ particles.addExplosion(self.x, self.y, 3)
self.menu.play_sound(self.sounds['explosion.wav'])
else:
self.shot=30
View
2 sources/load_resources.py
@@ -19,7 +19,7 @@ def add_sprite(spritefile):
global single_sprites
single_sprites[spritefile]=pygame.image.load(os.path.join('images',spritefile)).convert_alpha()
single_sprites[spritefile].set_colorkey((255,0,255))
-
+
def add_sprite_sequence(spritesequence, h, w):
global sprite_sequences
View
0 sources/make_package.sh 100644 → 100755
File mode changed.

0 comments on commit ca7524f

Please sign in to comment.
Something went wrong with that request. Please try again.