~facundo/enjuewemela/trunk

« back to all changes in this revision

Viewing changes to cocos/audio/actions.py

  • Committer: facundo at com
  • Date: 2011-05-14 18:13:25 UTC
  • mfrom: (67.1.4 v3rel)
  • Revision ID: facundo@taniquetil.com.ar-20110514181325-614h8kjz32w5cmoy
Refactor back

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from cocos import actions
2
 
from cocos import audio
3
 
 
4
 
class PlayAction(actions.InstantAction):
5
 
    def init(self, sound):
6
 
        self.sound = sound
7
 
 
8
 
    def start(self):
9
 
        if audio._working:
10
 
            self.sound.play()
11
 
    
12
 
    def __deepcopy__(self, memo):
13
 
        # A shallow copy should be enough because sound effects are immutable
14
 
        # Also, we don't need to use the memo, because there can not be a cycle
15
 
        return PlayAction(self.sound)
16